diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_content_list.json b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fb6411d56e25ddcd939abc3f446a4235b479efea --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47bb6d10515a388eb6a00e71e55f3fc4bd11883c0f6728921c38b08f792e70ee +size 88798 diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_model.json b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4185a8102ede77b25e1adab78a948e8e1da514f8 --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca9a4053132269d6380b05f83b477ac0f8c45793c03910e49b6cc67220a849cb +size 111712 diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_origin.pdf b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..40dc9f0951c59addfecb7d6141bf80c860328965 --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/afdd494d-03a7-4b1f-806c-25351e381323_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cbef6b1d472c7c941aa1ca5a83fccff9ae5bf64a40c5a6ed3e9513cb3dca66a +size 1861459 diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/full.md b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3d4f0d4aad26cd8eaf55ecfbf59088c04cacf018 --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/full.md @@ -0,0 +1,339 @@ +# Learning an Augmented RGB Representation with Cross-Modal Knowledge Distillation for Action Detection + +Rui Dai $^{1,2}$ , Srijan Das $^{3}$ , François Bremond $^{1,2}$ + +$^{1}$ Inria $^{2}$ Université Côte d'Azur $^{3}$ Stony Brook University + +1,2{name.surname}@inria.fr 3{name.surname}@stonybrook.edu + +# Abstract + +In video understanding, most cross-modal knowledge distillation (KD) methods are tailored for classification tasks, focusing on the discriminative representation of the trimmed videos. However, action detection requires not only categorizing actions, but also localizing them in untrimmed videos. Therefore, transferring knowledge pertaining to temporal relations is critical for this task which is missing in the previous cross-modal KD frameworks. To this end, we aim at learning an augmented RGB representation for action detection, taking advantage of additional modalities at training time through KD. We propose a KD framework consisting of two levels of distillation. On one hand, atomic-level distillation encourages the RGB student to learn the sub-representation of the actions from the teacher in a contrastive manner. On the other hand, sequence-level distillation encourages the student to learn the temporal knowledge from the teacher, which consists of transferring the Global Contextual Relations and the Action Boundary Saliency. The result is an Augmented-RGB stream that can achieve competitive performance as the two-stream network while using only RGB at inference time. Extensive experimental analysis shows that our proposed distillation framework is generic and outperforms other popular cross-modal distillation methods in action detection task. + +# 1. Introduction + +Learning representation from untrimmed videos for action detection is a challenging vision task. Action detection aims at categorizing all the frames corresponding to every action occurring in an untrimmed video. The two main challenges for action detection are to tackle composite action patterns and fine-grained details [47]. These challenges are especially difficult in cases of real-world scenarios, where actions are densely distributed and overlapping each other [63]. To address these challenges, a typical setting, called two-stream network [49], consists in combining RGB with additional modalities like optical flow [41, 62], + +![](images/ab88f0862e45e3a424f794f316f62cde8abcfca29953937f65d2122f4b9b545e.jpg) +Figure 1. Proposed cross-modal distillation framework for action detection. Our distillation framework is composed of three loss terms corresponding to different types of knowledge to transfer across modalities. $\mathcal{L}_{\text{Atomic}}$ : Atomic KD loss; $\mathcal{L}_{\text{Global}}$ : Global Contextual Relation loss; $\mathcal{L}_{\text{Boundary}}$ : Boundary Saliency loss. + +3D poses [68, 11] to take into account the complementary nature of each modality. However, using such setting is contingent upon the availability of multiple modalities and of expensive processing resources. The cost of computing additional modalities could be prohibitive, especially for long untrimmed videos. These constraints limit the usage of multi-modal action detection methods for real-world applications. + +Previous studies [20, 21] have shown that cross-modal Knowledge Distillation (KD) is an effective mechanism to avoid the computation of the additional modalities during test time, while preserving the complementary information from the additional modalities. However, most previous works [6, 18, 17] in the video understanding domain have investigated solely the classification of short trimmed videos [28, 50, 30]. In these works, each video corresponds to a single action and the distillation framework infuses the aggregated knowledge of an action instance from one modality into another. In contrast to trimmed videos, untrimmed videos contain rich sequential knowledge with complex temporal relations. Untrimmed videos in real-world scenarios tend to have cluttered background and mul + +tiple correlated actions either in sequence [36] or in parallel [63, 48]. Therefore, distillation mechanisms tailored for classification tasks and extended for detection tasks lack in capturing fine-grained details along the temporal dimension. Now the question remains, what should be the right strategy to distillate cross-modal knowledge for action detection in untrimmed videos? + +In this work, we propose a distillation framework to combine cross-modal information for detecting actions with high precision and minimal resource. The goal is to reach the two-stream performance while using only the RGB stream at inference time. The proposed distillation framework consists of a traditional teacher-student network architecture which operates in a Seq2Seq fashion [42, 10], thanks to three new distillation losses dedicated to the action detection task as illustrated in Fig. 1. The first loss in our formulation is the Atomic KD loss, which enables the RGB student network to mimic the feature representation of every individual snippet from the teacher network in a contrastive manner. This loss-term extends the cross-modal KD mechanism fabricated for the classification tasks to the temporal domain [38], by transferring the knowledge only between one-to-one corresponding snippets of different modalities. As a snippet is often shorter than the action instance in an untrimmed video, so this loss encourages a transfer of sub-representation [19] of the action, for example, "raising arm" in the "drinking" action. Here, such sub-representation w.r.t. the entire video corresponds to an atomic piece of knowledge within the complete action feature distribution. However, the untrimmed video is composed of a sequence of snippets, distilling only the atomic representation is not sufficient for learning discriminative action representation. Thus, distillation mechanisms dedicated to represent specifically an action within an untrimmed video are required. + +We therefore introduce two loss-terms for sequence-level KD so as to transfer the cross-snippet relations between different modalities. Firstly, we propose a Global Contextual Relation loss to transfer the contextual information of the sequence between modalities. In our work, contextual information is defined as the embedding of the correlation between all the snippet features. Thanks to this loss term, every student snippet feature can learn in the latent space from all the correlated teacher snippets within the untrimmed videos (Fig. 1). With this loss-term, detecting one action in a snippet can benefit from the information in the correlated snippets (corresponding to related actions, e.g. take and eat sandwich) across modalities, resulting in better action detection performance. Secondly, we propose another KD loss to distillate the boundary saliency from the teacher to RGB student network, dubbed Boundary Saliency loss. This ensures a more precise action boundary detection of the RGB student which is prone to imprecise action boundary detection due to weak temporal signals. In an untrimmed video, + +the start and end moments of the action are more salient than other parts (see Fig. 1). Intuitively, the feature variation across consecutive snippets in the video can reflect such saliency of the action boundaries. Therefore, learning this variation from a modality that can better capture the movement (e.g. optical flow, 3D poses) encourages the RGB stream representation to be more sensitive to the action boundaries. + +Contributions. To summarize, we take a step towards the little-explored but crucial, cross-modal KD for action detection. We build a Seq2Seq KD framework for action detection with a novel formulation. This formulation consists of an atomic-level KD loss and two sequence-level KD losses. The three loss terms in our formulation are jointly optimized in an end-to-end fashion. To the best of our knowledge, we are the first to propose a formulation containing sequential KD loss for the action detection task. We perform comprehensive experiments on five benchmarks. Our joint formulation significantly improves the vanilla RGB baseline (up to $+6.8\%$ improvement on MultiTHUMOS w.r.t. vanilla-RGB) and achieves the Two-stream performance while using only RGB at inference time. The consistent improvement on all these datasets corroborates the effectiveness and robustness of our distillation framework. + +# 2. Related work + +In this section, we briefly review the action detection architectures and the state-of-the-art cross-modal distillation methods. + +# 2.1. Action Detection + +Depending on the density of annotation, there are two kinds of dataset for action detection: (1) Sparsely labeled [26, 13, 36] and (2) Densely labeled [63, 48, 8] datasets. In the community, most action detection approaches [67, 16, 62] are custom-made for the sparsely labeled datasets. As densely labeled datasets include fine-grained actions occurring concurrently, they are more challenging and close to real-world scenarios [63]. Concerning the popular action detection approaches, anchor-based methods [61, 3, 16] are inspired by the two-stage object detection framework, which leverages a set of pre-defined anchors to generate action proposals along with another classification stage. However, anchor-based methods require a large number of anchors for generating the proposals and hence under-perform on densely labeled datasets [61, 5]. To handle the above issues, some methods [42, 31, 9, 51, 7] borrow the Seq2Seq framework from Natural Language Processing [12] to action detection. Seq2Seq methods are composed of a visual encoder to encode the primary spatiotemporal features, an efficient temporal filter to model the temporal information and a classifier to perform the frame-level action detection. This framework "interprets" the im + +age sequence into a sequence of prediction scores. Frame-level action detection can be seen as a class-specific actionness detector. By referring to actionness-based methods [67, 60, 35], the action proposals can be generated from the frame-level detection results. Seq2Seq based approaches perform well on both types of dataset, especially for the densely annotated one [42, 10]. To build a generic distillation framework that can tackle both dataset types, we thus rely on the Seq2Seq paradigm. Furthermore to incorporate the appearance and motion based information, the state-of-the-art sequence based approaches make use of two-stream architectures [41, 42]. + +In order to avoid the expensive computation of two-stream architectures, cross-modal distillation methods [6, 18] and fast Optical Flow (OF) detectors [27, 52, 53, 66] have been introduced for video classification tasks. However, the fast OF detector techniques are modality-specific with relatively low performance [6]. Therefore, we propose to dig deeper into cross-modal distillation mechanisms for learning compact action representations for long continuous videos. + +# 2.2. Cross-Modal Knowledge Distillation + +The primary goal of Knowledge Distillation (KD) is to distill the information of a model learned from a teacher network into a student network. Many KD studies [23, 4, 40, 56, 37] explored transferring the knowledge from large complex models to small simpler models, i.e. model compression. In this work, we focus on cross-modal KD, where the difference between the teacher and student models mostly relies on input modalities rather than network architectures. In the video domain, Garcia et al. [18] developed a distillation framework for action classification with a four-step process that hallucinates depth features into RGB frames. Similarly, MARS [6] trains a RGB network in a single step, by back-propagating a linear combination of a OF distillation and classification losses through the entire network. Recently, Luo et al. [38] proposed a Graph Distillation (GD) method that can be applied to the action detection task. This method utilizes sliding windows to process untrimmed videos and distillates the knowledge of every window by minimizing the cosine distance in a mutual learning manner. GD aims at exploiting the privileged modalities and thus relies on a significant number of modalities. In contrast, our framework aims at effectively performing the distillation from the available modalities. Moreover, GD transfers knowledge only between the corresponding snippets (i.e. window), but does not consider the relations across snippets in the distillation, which is critical for handling a sequence of actions. Thus, to better tackle distillation for action detection, we propose a new formulation with three loss-terms. More specifically for transferring knowledge along the temporal dimension in the untrimmed video, we introduce a sequence-level distillation + +![](images/04f14b76502a47c83bcb890de47e9f98cbd937bb116d865aae7181c6f673fd66.jpg) +Figure 2. The proposed distillation framework. On the top, we present an example of a batch size $(\mathcal{B})$ of 2 untrimmed videos $(\mathcal{V})$ for both student $(\mathcal{S})$ and teacher $(\mathcal{T})$ networks. In this example, the input includes a pair of positive videos and a pair of negative videos. The sequence-level distillation and classification losses are employed only for positive pairs, while atomic-level distillation leverages both positive and negative pairs. On the bottom, we present the atomic-level distillation. + +mechanism. Thanks to it, the network can be effective even with few additional modalities. + +# 3. Proposed Distillation Framework + +In this section, we first describe the overall architecture of our approach. We then detail the different losses in the proposed framework. + +# 3.1. Overall Architecture + +An overview of the architecture is shown in Fig. 2. In this work, the knowledge transfer occurs between the teacher and student networks. As discussed in Sec. 2.1, both networks are composed of a visual encoder and a temporal filter, following the Seq2Seq paradigm. For the visual encoder, we use I3D [2] to encode the spatio-temporal information of a snippet for RGB and Optical Flow (OF). Similar to previous action detection methods [14, 65], sequences of 16 frames are encoded to a single feature vector representation. The encoded feature maps of a video are then fed to the temporal filter. The choice of the temporal filter is flexible, since we can choose any well-known temporal model [42, 31, 24]. Here, we set a 5-layer SS-TCN [14] as default temporal filter, which is based on Dilated-TCN [31]. Both student and teacher have the same type of temporal filter with the same settings (i.e. dilation rate and channel size). In the training phase, the knowledge distillation is performed from the output feature of the teacher network towards the student network. Similar to [42, 10], this output + +feature map is further classified and grouped as a class-wise actionness detector for detecting the actions. + +The input of teacher network is flexible to variant costly modalities (e.g. OF, 3D poses). By default, we chose the teacher network as OF stream, whereas the student network as RGB stream. In the following sections, we express the feature representation of a video indexed $i$ with $F_{r}(i,t,c)$ , where $r \in \{\mathcal{T},\mathcal{S}\}$ represents the teacher $\mathcal{T}$ and student $\mathcal{S}$ ; $t \in [1,T]$ represents the snippet index and $T$ the length of the video in snippets; $c \in \mathbb{Z}^C$ represents the channel index, $C$ is the channel size. This expression can be used for representing feature of a video or a snippet. For example, $F_{r}(i,:,:)$ and $F_{r}(i,t,:)$ represent the feature map of a video $i$ and the feature vector of a snippet for video $i$ at time step $t$ , respectively. For an augmented RGB representation, the distillation is performed in two levels. First, we perform distillation at atomic-level to distillate the elementary representation of an action. Second, we perform a sequence-level distillation to distillate (i) the salient relations among the snippets, and (ii) the significant temporal variations across the snippets indicating action boundaries. + +# 3.2. Atomic-level Distillation + +To transfer the knowledge between two video sequence, firstly, we adapt and integrate the "representation loss" [38] in our overall formulation, dubbed Atomic KD loss. This loss term encourages the student to mimic the feature representation of every individual snippet feature of the teacher network. Our formulation is different from the previous work [38] that minimizes the cosine distance between the snippet features. Inspired by the recent success on contrastive learning [55, 22, 39], we build our model using a contrastive strategy to enhance the atomic-level knowledge imitation. + +As shown in Fig. 2, let $[F_S(i,t,:), F_{\mathcal{T}}(i,t,:)]$ represents a pair of training snippets from same video $i$ at time $t$ but across different modalities for the teacher and student networks. Let $F_{\mathcal{T}}(j,t,:)$ be another snippet representation from a randomly chosen video $j$ of the teacher stream and having a different label. We define the pair $[F_S(i,t,:), F_{\mathcal{T}}(j,t,:)]$ as positive when $i = j$ , otherwise negative. We aim at pushing closer the representations $F_S(i,t,:)$ and $F_{\mathcal{T}}(i,t,:)$ while pushing apart $F_S(i,t,:)$ and $F_{\mathcal{T}}(j,t,:)$ which can be seen as a binary classification task that tries to maximize the log-likelihood of the mutual information between the student and teacher representations. In practice, the loss is updated by batches with a batch size $\mathcal{B}$ . If $\mathcal{N}$ negative pairs exist for each positive pair, then the number of samples in a batch of $\mathcal{P}$ positives is given by $\mathcal{B} = (\mathcal{N} + 1)\mathcal{P}$ (see Fig. 2). To measure the mutual information between + +the student and the teacher, we compute: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {A t o m i c}} = \frac {1}{\mathcal {P} T} \sum_ {i = j} \sum_ {t = 1} ^ {T} \log \left[ \frac {\exp^ {F _ {\mathcal {T}} (j , t ; :) ^ {\top} F _ {\mathcal {S}} (i , t ; :)}}{\exp^ {F _ {\mathcal {T}} (j , t ; :) ^ {\top} F _ {\mathcal {S}} (i , t ; :)} + \phi} \right] + \tag {1} \\ \frac {1}{T} \sum_ {i \neq j} \sum_ {t = 1} ^ {T} [ \log (1 - \frac {\exp^ {F _ {\mathcal {T}} (j , t ; :)} {} ^ {\top} F _ {\mathcal {S}} (i , t ; :)}{\exp^ {F _ {\mathcal {T}} (j , t ; :)} {} ^ {\top} F _ {\mathcal {S}} (i , t ; :)} + \phi) ] \\ \end{array} +$$ + +where $\mathcal{PT}$ represents total number of positive snippets, $\phi$ is the ratio of the negative snippets to the cardinality of snippets in the training set. Note that, this loss term is accompanied by a linear combination with the other distillation losses and the class-wise entropy loss (i.e. supervised learning). + +As the length of an action instance is often larger than a snippet, with atomic-level distillation, the teacher network transfers only the sub-representation of the actions [19]. Next, we propose a novel sequence-level distillation mechanism which has been neglected in the state-of-the-art methods. + +# 3.3. Sequence-level Distillation + +Sequence-level distillation transfers cross-snippet knowledge between different modalities in an untrimmed video by incorporating contextual information and taking benefit from the variations of cross-modal representation along action boundaries. Consequently, we propose two sequence-level distillation losses: (1) Global Contextual Relation, (2) Boundary Saliency, to improve action detection performance. Note that both sequence-level distillation losses are applied only between positive video pairs, corresponding to $\mathcal{P}$ videos. + +# 3.3.1 Global Contextual Relation + +For sequence-level distillation, firstly, we propose to transfer contextual knowledge between modalities of the entire video. Intuitively, the detection of one given action could be supported by the detection of other related actions, which may be distant in the untrimmed video [41]. Hence, the representation of an action snippet could benefit from the contextual information across other snippets in the video pertaining to another modality. But the challenge in modeling such contextual relationships is the high complexity of the model for taking into account all the snippets in a video in relation with a single snippet. Therefore, we propose an embedding that projects the student-teacher features in a space where the global contextual relations among all actions are computed. + +For the global contextual relation loss, we compute the Channel Covariance Matrix $(Cov)$ of the sequence of snippets. Our motivation for using channel covariance is: (1) At each time instant, the channel contains the latent representation of actions, thus channel covariance embeds the relation between action events in a video; (2) Though the videos + +and action events have a high variation in length, the channel size is fixed. This results in channel covariance being a more robust representation. + +Providing a feature map of the video, $Cov$ encodes the variance within each channel and the covariance between all channels over the whole video. Each element in the matrix reflects the correlation between two channels, which can characterize the specific activation patterns along time of an action class. Thus, the covariance matrix captures the relations between snippets along time and indicates whether a salient relation exists (i.e. which may be related to an action), while being computationally optimal. Here, the $Cov$ is formulated as: + +$$ +C o v _ {r} (i) = \frac {1}{T - 1} \sum_ {t = 1} ^ {T} \left[ F _ {r} (i, t,:) - \mu_ {i} \right] \left[ F _ {r} (i, t,:) - \mu_ {i} \right] ^ {T} \tag {2} +$$ + +such that $r \in \{\mathcal{T},\mathcal{S}\}$ , and $\mu_{i}$ represents the mean value of all the channels in the feature map $F_{r}(i,:,:))$ of a video $i$ . The covariance matrix $Cov_{r} \in \mathbb{R}^{C \times C}$ is a symmetric matrix and thus it is determined by $\frac{C(C + 1)}{2}$ values. We apply a filter mask extracting all the entries on and above the diagonal of the covariance matrix. We reshape these values in the form of a vector $G_{r}(i)$ : + +$$ +G _ {r} (i) = \operatorname {m a s k} \left[ \operatorname {C o v} _ {r} (i) \right] \tag {3} +$$ + +where $\text{mask}(.)$ is the filter mask operation. The obtained feature vector $G_{r}(i)$ represents the channel covariance of the video. We then enforce a distillation loss in the embedded space from the frozen teacher to the student over the positive video pairs $(\mathcal{P})$ . This is performed by minimizing the mean square error, which is formulated as the Global Contextual Relation loss: + +$$ +\mathcal {L} _ {\text {G l o b a l}} = \frac {1}{\mathcal {P}} \sum_ {i = 1} ^ {\mathcal {P}} \left| \left| G _ {\mathcal {T}} (i) - G _ {\mathcal {S}} (i) \right| \right| ^ {2} \tag {4} +$$ + +The differential property of equation 2 enables to train our teacher-student framework jointly with the other losses. + +# 3.3.2 Boundary Saliency + +The boundary saliency loss term is used in our formulation to learn comparatively precise boundaries for action detection. In an untrimmed video, we find that the starting and ending of the action are more salient than other parts [34], that brings us crucial information to detect the transition of an action to another action or background. Intuitively, the sharp variation across consecutive snippets in the video can reflect such saliency of the action boundaries, which is a cross-snippet knowledge. Transferring the knowledge of feature evolution along time encourages the features to be more sensitive at the action start and end, thus assisting the class-wise actionness detector in the student network to detect precise boundaries of the action instances. Such an approach is especially effective when the modality processed at the teacher network provides pertinent boundary + +information. For instance, modalities which are sensitive to motion (e.g. OF, 3D poses) are able to bring a significant benefit from this loss term. In addition, this loss-term also encourages to retain the temporal consistency across the different modalities. + +In practice, we first define the variation between consecutive snippets as $Var(i)$ for video $i$ , which is formulated as: + +$$ +\operatorname {V a r} _ {r} (i) = \frac {1}{T - 1} \sum_ {t = 1} ^ {T - 1} \sum_ {c = 1} ^ {C} \left[ F _ {r} (i, t + 1, c) - F _ {r} (i, t, c) \right] \tag {5} +$$ + +where $r \in \{\mathcal{T},\mathcal{S}\}$ . Then, we define the Boundary Saliency loss as the $L1$ distance between the frozen teacher and the student network over the $\mathcal{P}$ positive pairs, which is formulated as: + +$$ +\mathcal {L} _ {\text {B o u n d a r y}} = \frac {1}{\mathcal {P}} \sum_ {i = 1} ^ {\mathcal {P}} | V a r _ {\mathcal {T}} (i) - V a r _ {\mathcal {S}} (i) | \tag {6} +$$ + +With both sequence-level distillation losses, the student network learns two types of cross-snippet information from the other modalities. Below, we summarize the training procedure section. + +# 3.4. Training and Testing + +To sum up, firstly, we train the teacher networks with the classification $(Cls)$ loss, i.e. cross-entropy. The weights of the teacher network is then frozen followed by training the student network. During training, multiple distillation losses are jointly optimized with classification loss for the end task, i.e. action detection. On one hand, the atomic distillation is trained in a contrastive manner (with positive and negative pairs), whereas the sequence-level distillation losses are performed in a non-contrastive manner by utilizing only the positive pairs in a batch. The overall objective is formulated as: + +$$ +\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\text {C l s}} + \alpha_ {1} \mathcal {L} _ {\text {A t o m i c}} + \alpha_ {2} \mathcal {L} _ {\text {G l o b a l}} + \alpha_ {3} \mathcal {L} _ {\text {B o u n d a r y}} \tag {7} +$$ + +where $\alpha_{i}$ are the loss weighting factors determined during the validation step. $\mathcal{L}_{Cls}$ represents the cross-entropy classification loss. We call the educated-student network as Augmented-RGB. During inference time, we only use RGB videos as input to detect the actions and up-sample the predicted logits to the same temporal resolution as the ground truth to perform the evaluation. + +# 4. Experimental Analysis + +To corroborate the effectiveness of our proposed KD framework, we perform an exhaustive experimental analysis for the action detection task. + +# 4.1. Dataset Description + +We evaluate our framework on five action detection datasets: Charades [47], PKU-MMD [36], TSU [8], THUMOS14 [26], and MultiTHUMOS [63]. These datasets contain videos of different types: (1) sport and daily living + +Table 1. Ablation study for the proposed framework on Charades and PKU-MMD (CS) datasets. For PKU-MMD we consider IoU=0.1. + +
\( {\mathcal{L}}_{\text{Atomic }}{\mathcal{L}}_{\text{Global }}{\mathcal{L}}_{\text{Boundary }} \)CharadesPKU-MMD
Teacher-OF---18.668.4
Vanilla-RGB---22.379.6
Two-stream---24.883.4
Atomic✓--23.982.7
Sequence-✓-23.883.7
--✓23.483.1
-✓✓24.284.2
Mixture✓✓-24.484.3
✓-✓24.283.7
Total✓✓✓24.685.5
+ +videos, (2) short and long videos, (3) densely and sparsely labeled videos. Note: there are two settings on Charades: (1) video-level action classification, (2) frame-level action detection (Charades_v1_localize [47]). We only target the second one in this paper. + +All the datasets are evaluated by the mean Average Precision (mAP). We evaluate the per-frame mAP on densely labeled datasets following [63, 47]. + +# 4.2. Implementation Details + +For extracting the additional modalities, Optical Flow (OF) is obtained using TVL1 [54], the 3D Poses are extracted using LCRNet++ [44]. In this work, we adapt the 5-layer SSTCN [14] as the temporal filter, the output channel size $C$ is 256. While training the teacher-student framework, we use Adam optimizer [29] with an initial learning rate of 0.001, and we scale it by a factor of 0.3 with a patience of 10 epochs. The network is trained for 300 epochs with a mini-batch $\mathcal{B}$ of 16 videos for Charades, 8 videos for PKU-MMD, THUMOS, and 4 videos for the TSU dataset. $\mathcal{N}$ is set to 1, $\mathcal{P}$ as $\frac{\mathcal{B}}{2}$ and $\alpha_{i} = [300, 100, 5]$ . We use binary cross-entropy for multi-label classification (i.e. class-wise actionness). For sparsely-labeled datasets: THUMOS14 and PKU-MMD, following [38, 10], a post-processing step is performed to generate the action boundaries. + +# 4.3. Ablation Study + +Firstly, we discuss about the effectiveness of the losses proposed in our distillation framework. Tab. 1 shows the comparison of action detection performance on Charades and PKU-MMD (IoU=0.1). This table also shows the impact of progressively integrating the KD losses in our distillation framework. The vanilla-RGB is the network trained using only $\mathcal{L}_{Cls}$ without distillation. Compared to vanilla RGB, while training with $\mathcal{L}_{Atomic}$ , $\mathcal{L}_{Global}$ , $\mathcal{L}_{Boundary}$ independently obtains an improvement of +3.1, 4.1, 3.5% mAP on PKU-MMD respectively. The action detection performance is further improved by the convex combination of any two losses w.r.t. their individual counter-parts. This shows the complementary functionalities of the proposed losses. Also, note that the combination of the sequence losses contributes higher than the atomic loss. This observation supports the importance of the sequence-level losses + +for action detection. Finally, when trained with all the three losses, the student outperforms all the baselines $(+2.3\%, +5.9\%)$ w.r.t. vanilla RGB stream on Charades and PKU-MMD). These results show that both our design choices and different losses contribute to the overall performance of our approach. + +In Tab. 2, we show that our distillation mechanisms perform better at feature-level than at logit-level. The primary reason behind this trend is that we are performing cross-modal distillation, where the frozen teacher may underperform compared to the student network (e.g. OF on Charades and PKU-MMD) w.r.t. the different modalities. As the logits represent the classification scores, they may introduce noise from the weak teacher via KD into the RGB student. + +# 4.4. Analysis of our Distillation Framework + +In this section, we further analyze our distillation framework in different aspects. + +Comparison with popular cross-modal KD methods: Tab. 3 presents a comparison of our extended atomic distillation with state-of-the-art cross-modal KD methods, learning from OF. These baseline methods [25, 6, 18, 58] using traditional losses like MSE and cosine distance are actually designed for classification tasks. For the comparative analysis with our $\mathcal{L}_{\text{Atomic}}$ , we adapt them following [38] for the task of action detection. $\mathcal{L}_{\text{Atomic}}$ consistently outperforms all the baseline methods on Charades and PKU-MMD datasets ( $+1.6\%$ , $+3.1\%$ w.r.t. vanilla RGB stream on Charades and PKU-MMD). + +Performance with different Temporal filters: In Tab. 4, our distillation framework is implemented with different temporal filters to confirm its robustness. The experiments are performed with a student network learning from a teacher network pre-trained with OF on Charades dataset. The results show that both SSTCN [14] and TGM [42] consistently improve the performance of RGB stream and achieve the competitive performance of two-stream network. + +Analyzing our framework with different modalities: In Tab. 5, we validate that our proposed method is generic and can be effective with different modalities. For experimentation, we perform distillation from OF and 3D Poses. For 3D poses, the teacher consists of 2s-AGCN [46] as visual encoder followed by the temporal filters for detecting actions. In datasets like Charades, most actions involve human-object interactions with prominent motion patterns and in datasets like PKU-MMD, most actions have similar appearance with variant motion over time. Thus, OF stream provides more salient information than Pose stream on these datasets. Whereas 3D Poses are robust to the change of the view-points and thus, significantly improves the action detection performance in cross-view settings (see Tab. 5). Furthermore, with a multi-teacher network with OF and + +Table 2. Feature-level and logit-level distillation. The student learns from OF stream. For PKU-MMD, we set IoU=0.1. + +
CharadesPKU-MMD
Logit23.784.9
Logit+Feature24.285.4
Feature (Ours)24.685.5
+ +Table 3. Comparison with cross-modal KD methods and $\mathcal{L}_{\text{Atomic}}$ on Charades and PKU-MMD datasets. For PKU-MMD, IoU=0.1. + +
CharadesPKU-MMD
Vanilla-RGB22.379.6
+LHall [18]22.781.5
+LMARS [6]23.581.7
+LGD [38]23.382.2
+LAtomic(Ours)23.982.7
+ +Table 4. Ablation for different temporal filters: SS-TCN and TGM on the Charades. The models learn from the OF. + +
SSTCNTGM
Vanilla-RGB22.318.9
Two Stream24.821.5
Augmented-RGB24.621.2
+ +Table 5. Ablation for different modalities on Charades, PKU-MMD (CS), TSU-CS and TSU-CV. For TSU, the reported values are frame-based mAP (\%). The IoU threshold for PKU-MMD is 0.1. + +
CharadesPKU-MMDTSU-CSTSU-CV
Teacher-OF18.668.429.417.5
Teacher-Pose9.865.026.222.4
Vanilla-RGB22.379.629.218.9
Two-stream RGB + Pose23.082.932.623.7
Two-stream RGB + OF24.883.433.519.5
Pose Augmented RGB23.284.732.423.6
OF Augmented RGB24.685.532.819.3
Pose + OF Augmented RGB24.986.333.723.8
+ +Poses, the RGB stream now dubbed as Pose + OF Augmented RGB learns some additional information (+2.6%, +6.7%, +4.5%, +4.9% w.r.t. vanilla RGB stream on Charades, PKU-MMD, TSU-CS, TSU-CV respectively). + +Inference time & Complexity: Fig. 3 shows the precision vs inference time per video on Charades dataset. The inference time includes the time of extracting the additional modalities and the processing time of the visual encoder and temporal filter. We find that Two stream RGB + TVL1 [64] achieves high precision on Charades, but at the expense of a high computational cost. In this work, we use TVL1 to obtain the OF modality. Although there are methods [27, 52] that generate OF at higher speed, these methods perform significantly worse than TVL1 [6]. Similarly, the computation of accurate 3D Positions is not real-time, and hence doubles the video processing time [44]. With these modalities in training phase, our proposed framework avoids estimating these modalities at test time while keeping the performance of two-stream network. The processing speed at the inference phase (I3D+SSTCN) is about 140 fps using 4 GPUs, thus can be seen as a real-time processing. Concerning complexity, as we have the same type of temporal filter and encoder for teacher and student, the Augmented-RGB stream retains the same number of parameters as the vanilla RGB stream at inference time, whereas two stream network doubles the number of parameters often causing over-fitting [59]. + +# 4.5. Qualitative Analysis + +With Global Contextual Relation loss, the student learns the relationships among the action instances of the teacher network along with retaining the student's individual representation. As shown in Fig. 4, with only $\mathcal{L}_{Global}$ , the channel covariance representation of Augmented-RGB is closer to the one of RGB+OF. Hence, the Augmented-RGB achieves performance close to the one of the two-stream + +network. + +We also compare the performance of RGB stream with Boundary Saliency distillation and vanilla RGB stream. In Fig. 5, we find that the network with $\mathcal{L}_{\text{Boundary}}$ detects tighter temporal boundaries of the actions compared to the vanilla network. To further show how two sequence-level distillation losses are complementary, we compare APs for a student that is trained with only $\mathcal{L}_{\text{Global}}$ or $\mathcal{L}_{\text{Boundary}}$ on Charades in Fig. 6. We find that $\mathcal{L}_{\text{Boundary}}$ improves more the actions with high variation across time (e.g. Throw pillow), $\mathcal{L}_{\text{Global}}$ improves more the actions with relatively longer duration (e.g. Holding mirror). While learning from $\mathcal{L}_{\text{Global}} + \mathcal{L}_{\text{Boundary}}$ , the student improves all action types, reflecting how these two loss-terms complement each other. + +Fig. 7 shows the class-wise actionness result of the vanilla-RGB and Augmented-RGB in a densely labeled video along with the action detection results. We notice that the Augmented-RGB detects tight action boundary w.r.t. the vanilla-RGB, e.g. use cupboard, walk. Thanks to our distillation methods, the Augmented-RGB now predicts the use drawer action which is miss detected in vanilla-RGB. + +# 4.6. Comparison with the State-of-the-Art + +In Tab. 6, we compare other action detection methods with our Augmented-RGB on PKU-MMD. Recall that our distillation mechanisms are built on SSTCN. While one method [32] using Poses achieves very high performance, this method is skeleton-based and applicable only for specific datasets (i.e. NTU-RGBD [45], PKU-MMD [36]), where high quality 3D Poses are available. In contrast, our method is generic and does not rely on Poses at inference time while being more effective compared to other RGB based SoA methods, such as Graph Distillation [38] $(+2.6\%, +2.4\%, +4.6\%)$ for 0.1, 0.3, 0.5 IoU), which utilizes the same temporal filter but more modalities (e.g. depth) at + +![](images/884020a75f0d82178cd429d60c41576b9e4ababeb7c568fb8c955f629405bddb.jpg) +Figure 3. Precision vs Inference time per video on Charades. + +Table 6. Event-based mAP on PKU-MMD (CS) dataset. Only the last five rows utilize RGB at inference time. Note that Graph distillation (GD) learns from more than 4 modalities while our method learns from OF and Pose. + +
MethodmAP@tIoU (θ)
0.10.30.5
Test modalityJCRRNN [33]45.2-32.5
Convolution Skeleton [36]49.331.812.1
Skeleton boxes [1]61.3-54.8
Wang and Wang [57]84.2--
Li et al. [32]92.2-90.4
RGBDeep RGB [36]50.732.314.7
Qin and Shelton [43]65.051.029.4
GRU+GD [38]82.481.374.3
SSTCN+GD83.782.176.5
Augmented-RGB86.384.581.1
+ +Table 7. Comparison with State-of-the-Art action detection methods. Our method learns only from OF. The cells in white are the two stream results (RGB+OF), while the cell in orange represents using only RGB at Inference time. We report frame-based mAP and event-based mAP for the dense and sparse labeled datasets respectively. The IoU is 0.5 for THUMOS14. + +
TypeModelDenseSparse
CharadesTSU-CSMultiTHUMOSTHUMOS14
AnchorR-C3D [61]12.78.7—28.9
TAL [3]———42.8
G-TAD [62]———40.2
AFNet [5]13.1——49.5
Seq2SeqTAN [10]17.6—33.346.8
WSGM [15]18.7——32.8
TGM [42]21.526.744.353.5
Vanila-RGB [14]22.329.237.846.1
Two-stream24.433.544.453.7
Augmented-RGB24.632.844.653.3
+ +![](images/4784b83c5a83261a63d1ef82baea0aa91f99dc81ea1af3c6fd2b4f71730ff7c4.jpg) +(1) RGB + +![](images/df97655e886bc96604b5a70b2040bd5a0b357bcd1a1b2898da9db47e4a2273c3.jpg) +(2) Flow + +![](images/2ee6613d2341232e400f351b6fa824d923c34931b034ddbdc3b946a2c30e9925.jpg) +(3) $\mathrm{RGB} + \mathrm{Flow}$ +Figure 4. Channel Covariance. We visualize the Covariance matrix of a video for the vanilla RGB, vanilla OF, the two-stream RGB+OF, and the Augmented-RGB $(\mathcal{L}_{Global})$ . For better visualization, we normalize the matrix to [0,1] and set a threshold of 0.5. + +![](images/4d013f507502768960307c38e39ecb4164a2d14b5a1eead0c1be4e59c8b6865c.jpg) +(4) Augmented RGB + +![](images/5729621435005b3797cdb9c503e4c2f1b33994b87114a71ed822cdb5b1b5246e.jpg) +Figure 5. Action boundary detection: (1) Ground truth indicates if it is action or background at this frame. (2) The boundaries detected without $\mathcal{L}_{\text{Boundary}}$ , (3) The boundaries detected with $\mathcal{L}_{\text{Boundary}}$ . + +training time compared to our method. + +To show the generalization of our method, we also evaluate our distillation framework on Charades and TSU-CS, MultiTHUMOS and THUMOS in Table 7. For all these comparisons, the student network is distilled with teacher pre-trained with OF in the training phase, as Poses are not always available. For a fair comparison with our Augmented-RGB, Vanilla-RGB and Two-stream networks are implemented using SSTCN. In this table, we find that, anchor-based methods (e.g. AFNet) perform decently on sparsely-labeled datasets, while failing on densely labeled datasets due to the combinatorial explosion of proposals. On the other hand, Seq2Seq architectures are stable on both types of dataset. With the help of our proposed distillation method, the Augmented-RGB achieves the competitive Two-stream performance on all the datasets (+2.3, 3.6, 6.8, 7.2 w.r.t. vanilla-RGB on Charades, TSU, MultiTHUMOS, THUMOS14 respectively). We observe that the performance improvement on THUMOS which consists of sport videos, is significant due to strong motion patterns resulting to an effective OF based teacher network. Thus, Augmented-RGB while using only RGB at inference, performs on par with Two-stream network for the task of action detection. + +![](images/ebd6727495c623b1aafc540fc44838232db81f421095103071d3fea0e42ddd6e.jpg) +Figure 6. Difference of Average Precision for two sequence-level distillation losses on Charades dataset. G: $\mathcal{L}_{Global}$ , B: $\mathcal{L}_{Boundary}$ . + +![](images/e7a0c719c90595f1d34acf0a5755284fd939ad7822c32a1a237d77645af1fc23.jpg) +Figure 7. Class-wise actionness with the detection results. + +# 5. Conclusion + +In this work, we have introduced a novel distillation framework for action detection. This generic framework combines three novel learnable losses to better benefit from the cross-modal information in untrimmed videos. To the best of our knowledge, we are the first to propose a formulation with sequence-level distillation in this task. Thanks to this framework, we can improve the performance of vanilla RGB networks and make it possible to detect actions in real-time with high precision, even in case of densely labeled datasets. Experiments on five datasets show that the proposed method can effectively infuse different modalities into RGB. For instance, the Augmented-RGB network achieves the Two-stream network performance while using only RGB at inference time. + +Acknowledgements. This work has been supported by the French government, through the 3IA Côte d'Azur Investments in the Future project managed by the National Research Agency (ANR) with the reference number ANR-19-P3IA-0002. The authors are also grateful to the OPAL infrastructure from Université Côte d'Azur for providing resources and support. + +# References + +[1] Bo Li, Huahui Chen, Yucheng Chen, Yuchao Dai, and Mingyi He. Skeleton boxes: Solving skeleton based action detection with a single deep convolutional neural network. In 2017 IEEE International Conference on Multimedia Expo Workshops (ICMEW), pages 613-616, 2017. 8 +[2] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4724-4733. IEEE, 2017. 3 +[3] Yu-Wei Chao, Sudheendra Vijayanarasimhan, Bryan Seybold, David A Ross, Jia Deng, and Rahul Sukthankar. Rethinking the faster r-cnn architecture for temporal action localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1130–1139, 2018. 2, 8 +[4] Guobin Chen, Wongun Choi, Xiang Yu, Tony Han, and Manmohan Chandraker. Learning efficient object detection models with knowledge distillation. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 742-751, 2017. 3 +[5] Guang Chen, Can Zhang, and Yuexian Zou. Afnet: Temporal locality-aware network with dual structure for accurate and fast action detection. IEEE Transactions on Multimedia, 2020. 2, 8 +[6] Nieves Crasto, Philippe Weinzaepfel, Karteek Alahari, and Cordelia Schmid. MARS: Motion-Augmented RGB Stream for Action Recognition. In CVPR, 2019. 1, 3, 6, 7 +[7] Rui Dai, Srijan Das, Luca Minciullo, Lorenzo Garattoni, Gianpiero Francesca, and Francois Bremond. Pdan: Pyramid dilated attention network for action detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 2970-2979, January 2021. 2 +[8] Rui Dai, Srijan Das, Saurav Sharma, Luca Minciullo, Lorenzo Garattoni, Francois Bremond, and Gianpiero Francesca. Toyota smarthome untrimmed: Realworld untrimmed videos for activity detection. arXiv preprint arXiv:2010.14982, 2020. 2, 5 +[9] Rui Dai, Luca Minciullo, Lorenzo Garattoni, Gianpiero Francesca, and François Bremond. Self-attention temporal convolutional network for long-term daily living activity detection. In 2019 16th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS), pages 1-7. IEEE, 2019. 2 +[10] Xiyang Dai, Bharat Singh, Joe Yue-Hei Ng, and Larry Davis. Tan: Temporal aggregation network for dense + +multi-label action recognition. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 151-160. IEEE, 2019. 2, 3, 6, 8 +[11] Srijan Das, Saurav Sharma, Rui Dai, Francois Bremond, and Monique Thonnat. Vpn: Learning videopose embedding for activities of daily living, 2020. 1 +[12] Srijan Das, Monique Thonnat, and Francois Bremond. Looking deeper into time for activities of daily living recognition. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 498-507, 2020. 2 +[13] Bernard Ghanem Fabian Caba Heilbron, Victor Escorcia and Juan Carlos Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 961-970, 2015. 2 +[14] Yazan Abu Farha and Jurgen Gall. Ms-tcn: Multi-stage temporal convolutional network for action segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3575-3584, 2019. 3, 6, 8 +[15] Basura Fernando, Cheston Tan, and Hakan Bilen. Weakly supervised gaussian networks for action detection. In The IEEE Winter Conference on Applications of Computer Vision (WACV), March 2020. 8 +[16] Jiyang Gao, Zhenheng Yang, Kan Chen, Chen Sun, and Ram Nevatia. Turn tap: Temporal unit regression network for temporal action proposals. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017. 2 +[17] Nuno Cruz Garcia, Sarah Adel Bargal, Vitaly Ablavsky, Pietro Morerio, Vittorio Murino, and Stan Sclaroff. Distillation multiple choice learning for multimodal action recognition. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 2755-2764, January 2021. 1 +[18] Nuno C. Garcia, Pietro Morerio, and Vittorio Murino. Modality distillation with multiple stream networks for action recognition. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision – ECCV 2018, pages 106–121, Cham, 2018. Springer International Publishing. 1, 3, 6, 7 +[19] Chunhui Gu, Chen Sun, David A. Ross, Carl Vondrick, Caroline Pantofaru, Yeqing Li, Sudheendra Vijayanarasimhan, George Toderici, Susanna Ricco, Rahul Sukthankar, Cordelia Schmid, and Jitendra Malik. Ava: A video dataset of spatio-temporally localized atomic visual actions. Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2, 4 + +[20] Saurabh Gupta, Judy Hoffman, and Jitendra Malik. Cross modal distillation for supervision transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 1 +[21] Frank Hafner, Amran Bhuiyan, Julian FP Kooij, and Eric Granger. A cross-modal distillation network for person re-identification in rgb-depth. arXiv preprint arXiv:1810.11641, 2018. 1 +[22] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. 4 +[23] Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. 3 +[24] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735-1780, Nov. 1997. 3 +[25] Judy Hoffman, Saurabh Gupta, and Trevor Darrell. Learning with side information through modality hallucination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 826-834, 2016. 6 +[26] Yu-Gang. Jiang, Jingen Liu, Amir Roshan Zamir, George Toderici, Ivan Laptev, Mubarak Shah, and Rahul Sukthankar. THUMOS challenge: Action recognition with a large number of classes. http://crcv.ucf.edu/THUMOS14/, 2014. 2, 5 +[27] Vadim Kantorov and Ivan Laptev. Efficient feature extraction, encoding and classification for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2593-2600, 2014. 3, 7 +[28] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. 1 +[29] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. 6 +[30] Hildegard Kuehne, Hueihan Jhuang, Estíbaliz Garrote, Tomaso Poggio, and Thomas Serre. Hmdb: a large video database for human motion recognition. In 2011 International Conference on Computer Vision, pages 2556-2563. IEEE, 2011. 1 +[31] Colin Lea, Michael D Flynn, Rene Vidal, Austin Reiter, and Gregory D Hager. Temporal convolutional networks for action segmentation and detection. In + +proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 156-165, 2017. 2,3 +[32] Chao Li, Qiaoyong Zhong, Di Xie, and Shiliang Pu. Skeleton-based action recognition with convolutional neural networks. In 2017 IEEE International Conference on Multimedia & Expo Workshops (ICMEW), pages 597-600. IEEE, 2017. 7, 8 +[33] Yanghao Li, Cuiling Lan, Junliang Xing, Wenjun Zeng, Chunfeng Yuan, and Jiaying Liu. Online human action detection using joint classification-regression recurrent neural networks. In European Conference on Computer Vision, pages 203-220. Springer, 2016. 8 +[34] Chuming Lin, Chengming Xu, Donghao Luo, Yabiao Wang, Ying Tai, Chengjie Wang, Jilin Li, Feiyue Huang, and Yanwei Fu. Learning salient boundary feature for anchor-free temporal action localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3320-3329, 2021. 5 +[35] Tianwei Lin, Xu Zhao, Haisheng Su, Chongjing Wang, and Ming Yang. Bsn: Boundary sensitive network for temporal action proposal generation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 3-19, 2018. 3 +[36] Chunhui Liu, Yueyu Hu, Yanghao Li, Sijie Song, and Jiaying Liu. Pku-mmd: A large scale benchmark for skeleton-based human action understanding. In Proceedings of the Workshop on Visual Analysis in Smart and Connected Communities, VSCC '17, pages 1-8, New York, NY, USA, 2017. ACM. 2, 5, 7, 8 +[37] Yifan Liu, Ke Chen, Chris Liu, Zengchang Qin, Zhenbo Luo, and Jingdong Wang. Structured knowledge distillation for semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2604-2613, 2019. 3 +[38] Zelun Luo, Jun-Ting Hsieh, Lu Jiang, Juan Carlos Niebles, and Li Fei-Fei. Graph distillation for action detection with privileged modalities. In The European Conference on Computer Vision (ECCV), September 2018. 2, 3, 4, 6, 7, 8 +[39] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. Adv. Neural Inform. Process. Syst., 2018. 4 +[40] Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3967-3976, 2019. 3 +[41] AJ Piergiovanni and Michael S Ryoo. Learning latent super-events to detect multiple activities in videos. In + +Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5304-5313, 2018. 1, 3, 4 +[42] AJ Piergiovanni and Michael S Ryoo. Temporal gaussian mixture layer for videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2, 3, 6, 8 +[43] Zhen Qin and Christian R Shelton. Event detection in continuous video: An inference in point process approach. IEEE Transactions on Image Processing, 26(12):5680-5691, 2017. 8 +[44] Grégory Rogez, Philippe Weinzaepfel, and Cordelia Schmid. LCR-Net++: Multi-person 2D and 3D Pose Detection in Natural Images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 6, 7 +[45] Amir Shahroudy, Jun Liu, Tian-Tsong Ng, and Gang Wang. Nturgb+d: A large scale dataset for 3d human activity analysis. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 7 +[46] Lei Shi, Yifan Zhang, Jian Cheng, and Hanqing Lu. Two-stream adaptive graph convolutional networks for skeleton-based action recognition. In CVPR, 2019. 6 +[47] Gunnar A Sigurdsson, Santosh Divvala, Ali Farhadi, and Abhinav Gupta. Asynchronous temporal fields for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 585-594, 2017. 1, 5, 6 +[48] Gunnar A. Sigurdsson, Gül Varol, Xiaolong Wang, Ali Farhadi, Ivan Laptev, and Abhinav Gupta. Hollywood in homes: Crowdsourcing data collection for activity understanding. In European Conference on Computer Vision(ECCV), 2016. 2 +[49] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In Advances in neural information processing systems, pages 568-576, 2014. 1 +[50] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. CoRR, abs/1212.0402, 2012. 1 +[51] Rui Su, Wanli Ouyang, Luping Zhou, and Dong Xu. Improving action localization by progressive cross-stream cooperation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12016-12025, 2019. 2 +[52] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8934-8943, 2018. 3, 7 + +[53] Shuyang Sun, Zhanghui Kuang, Lu Sheng, Wanli Ouyang, and Wei Zhang. Optical flow guided feature: A fast and robust motion representation for video action recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 3 +[54] Javier Sánchez Pérez, Enric Meinhardt-Llopis, and Gabriele Facciolo. TV-L1 Optical Flow Estimation. Image Processing On Line, 3:137-150, 2013. 6 +[55] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In International Conference on Learning Representations, 2020. 4 +[56] Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pages 1365-1374, 2019. 3 +[57] Jiang Wang, Zicheng Liu, Ying Wu, and Junsong Yuan. Mining actionlet ensemble for action recognition with depth cameras. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 1290-1297. IEEE, 2012. 8 +[58] Liwei Wang, Yin Li, and Svetlana Lazebnik. Learning deep structure-preserving image-text embeddings. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5005-5013, 2016. 6 +[59] Weiyao Wang, Du Tran, and Matt Feiszli. What makes training multi-modal networks hard? CoRR, abs/1905.12681, 2019. 7 +[60] Yuanjun Xiong, Yue Zhao, Limin Wang, Dahua Lin, and Xiaou Tang. A pursuit of temporal accuracy in general activity detection. arXiv preprint arXiv:1703.02716, 2017. 3 +[61] Huijuan Xu, Abir Das, and Kate Saenko. R-c3d: Region convolutional 3d network for temporal activity detection. In Proceedings of the IEEE international conference on computer vision, pages 5783-5792, 2017. 2, 8 +[62] Mengmeng Xu, Chen Zhao, David S Rojas, Ali Thabet, and Bernard Ghanem. G-tad: Sub-graph localization for temporal action detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10156-10165, 2020. 1, 2, 8 +[63] Serena Yeung, Olga Russakovsky, Ning Jin, Mykhaylo Andriluka, Greg Mori, and Li Fei-Fei. Every moment counts: Dense detailed labeling of actions in complex videos. International Journal of Computer Vision, 126(2-4):375-389, 2018. 1, 2, 5, 6 +[64] Christopher Zach, Thomas Pock, and Horst Bischof. A duality based approach for realtime tv-1 optical + +flow. In Joint pattern recognition symposium, pages 214-223. Springer, 2007. 7 +[65] Songyang Zhang, Houwen Peng, Jianlong Fu, and Jiebo Luo. Learning 2d temporal adjacent networks formoment localization with natural language. In AAAI, 2020. 3 +[66] Jiaojiao Zhao and Cees G. M. Snoek. Dance with flow: Two-in-one stream action detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 3 +[67] Yue Zhao, Yuanjun Xiong, Limin Wang, Zhirong Wu, Xiaou Tang, and Dahua Lin. Temporal action detection with structured segment networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2914-2923, 2017. 2, 3 +[68] Mohammadreza Zolfaghari, Gabriel L Oliveira, Nima Sedaghat, and Thomas Brox. Chained multi-stream networks exploiting pose, motion, and appearance for action classification and detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 2904-2913, 2017. 1 \ No newline at end of file diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/images.zip b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0a9655e2461c1f6b14f83ec81ad196b727addb82 --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc02b96a00b96ee18f05e7c57ef06c20866c7dbfcf0f5972111336dd81d1445b +size 448185 diff --git a/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/layout.json b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..79fcaff19ec175e0a952291e95da18e8f613b162 --- /dev/null +++ b/learninganaugmentedrgbrepresentationwithcrossmodalknowledgedistillationforactiondetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9e912587b601001111b6c2812f6e7b5ea7cf4dfc8d455c589165dc560836cfd +size 431281 diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_content_list.json b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..20c48afdf475c6dba777685a398ade4cbf47aab7 --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f51d36ced6f379d1ebf19c6eaabf659c2cce9341e634f73cd40b0843ef47670b +size 83643 diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_model.json b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8bbf40ca9b8c37e64b42c5d95b331a0996c03af1 --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebb46db14bb3b5e1c5d3e6795a9452ba4b4a25fd1e75910e62908d2a5325e174 +size 98534 diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_origin.pdf b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e98ae4da9f12ff85810ccb26293f400b57ba73e0 --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/f4bd1550-5a07-4721-8c85-c5aa92729034_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04450bbcf6898b45992ba2c4e4fb6f7a3affe9a3add185db374073eb6295768d +size 4910002 diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/full.md b/learningasinglenetworkforscalearbitrarysuperresolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..da77c9a0cb790ff3e3e8258cf2a26b813865781c --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/full.md @@ -0,0 +1,307 @@ +# Learning A Single Network for Scale-Arbitrary Super-Resolution + +Longguang Wang, Yingqian Wang, Zaiping Lin, Jungang Yang, Wei An, Yulan Guo* National University of Defense Technology + +{wanglongguang15,yulan.quo}@nudt.edu.cn + +# Abstract + +Recently, the performance of single image superresolution (SR) has been significantly improved with powerful networks. However, these networks are developed for image SR with specific integer scale factors (e.g., $\times 2/3/4$ ), and cannot handle non-integer and asymmetric SR. In this paper, we propose to learn a scale-arbitrary image SR network from scale-specific networks. Specifically, we develop a plug-in module for existing SR networks to perform scale-arbitrary SR, which consists of multiple scale-aware feature adaption blocks and a scale-aware upsampling layer. Moreover, conditional convolution is used in our plug-in module to generate dynamic scale-aware filters, which enables our network to adapt to arbitrary scale factors. Our plug-in module can be easily adapted to existing networks to realize scale-arbitrary SR with a single model. These networks plugged with our module can produce promising results for non-integer and asymmetric SR while maintaining state-of-the-art performance for SR with integer scale factors. Besides, the additional computational and memory cost of our module is very small. + +# 1. Introduction + +Single image super-resolution (SR) aims at recovering a high-resolution (HR) image from its low-resolution (LR) counterpart. As a long-standing low-level computer vision problem, single image SR has been investigated for decades [1, 2, 3, 4, 5, 6]. Recently, the rise of deep learning provides a powerful tool to solve this problem, with numerous CNN-based methods [7, 8, 9, 10, 11] being developed to improve the SR performance. + +Although recent CNN-based single image SR networks [6, 10, 12, 13] have achieved promising performance, they are developed for image SR with specific integer scale factors (e.g., $\times 2/3/4$ ). In many real-world applications like image retargeting, image editing and artworks, non-integer SR (e.g., from $100 \times 100$ to $220 \times 220$ ) and asymmetric SR (e.g., from $100 \times 100$ to $220 \times 420$ ) are highly demanded. However, due to the fixed filters in upscale modules, most + +![](images/b9cfc27538a872c54530d65ccf1fb17896812ae7a90f589a4171640d1e807f11.jpg) +Figure 1. Visual comparison achieved by Bicubic, Meta-RCAN [14] and our ArbRCAN. “(+Bicubic)” means that the network output is further resized to the expected resolution using bicubic interpolation for asymmetric scale factors. + +existing networks can only zoom in an image with specific integer scales and cannot handle scale-arbitrary SR in real-world scenarios. + +To address this limitation, Hu et al. [14] proposed a Meta-SR network to dynamically predict filters in the upscale module for different scale factors using meta-learning. As a result, Meta-SR achieves promising performance on non-integer scale factors. However, scale information is only used for upsampling in Meta-SR. That is, features in the backbone are the same for all SR tasks with different scale factors, which hinders the further improvement of performance. Moreover, Meta-SR focuses on SR with non-integer scale factors but cannot handle SR with asymmetric scale factors. + +In this paper, we propose to learn a scale-arbitrary single image SR network from scale-specific networks. Specifically, we develop a plug-in module for existing SR networks to enable scale-arbitrary SR, which consists of multiple scale-aware feature adaption blocks and a scale-aware upsampling layer. The scale-aware feature adaption blocks are used to adapt features in the backbone to specific scale factors and the scale-aware upsampling layer is used for scale-arbitrary upsampling. Within our plug-in module, conditional convolutions are used to generate dynamic scale-aware filters to handle different scale factors. Our plug-in module can be easily adapted to existing networks for scale- + +arbitrary SR with small additional computational and memory cost. Baseline networks equipped with our module can produce promising results for non-integer and asymmetric SR (Fig. 1), while maintaining state-of-the-art performance on integer scale factors with a single model. To the best of our knowledge, our plug-in module is the first work to handle asymmetric SR. + +Our main contributions can be summarized as follows: 1) We develop a plug-in module for existing SR networks to achieve scale-arbitrary SR, including multiple scale-aware feature adaption blocks and a scale-aware upsampling layer. 2) Our plug-in module uses conditional convolution to dynamically generate filters based on the input scale information, which facilitates our network to adapt to specific scale factors. 3) Experimental results show that baseline networks equipped with our module produce promising results for scale-arbitrary SR with only a single model. A video demo is provided in the supplemental material. + +# 2. Related Work + +In this section, we first briefly review several major works for CNN-based single image SR. Then, we discuss conditional convolutions that are related to our work. + +Single Image Super-Resolution. Due to the powerful feature representation and model fitting capabilities of deep neural network, CNN-based single image SR methods [7, 8, 9, 6, 10] outperform traditional methods [1, 2, 15, 3, 4, 5] significantly. Dong et al. [7] proposed a three-layer convolutional network (namely, SRCNN) to learn the non-linear mapping between LR images and HR images. A deeper network (namely, VDSR) with 20 layers [8] was then developed to achieve better performance. Later, Lim et al. [16] proposed a very deep and wide network, namely EDSR. Specifically, batch normalization (BN) layers were removed and a residual scaling technique was used to enable the training of such a large model. Recently, Zhang et al. [12] and Dai et al. [13] further improved the SR performance by introducing channel attention and second-order channel attention, respectively. + +Although existing single image SR networks have achieved promising results, they are trained for SR with a single specific integer scale factor. To overcome this limitation, Lim et al. [16] proposed a multi-scale deep super-resolution (MDSR) system to integrate modules trained for multiple integer scale factors (i.e., $\times 2/3/4$ ). However, MDSR cannot super-resolve images with non-integer scale factors. Recently, Hu et al. [14] proposed a Meta-SR network to solve the scale-arbitrary upsampling problem. Specifically, they used meta-learning to predict weights of filters for different scale factors. Nevertheless, Meta-SR does not exploit the benefits of scale information during feature learning in the backbone. To make better use of scale information, Fu et al. [17] introduced a residual scale attenuate + +![](images/984aed06acb278160d373b9ff6ec4524717f1717b9af61571fb563f0afa7fddd.jpg) + +![](images/1a7ba5c419b8b0ae03e220944f9b8a71f765beb54790e32096fcb32cc7da3c36.jpg) + +![](images/e15128b915c97d409c42052fe5e89facb4e7db8576590619494dff1921979422.jpg) + +![](images/b7feb0a25f087272d28441cac51b0d433dee7488ad87a9950474217f9b3037ba.jpg) + +![](images/3c4687ccb67d02dd46fdb4e6d60ba2c24d72483a44e370e2c194f75e5a24f436.jpg) + +![](images/a485510c75cfbc31efe2a836a205a9dc9b844608e6b2198346c02e6e13301369.jpg) +LR Image + +![](images/9ba0b239870872c8eb62ebc81272013b9f20acafae3cd85724d2251508e9354e.jpg) +Block 1 + +![](images/2d5f5741efda9851e9d364186b8b4787e77eee750cf7cb3f53f3dd93f252f786.jpg) +Block 8 + +![](images/2351cd8479513bc27426dde567f1865e566e24efa48b5ca93ec74922f35e5862.jpg) +Block 16 +Figure 2. Visualization of feature similarity maps. + +tion network (RSAN), where the scale information is used as a prior knowledge to learn discriminative features for superior performance. + +Despite Meta-SR and RSAN are able to super-resolve images with non-integer scale factors, they cannot handle asymmetric SR. In many real-world applications like image retargeting, image editing and artworks, asymmetric SR is also highly demanded. However, it is still underinvestigated in literature. In this paper, we develop a plugin module for existing SR networks to enable SR with both non-integer and asymmetric scale factors. + +Conditional Convolutions. Different from traditional convolutional layers with static filters, conditional convolutions [18, 19, 20, 21] parameterize their filters conditioned on the input as linear combinations of several experts. Consequently, the capacity of the network can be efficiently improved without a significant increase in computational cost. In this paper, we extend the idea of conditional convolutions to generate dynamic scale-aware filters to handle the scale-arbitrary SR task. It is demonstrated that conditional convolutions facilitate our network to adapt to arbitrary scale factors to achieve better SR performance. + +# 3. Methodology + +# 3.1. Motivation + +Since SR tasks with different scale factors are interrelated [16], it is non-trivial to learn a scale-arbitrary SR network from scale-specific networks (e.g., $\times 2/3/4$ ). Early attempts [8, 22, 23] use shared features in the backbone to handle multiple scale factors without considering the scale information during feature learning. Intuitively, since the degradation is different for various scale factors, scale information can further be used to learn discriminative features to improve SR performance [17]. In this section, we investigate the relationship between $\times 2/3/4$ SR tasks to provide insights for scale-arbitrary SR. + +We conduct experiments to compare the feature similarity on specific layers in pre-trained $\times 2 / 3 / 4$ SR networks. In our experiments, EDSR [16] is selected as the baseline network. First, we downsample an image to $\frac{1}{4}$ size (denoted as $I\in \mathbb{R}^{H\times W}$ ). Then, we feed $I$ to EDSR networks devel + +![](images/4cc371e9decdb1387106ebfc64437930bac483d17b1ac299007a10d6de15093f.jpg) +Figure 3. An overview of our plug-in module. The details of our scale-aware convolutional layer and scale-aware upsampling layer are further illustrated in Figs. 4 and 5, respectively. + +oped for $\times 2/3/4$ SR. Following [24], features from the last layer in the $i^{\mathrm{th}}$ residual block are whitened to remove global component for more precise calculation of pairwise similarity, resulting in $F_{i}^{\times 2}, F_{i}^{\times 3}, F_{i}^{\times 4} \in \mathbb{R}^{256 \times H \times W}$ . Next, for each location $p$ , we extract a triplet of feature samples at $p$ to obtain $f_{i}^{\times 2}, f_{i}^{\times 3}, f_{i}^{\times 4} \in \mathbb{R}^{256}$ and compute the feature similarity among them: + +$$ +S _ {i} (p) = \frac {1}{3} \left(\frac {\left(f _ {i} ^ {\times 2}\right) ^ {T} f _ {i} ^ {\times 3}}{\| f _ {i} ^ {\times 2} \| \| f _ {i} ^ {\times 3} \|} + \frac {\left(f _ {i} ^ {\times 2}\right) ^ {T} f _ {i} ^ {\times 4}}{\| f _ {i} ^ {\times 2} \| \| f _ {i} ^ {\times 4} \|} + \frac {\left(f _ {i} ^ {\times 3}\right) ^ {T} f _ {i} ^ {\times 4}}{\| f _ {i} ^ {\times 3} \| \| f _ {i} ^ {\times 4} \|}\right). \tag {1} +$$ + +The feature similarity map $S_{i}$ is visualized in Fig. 2. For more results, please refer to the supplemental material. + +From Fig. 2, we can see that feature similarity varies for different blocks and regions. That is, the sensitivity of features to the change of scale factors is different for various blocks and regions. Consequently, we are motivated to perform pixel-wise feature adaption accordingly. For features within regions of high feature similarities, they can be directly used for SR with arbitrary scale factors. In contrast, features within regions of low feature similarities are adapted to specific scale factors. More analyses are included in the supplemental material. + +# 3.2. Our Plug-in Module + +The architecture of our plug-in module is shown in Fig. 3. Given a baseline network (e.g., EDSR) developed for SR with integer scale factors, we can extend it to a scale-arbitrary SR network using our plug-in module. Specifically, scale-aware feature adaption is performed after every $K$ backbone blocks, as shown in Fig. 3(b). Following the backbone module, a scale-aware upsampling layer is used for scale-arbitrary upsampling. + +Scale-Aware Feature Adaption. Given a feature map $F$ , + +![](images/ccfbab69956ddb7ff86d92573823db795dc1736416d66ad6d7a9f7e21530dc9b.jpg) +Figure 4. An illustration of our scale-aware convolutional layer. + +it is first fed to an hourglass module with four convolutions and a sigmoid layer to generate a guidance map $M$ with values ranging from 0 to 1, as shown in Fig. 3(b). Then, $F$ is fed to a scale-aware convolution for feature adaption, resulting in an adapted feature map $F^{adapt}$ . Next, the guidance map $M$ is used to fuse $F$ and $F^{adapt}$ as: + +$$ +F ^ {\text {f u s e}} = F + F ^ {\text {a d a p t}} \times M. \tag {2} +$$ + +Intuitively, in regions with high feature similarities across different scale factors, $F$ can be directly used as $F^{fuse}$ . In contrast, in regions with low feature similarities, $F^{adapt}$ is added into $F^{fuse}$ for feature adaption. That is, $M$ serves as a gating mechanism and learns to guide pixel-wise feature adaption. It is demonstrated in Sec. 4.3 that our network benefits from the guidance maps to produce better results for scale-arbitrary SR. + +The scale-aware convolutional layer within our feature adaption blocks is further illustrated in Fig. 4. First, the horizontal and vertical scale factors $r_h$ and $r_v$ are fed to a model controller with two fully connected (FC) layers to generate routing weights. Then, these routing weights are used to combine the experts, resulting in a scale-aware filter. Here, experts represent a set of convolutional kernels to be + +![](images/78c04d01cfb9a55d0d98ffb0e97902965bc6794054c6b67b88e00ba70a4eeff0.jpg) +(a) computation of $L(x), L(y), R(x), R(y)$ + +![](images/211d8f01056fb43553124db46f3ac392ef7b6f0953f19c04bf775796c1f4023f.jpg) +(b) filter/offset prediction + +![](images/bdbe45a8517a06df08972cabe882906718fe409e43ca0c00edf116e6e96a5cb6.jpg) +(c) spatially-varying filtering +Figure 5. An illustration of our scale-aware upsampling layer. + +combined based on the scale information. Finally, the predicted filter is used to process the input feature maps for feature adaption. Different from vanilla convolution with fixed filter, our scale-aware convolution dynamically customizes its filter conditioned on the scale information by combining knowledge from experts. It is demonstrated in Sec. 4.3 that scale-aware convolutions facilitate our network to adapt to specific scale factors to achieve better performance. + +Scale-Aware Upsampling. Pixel shuffling layer [25] is widely used in SR networks for upsampling with integer scale factors. For $\times r (r = 2,3,4)$ SR, input features of size $C_{in} \times H \times W$ are first fed to a convolution to produce features of size $r^2 C_{out} \times H \times W$ . Then, the resulting features are shuffled to the size of $C_{out} \times rH \times rW$ . The pixel shuffling layer can be considered as a two-step pipeline, which consists of a sampling step and a spatially-varying filtering step (i.e., $r^2$ convolutions for $r^2$ different sub-positions). Please refer to the supplemental material for more details. + +In this paper, we generalize the pixel shuffling layer to a scale-aware upsampling layer, as shown in Fig. 5. First, each pixel $(x,y)$ in the HR space is projected to the LR space to compute its coordinates $(L(x)$ and $L(y))$ and relative distances $(R(x)$ and $R(y))$ : + +$$ +L (x) = \frac {x + 0 . 5}{r _ {h}} - 0. 5, \tag {3} +$$ + +$$ +R (x) = L (x) - \operatorname {f l o o r} \left(\frac {x + 0 . 5}{r _ {h}}\right), \tag {4} +$$ + +where $L(y)$ and $R(y)$ are calculated similar to $L(x)$ and $R(x)$ . Next, $R(x), R(y), r_h$ and $r_v$ are concatenated and fed to two FC layers for feature extraction, as shown in Fig. 5(b). The resulting features are then passed to filter and offset heads to predict routing weights and offsets ( $\delta_x$ and $\delta_y$ ), respectively. After that, the routing weights are used to combine two groups of experts, resulting in a pair of filters for the bottleneck/expansion layers in Fig. 5(c). Finally, a $k \times k$ neighborhood centered at $(L(x) + \delta_x, L(y) + \delta_y)$ is sampled using bilinear interpolation and convolved with the predicted filters to produce the output features at $(x, y)$ , as shown in Fig. 5(c). + +In the implementation, a pair of convolutional kernels $(\mathbb{R}^{C\times \frac{C}{8}\times k\times k}$ and $\mathbb{R}^{\frac{C}{8}\times C\times k\times k})$ need to be generated and stored for each location in HR space. Since the memory consumption can be very high for $k = 3$ ( $\sim 31.6\mathrm{G}$ for a 720P HR image), $k$ is set to 1 in our networks for memory efficiency ( $\sim 3.5\mathrm{G}$ ). + +# 4. Experiments + +# 4.1. Datasets and Metrics + +We used the DIV2K dataset [26] for network training and five benchmark datasets for evaluation, including Set5 [27], Set14 [28], B100 [29], Urban100 [30], and Manga109 [31]. Peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) were used as evaluation metrics. Similar to [14], we cropped borders for fair comparison. Note that, all metrics were computed in the luminance channel. + +# 4.2. Implementation Details + +Following [14], symmetric scale factors varying from 1 to 4 with a stride of 0.1 (i.e., 1.1, 1.2, ..., 3.9, 4.0) were used to generate LR training images. Moreover, asymmetric scale factors with a stride of 0.5 along horizontal and vertical axes (i.e., $\frac{1.5}{2.0}, \frac{1.5}{2.5}, \dots, \frac{4.0}{3.0}, \frac{4.0}{3.5}$ ) were also included for LR image generation. During training, a pair of horizontal/vertical scale factors was randomly selected from the above ranges for each batch and then 16 LR patches with the size of $50 \times 50$ were randomly cropped. Meanwhile, their corresponding HR patches were also cropped. Data augmentation was performed through random rotation and random flipping. + +In our experiments, EDSR [16], RDN [10] and RCAN [12] were used as baseline networks to produce three scale-arbitrary networks, i.e., ArbEDSR, ArbRDN and ArbRCAN. We use 4 experts in the scale-aware convolutions and set $K = 4/2/1$ for ArbEDSR/ArbRDN/ArbRCAN to control the model size. Since the available pre-trained RDN models are implemented in Torch while our networks are implemented in PyTorch [32], we re-trained RDN as our baseline network. Pre-trained $\times 4$ SR models of EDSR/RDN/RCAN were used to initialize the backbone + +Table 1. PSNR results achieved by our network with different settings on Set5. + +
ModelScale-Aware Feature AdaptionScale-Aware Upsampling×1.7×2×2.95×3×3.1×1.3 ×3.9×1.9 ×3.5×2 ×3.3×3.3 ×1.9×4 ×1.8
Scale-Aware ConvGuidance Map
EDSR (+Bicubic)*XXX39.7238.1934.6434.6834.2534.1034.7034.9235.6834.61
1XXbicubic39.5637.8633.7733.7833.4733.1233.9034.2134.9033.42
2XX✓39.7638.1334.7034.6834.4034.3234.9135.0235.8534.67
3✓X✓39.8138.1534.7034.7034.4234.3834.9835.1035.9134.72
4✓✓✓39.8738.1934.7534.7334.4834.4435.0335.1635.9534.81
+ +* To perform SR with non-integer and asymmetric scale factors (e.g., $\times 1.7 / \frac{\times 1.3}{\times 3.9}$ SR) using baseline network, we first super-resolve the LR image for $\times 2 / \times 4$ SR and then downscale the result to the expected resolution using bicubic interpolation following [14]. + +blocks in ArbEDSR/ArbRDN/ArbRCAN, respectively. We used the Adam method [33] with $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ for optimization. An $L_{1}$ loss between SR results and HR images was used as the loss function. Following [10], 1000 iterations of back-propagation constitute an epoch. The initial learning rate was set to $1\times 10^{-4}$ and reduced to half after every 30 epochs. To maintain training stability, we first trained our networks on integer scale factors $(r = 2,3,4)$ for 1 epoch and then trained the networks on all scale factors. The training was stopped after 150 epochs. + +# 4.3. Ablation Study + +Ablation experiments were conducted on Set5 to test the effectiveness of our design choices. We used EDSR as the baseline network and introduced 4 variants. All variants were re-trained for 150 epochs. + +Scale-Aware Upsampling. To enable scale-arbitrary SR, a naive approach is to replace the pixel shuffling layer with an interpolation layer (e.g., bicubic interpolation). To demonstrate the effectiveness of our scale-aware upsampling layer, we introduced two variants. For variant 1, we replaced the pixel shuffling layer in the baseline network with a bicubic upsampling layer. For variant 2, we replaced the pixel shuffling layer with the proposed scale-aware upsampling layer. It can be observed from Table 1 that the PSNR values are relatively low when bicubic upsampling is used. With our scale-aware upsampling layer, the performance is significantly improved (e.g., 39.76/38.13 vs. 39.56/37.86 for $\times 1.7 / 2$ SR). That is because, our scale-aware upsampling layer can learn dynamic filters conditioned on the scale factors while bicubic upsampling uses a fixed filter. + +Scale-Aware Feature Adaption. Scale-aware feature adaption is used to adapt features to specific scale factors for better performance. Note that, our scale-aware feature adaption block consists of two key components: scale-aware convolution and guidance map generation. To demonstrate their effectiveness, we first added scale-aware convolutions to variant 2 to produce variant 3. Then, variant 4 is further obtained by adding guidance map generation to variant 3. It can be observed from Table 1 that the performance benefits from both scale-aware convolution and guidance map, with PSNR values being improved from $39.76 / 38.13 / 34.91$ to $39.87 / 38.19 / 35.03$ for $\times 1.7 / 2 / \frac{1.9}{3.5}$ SR. Without feature adaption, model 2 uses + +![](images/3e93e7fe6f758db20c7561d5de9724d3d3b75703382084ed099ee53f0fb1329c.jpg) +Figure 6. Visualization of guidance maps and their corresponding feature similarity maps. + +Table 2. PSNR results achieved by our network with different number of experts on Set5. The running time is averaged over B100 on $\times 4$ SR. + +
#ExpertsParams.Time×1.7×2×2.55×3.8×1.3/×3.9×2/×3.5×3.3/×1.8×4/×1.2
138.4M0.09s39.3737.8735.8232.1333.3434.3735.5033.93
238.6M0.10s39.8838.2036.0232.9934.2334.9236.0334.87
439.2M0.10s39.8738.1936.0233.0034.4434.9636.0735.18
840.4M0.11s39.8838.2236.0332.9834.4634.9836.0735.20
+ +shared features in the backbone for SR with different scale factors. This variant suffers inferior performance since the difference among features learned for various scale factors is not considered. With our scale-aware feature adaption blocks, our network can adapt features in the backbone according to the scale information. Therefore, better performance can be achieved. + +We further visualize the guidance maps learned by variant 4 in Fig. 6. It can be observed that the learned maps are consistent with the feature similarity maps (also shown in Fig. 2). Specifically, regions with high values in guidance maps are consistent with those of low feature similarities. This demonstrates that our guidance maps can effectively guide the fusion of $F$ and $F^{adapt}$ (Eq. 2) to perform pixelwise feature adaption accordingly. + +Number of Experts in Scale-Aware Convolution. Scale-aware convolution dynamically generates scale-aware filters by combining knowledge from experts. To analyze the effect of the number of experts, we compare the performance of our network with different numbers of experts in Table 2. With only one expert, our scale-aware convolutions are degraded to vanilla ones with static filters and cannot well handle different scale factors. Therefore, variant 1 suffers a performance drop from 39.88/38.22/36.03 to 39.37/37.87/35.82 for $\times 1.7 / 2 / 2.55$ SR. As more experts are included in scale-aware convolutions, our network pro + +![](images/23f7548682a62486ab72f0f7d5599ea203ec3845de219b5de84a2c8206184a9e.jpg) +Figure 8. Visual comparison for SR with non-integer scale factors. + +![](images/eb3c4827417c106f285c9808ad5829f7afc87e9149ffa5ca74127190ddc5afb6.jpg) +Figure 7. Visualization of routing weights in the scale-aware convolution of the first scale-aware feature adaption block. (a) and (b) show the routing weights for symmetric and asymmetric scale factors, respectively. + +duces comparable results on symmetric scale factors while achieving better performance on asymmetric scale factors. This means that SR with asymmetric scale factors benefits a lot from the increase of experts. Further, we can see that the performance improvement on highly asymmetric scale factors are more significant (e.g., 34.46(↑0.23)/34.98(↑0.06) vs. 34.23/34.92 for $\frac{\times 1.3}{\times 3.9} / \frac{\times 2}{\times 3.5}$ SR). Since more experts than 4 cannot introduce notable performance improvements, we use 4 experts as our default setting to achieve a better trade-off between performance and model size. + +We further visualize the routing weights in our scale-aware convolution to investigate the knowledge of different experts with respect to various scale factors. As shown in Fig. 7(a), expert 2 is dominant for small scale factors while expert 1 is gradually activated for large ones. Compared to symmetric scale factors, more experts are activated for asymmetric ones. For example, experts 1, 3 and 4 are assigned with higher weights for $\frac{\times 4}{\times 1.1}$ than $\frac{\times 1.1}{\times 1.1}$ . This observation is consistent with the results in Table 2 that SR with + +asymmetric scale factors benefits a lot from more experts. + +# 4.4. Results for SR with Symmetric Scale Factors + +In this section, we compare our ArbEDSR, ArbRDN and ArbRCAN to EDSR [16], RDN [10], RCAN [12], Meta-RDN [14] and Meta-RCAN [14] on the SR task with symmetric scale factors (both integer and non-integer scale factors)1. Since pre-trained models for Meta-RCAN are unavailable, we used officially released codes for re-training. Note that, we also fine-tuned Meta-RDN and Meta-RCAN on our training set for fair comparison. Comparative results are shown in Table 3 and Fig. 8. + +Quantitative Results. It can be observed from Table 3 that our ArbEDSR, ArbRDN and ArbRCAN achieve comparable performance to their corresponding baseline networks on integer scale factors. For SR with non-integer scale factors, our networks significantly outperform their baseline networks. For example, our ArbEDSR is on par with EDSR for $\times 2$ SR on Set5 (38.19 vs. 38.19) while producing much better results for $\times 1.6 / 1.55$ SR (40.64/40.94 vs. 40.39/40.71). + +Compared to Meta-RDN and Meta-RCAN, our ArbRDN and ArbRCAN achieves comparable or better performance for most scale factors. For example, our ArbRCAN produces notable performance improvements for $\times 3.4 / 3.65$ SR on Manga109 (33.12/32.29 vs. 33.00/32.22). Moreover, our ArbRDN and ArbRCAN achieve much better efficiency than Meta-RDN and Meta-RCAN, respectively. Compared to RCAN, Meta-RCAN has a comparable model size with larger memory consumption and longer running time. In + +Table 3. PSNR results achieved on 5 benchmark datasets for symmetric scale factors. Note that, the memory consumption is calculated on an LR image with a size of $100 \times 100$ . The running time is averaged over B100 on $\times 2/3/4$ SR. “+ft” means that the networks are fine-tuned on our training set. + +
Params.Memory*Time*Set5Set14B100Urban100Manga109
×2×1.6×1.55×2×1.5×1.65×2×1.4×1.85×2×1.9×1.95×2×1.7×1.95
Bicubic---33.6636.1036.2430.2432.8731.8329.5632.9530.1126.8827.2527.0530.8032.9131.12
EDSR-×2 [16](+Bicubic)39.7M0.9G0.05s38.1940.3940.7133.9537.1035.9532.3636.7933.0232.9533.0632.6939.1840.8839.13
ArbEDSR (Ours)39.2M1.0G0.23s38.1940.6440.9434.0537.5136.2232.3736.9233.2333.0233.6133.3039.2241.2039.24
RDN-×2 [10](+Bicubic)21.6M0.4G0.08s38.2440.5140.5334.0137.2436.1032.3436.8333.1532.8933.0532.7939.1841.0639.31
Meta-RDN [14]21.4M1.1G0.38s38.2340.6640.9434.0337.5236.2432.3536.9333.2133.0333.6033.2639.3141.3339.60
Meta-RDN [14]+ft21.4M1.1G0.38s38.2140.6540.9434.0537.5336.2632.3436.9133.2133.0133.6133.2739.3241.3539.61
ArbRDN (Ours)22.6M0.6G0.18s38.2340.6740.9534.0737.5336.2732.3736.9333.2133.0033.5133.1939.2841.3239.54
RCAN-×2 [12](+Bicubic)15.2M0.3G0.27s38.2740.5340.7734.1237.2336.0832.4036.8633.1633.1833.1732.8439.4241.1539.39
Meta-RCAN [14]15.5M0.9G0.40s38.2240.6640.9334.0037.5136.1732.3636.9533.2233.1233.6233.3039.3241.3039.59
Meta-RCAN [14]+ft15.5M0.9G0.40s38.2140.6340.9334.0337.5036.2032.3536.9533.2233.1033.6333.3239.3441.3139.61
ArbRCAN (Ours)16.6M0.5G0.29s38.2640.6940.9734.0937.5336.2832.3936.9333.2333.1433.5533.2539.3741.3239.56
×3×2.4×2.75×3×2.8×2.95×3×2.2×2.15×3×2.3×2.35×3×2.7×2.55
Bicubic---30.3932.4131.0627.5527.8427.4627.2128.8829.1224.4625.9125.7226.9527.7728.27
EDSR-×3 [16](+Bicubic)42.5M1.0G0.05s34.6836.4535.3530.5330.9030.4929.2731.3831.7828.8231.1330.9134.1935.1835.75
ArbEDSR (Ours)39.2M1.3G0.13s34.7336.5435.3430.6131.0430.5629.3031.4631.7028.9031.3631.1134.2835.4036.06
RDN-×3 [10](+Bicubic)21.7M0.4G0.08s34.7136.4635.2730.5730.8830.5329.2631.3031.6528.8031.2531.0734.1335.4136.00
Meta-RDN [14]21.4M1.9G0.32s34.7336.5535.3330.5830.9730.5729.3031.4131.6928.9331.3331.1334.4035.5836.21
Meta-RDN [14]+ft21.4M1.9G0.32s34.7036.5535.3530.5830.9730.5729.2831.4231.6728.8831.3331.1234.4235.5936.22
ArbRDN (Ours)22.6M0.8G0.13s30.7136.5535.3530.5930.9830.5829.3031.4531.6928.8631.3331.1434.4335.6036.20
RCAN-×3 [12](+Bicubic)15.3M0.3G0.27s34.7636.5135.3130.6230.9030.5329.3131.3131.6829.0131.3431.1534.4235.5036.06
Meta-RCAN [14]15.5M1.7G0.41s34.7636.5835.3630.5831.0030.5629.2931.4431.7028.9631.4331.2034.4035.5536.21
Meta-RCAN [14]+ft15.5M1.7G0.41s34.7236.5935.3830.5830.9930.5629.2831.4631.7028.9331.4431.2234.4435.6036.24
ArbRCAN (Ours)16.6M0.8G0.29s34.7636.5935.3930.6431.0130.5929.3231.4831.7228.9831.4831.2634.5535.6436.27
×4×3.1×3.25×4×3.2×3.95×4×3.2×3.55×4×3.7×3.85×4×3.4×3.65
Bicubic---28.4229.8929.2126.0026.9825.6825.9626.9126.3223.1423.3823.1424.8925.9725.41
EDSR-×4 [16](+Bicubic)42.1M1.2G0.05s32.4734.2533.3528.8129.9528.6327.7328.8428.2526.6527.0626.6931.0432.5131.79
ArbEDSR (Ours)39.2M1.7G0.10s32.5134.4833.9228.8330.0728.7227.7428.9128.3026.6227.1226.7331.2632.9032.14
RDN-×4 [10](+Bicubic)21.7M0.3G0.07s32.4734.3633.9128.8130.0128.6927.7228.8528.2526.6127.1726.8331.0032.7031.99
Meta-RDN [14]21.4M2.6G0.29s32.4934.4233.9328.8630.0628.7527.7528.9028.3126.7027.2426.9131.3433.0232.24
Meta-RDN [14]+ft21.4M2.6G0.29s32.4634.4133.9128.8630.0628.7427.7528.9028.3026.6827.2026.8731.3533.0232.24
ArbRDN (Ours)22.6M1.2G0.13s32.4234.4333.9228.8230.0828.7127.7328.9028.3026.6127.1526.8531.3532.9932.24
RCAN-×4 [12](+Bicubic)15.2M0.3G0.23s32.6334.3733.9228.8530.0028.7227.7528.8628.2726.7527.2026.8931.2032.7632.04
Meta-RCAN [14]15.5M3.1G0.39s32.5634.4633.9828.8530.0828.7327.7528.8628.3026.7127.2526.9331.3333.0032.22
Meta-RCAN [14]+ft15.5M3.1G0.39s32.5534.4433.9928.8530.0828.7327.7528.8828.3026.7127.2426.9331.3533.0232.23
ArbRCAN (Ours)16.6M1.1G0.29s32.5534.5034.0328.8730.0828.7427.7628.9328.3326.6827.2226.9031.3633.1232.29
+ +* Officially released codes for Meta-RDN and Meta-RCAN are used to test the memory consumption and running time. Since generating an input matrix for the weight prediction network (Line 224 of trainer.py in the Github repository of Meta-SR) and post-processing (Line 235 of trainer.py) are also necessary for a single inference of Meta-SR, these operations are included for a fair comparison of running time. + +contrast, our ArbRCAN takes shorter running time (0.29s vs. 0.39s) and much less memory consumption (1.1G vs. 3.1G). This clearly demonstrates the high efficiency of our plug-in module. + +Qualitative Results. Figure 8 compares the visual results achieved on two images of the Manga109 and Urban100 datasets. From the zoom-in regions, we can see that our ArbRCAN produces results with better perceptual quality and fewer artifacts. For the second test image, Meta-RDN and Meta-RCAN cannot faithfully recover the stripes and suffer distorted artifacts. In contrast, our ArbRCAN produces clearer and finer details. + +# 4.5. Results for SR with Asymmetric Scale Factors + +In this section, we test our ArbEDSR, ArbRDN and ArbRCAN on the SR task with asymmetric scale factors2. + +Comparative results are presented in Table 4, while visual comparison is provided in Fig. 9. + +Quantitative Results. It can be observed from Table 4 that baseline networks (e.g., RCAN) have limited performance on asymmetric scale factors since their filters are fixed. Meta-RCAN uses meta-learning to generate filters for different scale factors to produce better results, with PSNR values being improved from 37.48/33.31/33.82 to 37.74/33.61/34.23 on Manga109. Moreover, fine-tuning Meta-RCAN on our training set further introduces marginal improvements (37.80/33.67/34.28 vs. 37.74/33.61/34.23). However, the performance is still inferior to our ArbRCAN even after fine-tuning. Using scale-aware convolutions to dynamically customize filters conditioned on the scale information, our ArbRCAN can adapt to the input scale factor to achieve better performance (37.93/33.81/34.41 vs. 37.80/33.67/34.28). + +Table 4. PSNR results achieved for asymmetric scale factors. Note that, the memory consumption is calculated on an LR image with a size of $100 \times 100$ for $\frac{\times 2}{\times 4}$ SR. The running time is averaged over B100 on $\frac{\times 2}{\times 4}$ SR. + +
Params.MemoryTimeSet5Set14B100Urban100Manga109
×1.5 ×4×1.5 ×3.5×1.6 ×3.05×4 ×2×3.5 ×2×3.5 ×1.75×4 ×1.4×1.5 ×3×3.5 ×1.45×1.6 ×3×1.6 ×3.8×3.5 ×1.55×2 ×2×2.8 ×3.5 ×3.7×3.8 ×3.5 ×2.7
Bicubic---30.0130.8331.4027.2527.8827.2727.4528.8627.9425.9324.9225.1929.6126.4726.86
EDSR [16]+Bicubic42.1M0.7G0.04s33.9534.8935.5930.2930.9131.3629.3331.2429.9630.6128.7729.2337.0832.9933.46
ArbEDSR (Ours)39.2M0.9G0.14s34.3235.3336.0230.5131.1531.4629.5231.3830.2031.0629.3229.9837.7033.5434.16
RDN [10]+Bicubic21.7M0.4G0.08s34.1235.0435.6330.3231.0231.1629.3431.2929.9830.6828.7529.3037.4333.2733.77
Meta-RDN [14]+Bicubic21.4M3.1G0.49s34.1935.1735.7930.3931.0631.3629.4331.2830.0930.7729.0429.6337.7433.6134.22
Meta-RDN [14]+Bicubic+ft21.4M3.1G0.49s34.2235.1935.8030.4231.0631.3529.4731.3030.1230.8529.1129.7037.8033.6434.26
ArbRDN (Ours)22.6M0.7G0.13s34.3135.2635.9830.4731.1231.4229.5231.3631.1931.0229.2329.9137.8833.7434.36
RCAN [12]+Bicubic15.2M0.4G0.27s34.1435.0535.6730.3531.0231.2129.3531.3029.9830.7228.8129.3437.4833.3133.82
Meta-RCAN [14]+Bicubic15.5M2.8G0.61s34.2035.1735.8130.4031.0531.3329.4331.2630.0930.7329.0329.6737.7433.6134.23
Meta-RCAN [14]+Bicubic+ft15.5M2.8G0.61s34.2635.2435.8630.4631.1031.4029.4731.3030.1430.8629.1429.7537.8033.6734.28
ArbRCAN (Ours)16.6M0.7G0.29s34.3735.4036.0530.5531.2731.5429.5431.4030.2231.1329.3630.0437.9333.8134.41
+ +![](images/49e9ec552fd730ad0814ac1121f355eaa09b0879c1d11ede4f79357cb1e334c9.jpg) + +![](images/a00289a52d945b93826b0e837968896f5ef626fa300e986a46c16997535f5318.jpg) + +![](images/5e217d9fc087b8031f9ef04b434cce9becd0439fe236a33010fa06d94a503d63.jpg) + +![](images/5603455c47b475959918814c9aad641e6df1afcdfd14a7c7bbae82c80e02178c.jpg) + +![](images/21d34c829e10634a25e63f27872b6ade538182ae35b812e023b67fa7928fc849.jpg) + +![](images/21c96927a4b996368f2752073fe9f483e250e2beb5129389c1a2ac4eebc1d88a.jpg) + +![](images/7e0b1e01ec5daad70f12025f04fe108f7ba55bad9fb175fd4bc8dfee57b36b54.jpg) + +![](images/b717ed0349e4ff9eb8705c71d559de9bb76a7cdd3a5b6d8aeecd7562e9f399a9.jpg) +LR Image + +![](images/16b60c865df6974934f8bc09a8bc9b4b0017a53419e6562f80960d89cf80290b.jpg) +Bicubic + +![](images/8db17192ffdb122d086ddbe7f9c78424e6ee558c8a950b48d02c7e7ede45e3b7.jpg) +Meta-RDN+Bicubc + +![](images/fe50dd8e86c4cfc77b551806a927852789474725a5fb0cfbbe2b7d0995265dfe.jpg) +ArbRDN +Meta-RCAN+Bicubic + +![](images/39b4c28d2752e25e8802be296c936bf1df20440d4f3d819cf6a975ea56c6c939.jpg) + +![](images/0538f6d2c799130aed00ba6c0d3ed483b6f2880d1e1990e61bdfa212e8e74611.jpg) +ArbRCAN + +![](images/3808859c9421f638b7dea38ff338079dbe3f1cb1257cceab1fe699d8781b020e.jpg) +GT + +In addition to higher PSNR results, our ArbRCAN also has much smaller memory cost (0.7G vs. 2.8G) and shorter running time (0.29s vs. 0.61s) as compared to Meta-RCAN. Since Meta-RCAN needs to super-resolve an LR image to a size larger than the expected one before bicubic downscaling to perform asymmetric SR, redundant computational and memory cost is involved. In contrast, our ArbRCAN can directly super-resolve the LR image to the expected size with better efficiency. + +Qualitative Results. Figure 9 illustrates the visual results achieved on two images of the Urban100 dataset. It can be observed from the zoom-in regions that our ArbRCAN produces better results for different asymmetric scale factors. Specifically, we can see from the second row that, our ArbRDN and ArbRCAN faithfully recover the stripes while other methods suffer blurring artifacts. This further demonstrates the superior performance of our networks on asymmetric scale factors. + +# 4.6. Results for SR in the Wild + +In many real-world applications, continuous magnification of an image to an arbitrary size is favored by customers such that they can stretch an image to any resolution they like. However, all existing SR network including RDN, RCAN and Meta-RCAN rely on post-processing (i.e., bicubic interpolation) to achieve scale-arbitrary SR, which is difficult to obtain optimal performance. In contrast, our network provides an end-to-end framework to produce better results. In this section, ArbRCAN is used to super-resolve a real-world image (an HR image in B200 [29]) to differ + +![](images/a8018404dd1939673ec8bdf2971b31ce2afab7eb0df4ba9b0c0d07203b790e89.jpg) +Figure 9. Visual comparison for SR with asymmetric scale factors on Urban100. +Figure 10. Visual comparison on a real-world image. + +ent resolutions for visual comparison, as shown in Fig. 10. When the input image is continuously magnified, the text becomes easier for recognition and our ArbRCAN consistently produces better perceptual quality than other methods. + +# 5. Conclusions + +In this paper, we proposed a plug-in module to enable existing image SR networks for scale-arbitrary SR with a single model. Experimental results show that baseline networks equipped with our module can produce promising results on SR tasks with non-integer and asymmetric scale factors, while maintaining state-of-the-art performance on integer scale factors. Moreover, our module can be easily adapted to scale-specific networks with small additional computational and memory cost. + +# References + +[1] Jian Sun, Zongben Xu, and Heung-Yeung Shum. Image super-resolution using gradient profile prior. In CVPR, 2008. 1, 2 +[2] Kaibing Zhang, Xinbo Gao, Dacheng Tao, and Xuelong Li. Single image super-resolution with non-local means and steering kernel regression. IEEE Trans. Image Process., 21(11):4544-4556, nov 2012. 1, 2 +[3] Chih-Yuan Yang and Ming-Hsuan Yang. Fast direct superresolution by simple functions. In ICCV, pages 561-568, 2013. 1, 2 +[4] Radu Timofte, Vincent De Smet, and Luc J. Van Gool. Anchored neighborhood regression for fast example-based super-resolution. In ICCV, pages 1920-1927, 2013. 1, 2 +[5] Shuhang Gu, Wangmeng Zuo, Qi Xie, Deyu Meng, Xi-angchu Feng, and Lei Zhang. Convolutional sparse coding for image super-resolution. In ICCV, pages 1823–1831, 2015. 1, 2 +[6] Muhammad Haris, Gregory Shakhnarovich, and Norimichi Ukita. Deep back-projection networks for super-resolution. In CVPR, pages 1664-1673, 2018. 1, 2 +[7] Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Learning a deep convolutional network for image super-resolution. In ECCV, pages 184-199, 2014. 1, 2 +[8] Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In CVPR, pages 1646-1654, 2016. 1, 2 +[9] Jose Caballero, Christian Ledig, Andrew P. Aitken, Alejandro Acosta, Johannes Totz, Zehan Wang, and Wenzhe Shi. Real-time video super-resolution with spatio-temporal networks and motion compensation. In CVPR, pages 2848-2857, 2017. 1, 2 +[10] Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image super-resolution. In CVPR, pages 2472-2481, 2018. 1, 2, 4, 5, 6, 7, 8 +[11] Yajun Qiu, Ruxin Wang, Dapeng Tao, and Jun Cheng. Embedded block residual network: A recursive restoration model for single-image super-resolution. In ICCV, 2019. 1 +[12] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In ECCV, pages 1646-1654, 2018. 1, 2, 4, 6, 7, 8 +[13] Tao Dai, Jianrui Cai, Yongbing Zhang, Shu-Tao Xia, and Lei Zhang. Second-order attention network for single image super-resolution. In CVPR, 2019. 1, 2 +[14] Xuecai Hu, Haoyuan Mu, Xiangyu Zhang, Zilei Wang, Jian Sun, and Tieniu Tan. Meta-SR: A magnification-arbitrary network for super-resolution. In CVPR, 2019. 1, 2, 4, 5, 6, 7, 8 +[15] Jianchao Yang, Zhaowen Wang, Zhe Lin, S. Cohen, and T. Huang. Coupled dictionary training for image superresolution. IEEE Trans. Image Process., 21(8):3467-3478, aug 2012. 2 + +[16] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In CVPR, 2017. 2, 4, 6, 7, 8 +[17] Ying Fu, Jian Chen, Tao Zhang, and Yonggang Lin. Residual scale attention network for arbitrary scale image superresolution. Neurocomputing, 427:201-211, 2021. 2 +[18] Yinpeng Chen, Xiyang Dai, Mengchen Liu, Dongdong Chen, Lu Yuan, and Zicheng Liu. Dynamic convolution: Attention over convolution kernels. arXiv, 2019. 2 +[19] Brandon Yang, Gabriel Bender, Quoc V. Le, and Jiquan Ngiam. Condconv: Conditionally parameterized convolutions for efficient inference. In NeurIPS, pages 1305-1316, 2019. 2 +[20] Yikang Zhang, Jian Zhang, Qiang Wang, and Zhao Zhong. Dynet: Dynamic convolution for accelerating convolutional neural networks. arXiv, 2020. 2 +[21] Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In ECCV, 2020. 2 +[22] Chao Dong, Chen Change Loy, and Xiaou Tang. Accelerating the super-resolution convolutional neural network. In ECCV, pages 391-407, 2016. 2 +[23] Namhyuk Ahn, Byungkon Kang, and Kyung-Ah Sohn. Fast, accurate, and lightweight super-resolution with cascading residual network. In ECCV, pages 252-268, 2018. 2 +[24] Minghao Yin, Zhuliang Yao, Yue Cao, Xiu Li, Zheng Zhang, Stephen Lin, and Han Hu. Disentangled non-local neural networks. In ECCV, 2020. 3 +[25] Wenzhe Shi, Jose Caballero, Ferenc Huszar, Johannes Totz, Andrew P. Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In CVPR, pages 1874-1883, 2016. 4 +[26] Eirikur Agustsson and Radu Timofte. NTIRE 2017 challenge on single image super-resolution: Dataset and study. In CVPRW, pages 1122-1131, 2017. 4 +[27] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie-Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In BMVC, pages 1-10, 2012. 4 +[28] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In International Conference on Curves and Surfaces, volume 6920, pages 711-730, 2010. 4 +[29] David Martin, Charless Fowlkes, Doron Tal, Jitendra Malik, et al. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In ICCV, 2001. 4, 8 +[30] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In CVPR, pages 5197-5206, 2015. 4 +[31] Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools Appl., 76(20):21811-21838, 2017. 4 + +[32] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, and et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019. 4 +[33] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 5 \ No newline at end of file diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/images.zip b/learningasinglenetworkforscalearbitrarysuperresolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d08f4d9c782d4cb8e402423a685b04084c358dec --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c6014d740aa97d9ba97b19441376b041e367055bec35da944e02611390d27ec +size 1155094 diff --git a/learningasinglenetworkforscalearbitrarysuperresolution/layout.json b/learningasinglenetworkforscalearbitrarysuperresolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dbd5db4bb372be459256754d42aa69bda002d67e --- /dev/null +++ b/learningasinglenetworkforscalearbitrarysuperresolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e42615cac0d195b8a17cc386bf8ad82cba60837cc4f9d8062a9c39059c9646b0 +size 403692 diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_content_list.json b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..255c010946d353c2d8f567af81b47f980c40f29e --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d05813dab93ba9569b0394744d60f6170b794c6089437b52cfd5323369b17bb +size 79519 diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_model.json b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a21b89e22a3e1f6767e600ff83f29076141bb6c4 --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a97f899619d9b59167dbfac6dc02c3f04a0258e5f62d5f74e62b9c06fb27090 +size 97255 diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_origin.pdf b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f11a1024830feb2a0f956d7eb7df8057dc5a9c07 --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/5c03f6cb-2c1c-4c65-bcbb-d33492a7b86b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8101239e3f587f6f370a5b01a6f248b2f907ad311a3bdf1995a07c348dea8e8b +size 7659176 diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/full.md b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..54158b59826d0c672b8f08f52860ad24b287c6d4 --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/full.md @@ -0,0 +1,331 @@ +# Learning a Sketch Tensor Space for Image Inpainting of Man-made Scenes + +Chenjie Cao, Yanwei Fu +School of Data Science, Fudan University +{20110980001, yanweifu}@fudan.edu.cn + +![](images/684f708317612659777ae5d77db4a38414ae8419a8ba60f8432e07d9d25aee13.jpg) +(a) Inputs + +![](images/abe7634c6835aabca7d94574ccee9fed04033f85a9f93748b613301f355f5ad5.jpg) +(b) Exemplar-based + +![](images/59dc07c6085466495dc89c2dee8bde35d31af1878c3f6ec5bc1304aa382fa9c7.jpg) +(c) GateConv +Figure 1: Results of (b) Exemplar-based inpainting [2], (c) GateConv [43], (d) EdgeConnect [28], and (e) our method, with the inpainted areas highlighted by red dot box. Our method makes better inpainting without artifacts. + +![](images/cef1f44efc8f8f1a0fc161513147457298bdc926353488d8a248cde27df4b4d4.jpg) +(d) EdgeConnect + +![](images/c09ce77955016f7096dbc57f0261e99bf577afa99ceb30a5a0de09bce993351e.jpg) +(e) Ours + +# Abstract + +This paper studies the task of inpainting man-made scenes. It is very challenging due to the difficulty in preserving the visual patterns of images, such as edges, lines, and junctions. Especially, most previous works are failed to restore the object/building structures for images of man-made scenes. To this end, this paper proposes learning a Sketch Tensor (ST) space for inpainting man-made scenes. Such a space is learned to restore the edges, lines, and junctions in images, and thus makes reliable predictions of the holistic image structures. To facilitate the structure refinement, we propose a Multi-scale Sketch Tensor inpainting (MST) network, with a novel encoder-decoder structure. The encoder extracts lines and edges from the input images to project them into an ST space. From this space, the decoder is learned to restore the input images. Extensive experiments validate the efficacy of our model. Furthermore, our model can also achieve competitive performance in inpainting general nature images over the competitors. + +# 1. Introduction + +As a long-standing problem, image inpainting has been studied to address the problem of filling in the missing parts of the images being semantically consistent and visually re + +alistic with plausible results. Thus, image inpainting is useful to many real-world applications, e.g. image restoration, image editing, and object removal [6]. + +Intrinsically as an inverse problem, the inpainting is challenging in both restoring the missed global structure (semantically consistent), and generating realistic regions locally coherent to unmasked regions (visually consistent). Especially, it is hard to reconstruct the missed image regions from the complex man-made scenes and structures, due to the difficulty in preserving the prominent low-level visual patterns, such as edges, line segments, and junctions, as shown in Fig. 1. To this end, this paper particularly focuses on learning to reconstruct these visual patterns for image inpainting, and proposes a method of the best merits in repairing the masked regions of man-made scene images, such as images with indoor and outdoor buildings. + +Both traditional approaches [2, 8, 19] and deep learning methods [24, 44, 40, 17, 43, 21] had made great efforts on reconstructing the structures of images in producing visually realistic results. However, these methods are still challenged by producing structurally coherent results, especially in the inpainting of man-made scenes. Typically, inpainting approaches may suffer from the following problems. (1) Missing critical structures. Traditional synthesis-based approaches are normally unable to model + +the critical structures as in Fig. 1(b). On the other hand, recent learning-based inpainting methods utilize auxiliary information to support the inpainting, e.g., edges [28, 20], and segmentation [32, 22], predominantly inpainting local visual cues, rather than holistic structures of man-made scenes. For example, the results of EdgeConnect [28] with canny edges [5] in Fig. 1(d) suffer from broken and blurry line segments and lose connectivity of building structures. (2) Unreliable pattern transfer: The learning-based auxiliary detectors will transfer and magnify the unreliable image priors or patterns to the masked image regions, which causes degraded inpainting results [22]. (3) Trading off performance and efficiency. The auxiliary-based inpainting methods usually consume more computation, due to additional components or training stages [28, 20, 39]. But these methods still have artifacts in junction regions as framed with red dotted lines in Fig. 1(c)(d). Therefore, the design of a more effective network is expected to efficiently enhance the inpainting performance. + +To address these issues, our key idea is to learn a Sketch Tensor (ST) space by an encoder-decoder model. (1) The encoder learns to infer both local and holistic critical structures of input images, including canny edges and compositional lines. The image is encoded as the binarized 'sketch' style feature maps, dubbed as sketch tensor. The decoder takes the restored structure to fill in holes of images. (2) For the first time, the idea of parsing wireframes [14] is repurposed to facilitate inpainting by strengthening the holistic structures of man-made scenes with more effective and flexible holistic structures. We propose a Line Segment Masking (LSM) algorithm to effectively train the wireframe parser, which alleviates unreliable structure guidance from corrupted images and the heavy computation of auxiliary detectors during the training phase. Besides, LSM also leverage the separability of line segments to extend the proposed model to obtain better object removal results. (3) Most importantly, we significantly boost the training and inference process of previous inpainting architectures. Thus, a series of efficient modules are proposed, which include partially gated convolutions, efficient attention module, and Pyramid Decomposing Separable (PDS) blocks. Critically, we present PDS blocks to help better learn binary line and edge maps. Our proposed modules make a good balance of model performance and training efficiency. + +Formally, this paper proposes a novel Multi-scale Sketch Tensor inpainting (MST) network with an encoder-decoder structure. The encoder employs LSM algorithm to train an hourglass wireframe parser [38] and a canny detector to extract line and edge maps. These maps concatenated with input images are projected into ST space by Pyramid Structure Sub-encoder (PSS), which is sequentially constructed by 3 partially gated convolution layers, 8 dilated residual block layers with an efficient attention module, and 3 pyra + +mid decomposing block layers as in Fig. 2. The image is encoded as a third-order sketch tensor in ST space, representing local and holistic structures. Finally, the decoder is stacked by two groups of 3 partially gated convolution layers for both ends with 8 residual block layers, which will re-project the sketch tensor into the restored image. + +We highlight several contributions here. (1) We propose learning a novel sketch tensor space for inpainting tasks. Such a space is learned to restore the critical missed structures and visual patterns, and makes reliable predictions of the holistic image structures. Essentially, the sketch tensor has good interpretability of input images, as empirically shown in experiments. (2) For the first time, the wireframe parsing has been re-purposed to extract lines and junctions for inpainting. A novel line segment masking algorithm is proposed to facilitate training our inpainting wireframe parser. (3) We introduce the novel partially gated convolution and efficient attention module to significantly improve model performance without incurring additional expensive computational cost than competitors, such as EdgeConnect. (4) A novel pyramid decomposing separable block is proposed to address the issue of effectively learning sparse binary edge and line maps. (5) Extensive experiments on the dataset of both man-made and natural scenes, including ShanghaiTech [14], Places2 [48], and York Urban [4]. show the efficacy of our MST-net, over the competitors. + +# 2. Related work + +Image Inpainting by Auxiliaries. The auxiliary information of semantics and structures have been utilized to help inpainting tasks in traditional methods, such as lines, structures [13, 1], and approximation images [10]. Recently, deep learning based approaches take auxiliary information as the important prior, such as canny edges [28, 20], smoothed edges [29, 12], edge and gradient information [39], and semantic segmentation [32, 22]. Auxiliary information has been also utilized in image editing [47, 30, 15, 18]. Particularly, EdgeConnect [28] and GateConv [43] both leverage edges to inpaint masked areas with specific structural results. However, there is no holistic structure information for man-made scenes that has been explicitly modeled and utilized as auxiliary information in previous work. Such information is crucial to inpaint the images of complex structures, such as buildings, or indoor furniture. To this end, our method utilizes the separability and connectivity of line segments to help improve the performance of inpainting. + +Line Detection Approaches. Line detection enjoys immense value in many real-world problems. Therefore, it has been widely researched and developed in computer vision. Many classic graphics algorithms are proposed to extract line segments from raw images [9, 34, 26]. However, these traditional methods suffer from intermittent and spu + +![](images/d6977101a0d56c53e381c9ffdac6986d72ed258253d570e65591ed20384b7ebe.jpg) +Figure 2: The overview of MST, which is consisted of encoder, sketch tensor space, and decoder. + +![](images/c34e1c491d5bba7e9d681b435baa8648f966aa449aa41b28cdd486466abe7dde.jpg) +Figure 3: The illustration of (a): Pyramid Decomposing Separable (PDS) block, (b): Efficient Attention block. + +vious line segments. Moreover, the extracted lines lack positions of junctions which causes poor connectivity. Huang et al. [14] propose a deep learning based wireframe parsing to improve the line detection task, which uses DNNs to predict heatmaps of junctions and line segments as the wireframe representation. LCNN proposed in [49] leverages heuristic sampling strategies and a line verification network to improve the performance of wireframe parsing. Furthermore, Xue et al. [38] utilize the holistic attraction field to enhance both efficiency and accuracy for the wireframe parser. Although wireframe parsing based models enjoy distinctive strengths, to the best of our knowledge, no previous work has considered utilizing wireframe parser to help preserve line structures for downstream inpainting task. Critically, for the first time, our method first repurposes the wireframe parser to facilitate image inpainting, which leverages connectivity and structural information of wireframes to achieve better inpainting performance. + +# 3. Multi-scale Sketch Tensor Inpainting + +Overview. The MST network is shown in Fig. 2. Given the input masked image $\mathbf{I}_m\in \mathbb{R}^{h\times w\times 3}$ and corresponding binary mask M, MST has three key components, i.e., encoder $\Phi :[\mathbf{I}_m,\mathbf{M}]\to S$ , decoder $\Psi :S\rightarrow \tilde{\mathbf{I}}_m$ , and Sketch Tensor (ST) space of a third-order tensor denoted by + +![](images/0c40622a4528888dc239bc8b6f91da7cbd1769a0884552a3eabbafdbd03bcdfe.jpg) +Figure 4: LSM Illustration. In training, lines segments are denoted by Eq. (1). Black solid lines, blue and green dotted lines indicate the retained, masked, and masked by probably $m$ lines. Only in inpainting training process or object removal task, the ground-truth images are known in advance. + +$S \in \mathbb{R}^{h \times w \times 3}$ . Particularly, the encoder firstly employs the improved wireframe parser LSM-HAWP and canny detector [5] to extract line $\mathbf{I}_l$ and edge maps $\mathbf{I}_e$ ; then the concatenated image and maps $[\mathbf{I}_l; \mathbf{I}_e; \mathbf{I}_m; \mathbf{M}]$ is processed by Pyramid Structure Sub-Encoder (PSS) to produce the ST space $S$ . The decoder predicts inpainted image $\tilde{\mathbf{I}}_m$ , closer to ground-truth image $\mathbf{I}$ . + +In this section, Sec. 3.1 will introduce the LSM algorithm. Details about the PSS and ST space are specified in Sec. 3.2. Finally, the decoder will be discussed in Sec. 3.4. + +# 3.1. Line Segment Masking Algorithm + +The wireframe parser HAWP [38] is adopted to extract lines from images. Specifically, it extracts the junction set $\mathbf{J} = \{\mathbf{p} = (x,y) \in \mathbb{R}^2\}$ , and line set $\mathbf{L} = \{\mathbf{l} = (\mathbf{p}_a, \mathbf{p}_b) = (x_a, y_a, x_b, y_b)\}$ paired by junctions in $\mathbf{J}$ . Unfortunately, if lines are corrupted by the mask $\mathbf{M}$ , the results of naive HAWP [38] will be largely degraded as shown in the inference stage of Fig. 4 with broken structures. + +To this end, we propose an LSM algorithm to infer missed line segments with the flexible wireframe parsing, which is composed of two parts. 1) Learning an LSM-HAWP network by retraining HAWP with the irregular [43] and object segmentation [45] masks. This not only improves the stability for the corrupted images, but also achieves superior results in trivial wireframe parsing tasks + +(Sec. 4.2). 2) Introducing an indicator function to denote the masking probability of each line segment $l$ according to the mask $M$ as the post-processing for LSM-HAWP, + +$$ +\mathbb {I} (\mathbf {l}) = \left\{ \begin{array}{l l} 1 & \text {i f} \mathbf {p} _ {a} \in \mathbf {M} \text {a n d} \mathbf {p} _ {b} \in \mathbf {M} \\ 0 & \text {i f} \mathbf {p} _ {a} \notin \mathbf {M} \text {a n d} \mathbf {p} _ {b} \notin \mathbf {M}, \\ m & \text {o t h e r w i s e} \end{array} \right. \tag {1} +$$ + +where $m$ ( $0 \leq m \leq 1$ ) is a hyper-parameter between 0 and 1, and junction $\mathbf{p} \in M, \mathbf{p} \notin M$ means that $\mathbf{p}$ is masked or not. Fig. 4 illustrates the LSM post-process in training and inference stages. In training, we set $m = 0.5$ to train the first half epochs, and $m = 1$ for training in the rest epochs. In the object removal task, we use the unmasked image with $m = 0$ to retain necessary structures. + +Thus as one practical strategy of speedup the learning process, we extract all wireframes beforehand and filtering them by the post-process of LSM, rather than an end-to-end training with LSM-HAWP, which dramatically improves the training efficiency. Note that in the testing stage for inpainting, corrupted images are used as the input to make our results fair comparable to the competitors. + +# 3.2. Pyramid Structure Sub-Encoder + +The LSM-HAWP and canny detector extract the line and edge maps $\mathbf{I}_l, \mathbf{I}_e \in \mathbb{R}^{h \times w \times 1}$ respectively. Essentially, $\mathbf{I}_e$ is binary map, and $\mathbf{I}_l$ is got from connecting junction pairs from LSM-HAWP with anti-aliased lines. The input to PSS is the concatenation of the masked image and structure maps $[\mathbf{I}_l; \mathbf{I}_e; \mathbf{I}_m]$ . As shown in Fig. 2, the PSS is composed of partially gated convolutions, dilated [41] residual blocks, efficient attention, and pyramid decomposing separable blocks, which will be explained next. For the detailed structures, please refer to our supplementary. + +Partially Gated Convolutions. We adopt the Gated Convolution (GC) layers to process the masked input features, as it works well for the irregular mask inpainting tasks in [43]. Unfortunately, GC demands much more trainable parameters than vanilla convolutions. To this end, as shown in Fig. 2 and Fig. 3(a), we propose a partially GC strategy of only utilizing three GC layers for the input and output features in both encoder and decoder models. Essentially, this is motivated by our finding that the outputs of GC mostly devoting to filtering features of masked and unmasked regions only in the encoder layers of the coarse network and the decoder layers of the refinement network in [43]. In contrast, we do not observe significantly performance improvement of using GC in the middle layers of backbones. Thus, we maintain vanilla convolutions (i.e., residual blocks) in the middle layers, to save parameters and improve the performance as empirically validated in Tab. 4. + +Efficient Attention Block. Intuitively, attention is important to learn patterns crossing spatial locations in image inpainting [42, 25, 21, 39]. However, attention modules are + +expensive to be computed, and non-trivial to be parallelized in image inpainting [42]. To this end, we leverage Efficient Attention (EA) module among middle blocks of Fig. 2 and detailed in Fig. 3(b). Particularly, for the input feature $\mathbf{X} \in \mathbb{R}^{h \times w \times d}$ , and mask $\mathbf{M} \in \mathbb{R}^{h \times w \times 1}$ , we first reshape them to $\mathbb{R}^{hw \times d}$ and $\mathbb{R}^{hw \times 1}$ as the vector data respectively. Then, the process of efficient attention can be written as + +$$ +\mathbf {Q} = \operatorname {s o f t m a x} _ {r o w} \left(\mathbf {W} _ {q} \mathbf {X} + (\mathbf {M} \cdot - \infty)\right) +$$ + +$$ +\mathbf {K} = \operatorname {s o f t m a x} _ {c o l} \left(\mathbf {W} _ {k} \mathbf {X} + (\mathbf {M} \cdot - \infty)\right) \tag {2} +$$ + +$$ +\mathbf {V} = \mathbf {W} _ {v} \mathbf {X}, \quad \mathbf {E} = \mathbf {Q} (\mathbf {K} ^ {T} \mathbf {V}), +$$ + +where $\mathbf{W}_{q,k,v}$ indicates different learned parameter matrices; $+(M - \infty)$ means masking the corrupted inputs before the softmax operation. Critically, $\mathrm{softmax}_{row}$ and $\mathrm{softmax}_{col}$ means the softmax operations on the row and column individually. Then, we achieve the output $\mathbf{E} \in \mathbb{R}^{hw\times d}$ , which will be reshaped back to $\mathbb{R}^{h\times w\times d}$ . Note that Eq. (2) is an approximation to vanilla attention operation as in [31]. Typically, this strategy should in principle, reduce significantly computational cost. Since $\mathbf{E}$ is computed by $\mathbf{K}^T\mathbf{V} \in \mathbb{R}^{d\times d}$ , rather than standard $\mathbf{Q}\mathbf{K}^T \in \mathbb{R}^{hw\times hw}$ . In practice, the dimension $d$ is much smaller than $hw$ in computer vision tasks. Furthermore, as in Fig. 3(b), we introduce the multi-head attention [33] to further reduce the dimension from $d$ to $d' = d / n_{head}$ . Thus, $\mathbf{K}^T\mathbf{V}$ could aggregate the query $\mathbf{Q}$ in feature level and obtain the global context $\mathbf{E}$ . Note that EA module is inspired but different from [31], as the attention scores of corrupted regions are masked to aggregate features from uncorrupted regions. + +Pyramid Decomposing Separable (PDS) Block. We have found that GAN-based edge inpainting [35] suffers from generating meaningless edges or unreasonable blanks for masked areas as shown in Fig. 6, due to the nature of sparsity in binary edge maps. Thus, we propose a novel PDS block in PSS as in Fig. 3(a). PDS leverages dilated lower-scale structures to make up the sparse problem for ST space. Particularly, assume the image feature $\mathbf{X} \in \mathbb{R}^{h \times w \times d}$ , PDS firstly decouples it as + +$$ +\mathbf {E} _ {l e} = f _ {e b} (\operatorname {G a t e C o n v} (\mathbf {X})), \left\{\mathbf {E} _ {l}, \mathbf {E} _ {e} \right\} = \operatorname {s p l i t} \left(\mathbf {E} _ {l e}\right), \tag {3} +$$ + +$$ +\mathbf {O} _ {e} = \sigma (\operatorname {C o n v} (\mathbf {E} _ {e})), \mathbf {O} _ {l} = \sigma (\operatorname {C o n v} (\mathbf {E} _ {l})), +$$ + +where $\sigma$ is sigmoid activation. We project the feature into two separated embedding spaces called line embedding $\mathbf{E}_l$ and edge embedding $\mathbf{E}_e$ with the function $f_{eb}$ , which is composed with $\mathrm{Conv2D} \to \mathrm{IN} \to \mathrm{ReLU}$ . split is the operation of splitting the features into two respective tensors with equal channels. Then, $\mathbf{E}_l$ and $\mathbf{E}_e$ are utilized to learn to roughly reconstruct the image $\mathbf{O}_{im}$ without corruption as + +$$ +\mathbf {A} = f _ {a b} \left(\mathbf {E} _ {l e}\right) \in \mathbb {R} ^ {h \times w \times 1} +$$ + +$$ +\mathbf {E} _ {l e} ^ {\prime} = \mathbf {E} _ {l} \odot (1 - \mathbf {A}) + \mathbf {E} _ {e} \odot \mathbf {A} \tag {4} +$$ + +$$ +\mathbf {O} _ {i m} = \tanh (\operatorname {C o n v} (\mathbf {E} _ {l e} ^ {\prime})), +$$ + +where $f_{ab}$ is Conv2D $\rightarrow$ IN $\rightarrow$ ReLU $\rightarrow$ Conv2D $\rightarrow$ Sigmoid. + $\odot$ denotes the element-wise product. The prediction of + +coarse $\mathbf{O}_{im}$ gives a stronger constraint to the conflict of $\mathbf{E}_l$ and $\mathbf{E}_e$ , and we expect the attention map $\mathbf{A}$ can be learned adaptively according to a challenging target. Furthermore, a multi-scale strategy is introduced in the PDS. For the given feature $\mathbf{X}^{(1)} \in \mathbb{R}^{64 \times 64 \times d}$ from dilated residual blocks of PSS, PDS predicts lines, edges, and coarse images with different resolutions as follow + +$$ +\mathbf {X} ^ {(i + 1)}, \mathbf {O} _ {i m} ^ {(i)}, \mathbf {O} _ {l} ^ {(i)}, \mathbf {O} _ {e} ^ {(i)} = \operatorname {P D S} ^ {(i)} (\mathbf {X} ^ {(i)}), \tag {5} +$$ + +where $i = 1,2,3$ indicate that the output maps with $64\times 64$ , $128\times 128$ , and $256\times 256$ resolutions respectively. Various scales of images can be in favor of reconstructing different types of structure information. + +Loss Function of PSS. We minimize the objectives of PPS with two spectral norm [27] based SN-PathGAN [43] discriminators $D_{l}$ and $D_{e}$ for lines and edges respectively. And the $\mathcal{L}_D^{enc}$ and $\mathcal{L}_G^{enc}$ are indicated as + +$$ +\mathcal {L} _ {D} ^ {e n c} = \mathcal {L} _ {D _ {l}} + \mathcal {L} _ {D _ {e}}, +$$ + +$$ +\mathcal {L} _ {G} ^ {e n c} = \lambda_ {a} \mathcal {L} _ {a d v} ^ {e n c} + \lambda_ {f} \mathcal {L} _ {f m} + \sum_ {i = 1} ^ {3} \| \mathbf {O} _ {i m} ^ {(i)} - \mathbf {I} ^ {(i)} \| _ {1}, \tag {6} +$$ + +where $\mathbf{O}_{im}^{(i)}$ , $\mathbf{I}^{(i)}$ are the multi-scale outputs (Eq. 5) and ground-truth images varying image size $64 \times 64$ to $256 \times 256$ respectively. $\mathcal{L}_{fm}$ is the feature matching loss as in [28] to restrict the $l_{1}$ loss between discriminator features from the concatenated coarse-to-fine real and fake sketches discussed below. And the adversarial loss can be further specified as + +$$ +\begin{array}{l} \mathcal {L} _ {a d v} ^ {e n c} = - \mathbb {E} \left[ \log D _ {l} (\hat {\mathbf {O}} _ {l}) \right] - \mathbb {E} \left[ \log D _ {e} (\hat {\mathbf {O}} _ {e}) \right], \\ \mathcal {L} _ {D _ {l}} = - \mathbb {E} \left[ \log D _ {l} (\hat {\mathbf {I}} _ {l}) \right] - \mathbb {E} \left[ 1 - \log D _ {l} (\hat {\mathbf {O}} _ {l}) \right], \tag {7} \\ \mathcal {L} _ {D _ {e}} = - \mathbb {E} \left[ \log D _ {e} (\hat {\mathbf {I}} _ {e}) \right] - \mathbb {E} \left[ 1 - \log D _ {e} (\hat {\mathbf {O}} _ {e}) \right], \\ \end{array} +$$ + +where $\hat{\mathbf{O}}_l$ , $\hat{\mathbf{O}}_e \in \mathbb{R}^{256 \times 256 \times 3}$ are got from the multi-scale PSS outputs of lines and edges, which are upsampled and concatenated with $\hat{\mathbf{O}}_l = [\mathrm{up}(\mathbf{O}_l^{(1)});\mathrm{up}(\mathbf{O}_l^{(2)});\mathbf{O}_l^{(3)}]$ and $\hat{\mathbf{O}}_e = [\mathrm{up}(\mathbf{O}_e^{(1)});\mathrm{up}(\mathbf{O}_e^{(2)});\mathbf{O}_e^{(3)}]$ . To unify these outputs into the same scale, the nearest upsampling $\mathrm{up()}$ is utilized here. Accordingly, $\hat{\mathbf{I}}_l$ , and $\hat{\mathbf{I}}_e$ are the concatenation of multiscale ground-truth edge and line maps, respectively. Note that, we firstly dilate the ground-truth edges and lines with the $2 \times 2$ kernel, and then subsample them to produce the low resolution maps at the scale of $64 \times 64$ , $128 \times 128$ . The hyper-parameters are set as $\lambda_a = 0.1$ , $\lambda_f = 10$ . + +# 3.3. Sketch Tensor (ST) Space + +The last outputs $\mathbf{O}_l^{(3)},\mathbf{O}_e^{(3)}\in \mathbb{R}^{256\times 256\times 1}$ of Eq. 5 is used to compose the ST space as + +$$ +\mathcal {S} = \left[ \mathbf {O} _ {l} ^ {(3)}; \mathbf {O} _ {e} ^ {(3)}; \operatorname {c l i p} \left(\mathbf {O} _ {l} ^ {(3)} + \mathbf {O} _ {e} ^ {(3)}\right) \right]. \tag {8} +$$ + +Generally, lines represent holistic structures, while edges indicate some local details. They provide priors of structures in different manners to the inpainting model. We also + +combine and clip them within 0 and 1 to emphasize overlaps and make an intuitive expression of the whole structure. + +# 3.4. Decoder of MST Network + +The structure of the decoder is the same as PSS except that the decoder has no attention blocks and PSD blocks. Because we find that the generator in [28] is sufficient to generate fine results with reasonable structure information. But we still add gated mechanism to the leading and trailing three convolutions to improve the performance for the irregular mask. As the encoder has provided the ST space $S \in \mathbb{R}^{h \times w \times 3}$ in Eq. 8, we can get the inpainted image $\tilde{\mathbf{I}}_m$ with the masked input $\mathbf{I}_m$ and mask $\mathbf{M}$ as + +$$ +\tilde {\mathbf {I}} _ {m} = \boldsymbol {\Psi} ([ \mathbf {I} _ {m}; \mathbf {M}; \mathcal {S} ]). \tag {9} +$$ + +We use SN-PathGAN [43] based discriminator $D_{im}$ for the decoder, and the objectives to be minimized are + +$$ +\mathcal {L} _ {D} ^ {d e c} = - \mathbb {E} \left[ \log D _ {i m} (\mathbf {I}) \right] - \mathbb {E} \left[ 1 - \log D _ {i m} \left(\tilde {\mathbf {I}} _ {m}\right) \right], \tag {10} +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {G} ^ {d e c} = \mathcal {L} _ {l _ {1}} + \lambda_ {a} \mathcal {L} _ {a d v} ^ {d e c} + \lambda_ {p} \mathcal {L} _ {p e r} + \lambda_ {s} \mathcal {L} _ {s t y l e}, \\ \mathcal {L} _ {a d v} ^ {d e c} = - \mathbb {E} \left[ \log D _ {i m} \left(\tilde {\mathbf {I}} _ {m}\right) \right], \tag {11} \\ \end{array} +$$ + +where $\mathbf{I}$ is the origin undamaged image for training. We adopt the $l_{1}$ loss $\mathcal{L}_{l_1}$ , VGG-19 based perceptual loss [16] $\mathcal{L}_{per}$ , and style-loss [7] $\mathcal{L}_{style}$ to train our model, with the empirically setted hyperparameters $\lambda_p = 0.1$ , $\lambda_s = 250$ [28, 12]. We propose using the balanced loss form [3] to implement reconstruction losses $\mathcal{L}_{l_1}$ and $\mathcal{L}_{per}$ , normalizing by the weights of masked region $\mathbf{M}$ and unmasked region $1 - \mathbf{M}$ . The balanced loss form can settle the inpainting task with imbalanced irregular masks properly. + +Note that we learn the encoder and the decoder jointly in the forward pass. The gradients of the decoder will not be propagated to update the encoder, which not only saves the memory but also maintains the interpretability of the sketch tensor $S$ . Generally, the total parameter number and calculation costs of our model are comparable to [28]. + +# 4. Experiments and Results + +Datasets. The proposed approach is evaluated on three datasets: ShanghaiTech [14], Places2 [48], and York Urban [4]. ShanghaiTech contains 5000 training images and 462 test images consisted of buildings and indoor scenes with wireframe labels. The LSM-HAWP wireframe detection model is trained on this dataset with the mask augmentation. For Places2, we select 10 categories images according to the number of line segments detected by HAWP as man-made scenes (P2M). Moreover, we randomly select 10 Places2 classes with both natural and urban scenes as comprehensive scenes $(\mathrm{P2C})^{1}$ . For York Urban, it has 102 city street view images for testing models trained with P2M. + +![](images/83cb9107843c76a007b74ff74dd762d055622b3ae0516c99e75a0b47d218d7b9.jpg) +Figure 5: Qualitative results in ShanghaiTech and man-made Places2, where * means that our method works in the LMS object removal mode with $m = 0$ . Key parts are enlarged, and the complete generated pictures are shown in the supplementary. + +
GCECRFRMEDOursOurs*
S.T.P↑25.5426.5126.3026.1426.9027.20
S.↑0.8930.8710.8630.8860.8760.880
F.↓26.0624.8425.9530.0221.1620.05
P2MP↑25.7226.7126.0723.8427.2027.47
S.↑0.8920.9010.8900.8570.9070.910
F.↓16.5414.7517.7926.9512.8112.13
Y-U.P↑25.9226.1325.6424.2026.2926.59
S.↑0.8860.8640.8520.8580.8690.872
F.↓31.6832.0638.7051.7129.1526.53
P2CP↑27.8728.35--28.5228.65
S.↑0.9230.927--0.9280.929
F.↓15.0513.68--11.9711.69
+ +Table 1: The PSNR (P.), SSIM (S.) and FID (F.) results on ShanghaiTech (S.-T.), man-made Places2 (P2M), York Urban (Y.-U.), and comprehensive Places2 (P2C). $\uparrow$ means larger is better and $\downarrow$ means lower is better. * indicates our method working in object removal mode of LSM. Best results are bold except for object removal ones. + +Implementation Details. Our method is implemented with PyTorch in $256 \times 256$ image size. All models are trained with Adam optimizer of $\beta_{1} = 0$ and $\beta_{2} = 0.9$ , and the initial learning rates are $2e - 4$ and $2e - 5$ for generators and discriminators respectively. We train the model with 400k steps in ShanghaiTech and 1000k steps in Places2. Besides, $E_{s}$ is trained with $1/3$ of the total steps, and then be fixed. We decay the learning rate with 0.75 for each 100k steps. For the structure information, line segments are extracted by HAWP, and Canny edges are got with $\sigma = 2$ . Our model is trained in Pytorch v1.3.1, and costs about 2 days training + +in ShanghaiTech and about 5 days in Places2 with a single NVIDIA(R) Tesla(R) V100 16GB GPU. + +Comparison Methods. We compare the proposed MST with some state-of-the-art methods, which include Gated Convolution (GC) [43], Edge Connect (EC) [28], Recurrent Feature Reasoning (RFR) [21], and Mutual Encoder-Decoder with Feature Equalizations (MED) [12]. These methods are all retrained with similar settings and costs compared with ours. + +Settings of Masks. To handle the real-world image inpainting and editing tasks, such as object removal, the random irregular mask generation in [43, 37] is adopted in this paper. Besides, as discussed in [45], real-world inpainting tasks usually remove regions with typical objects or scenes segments. So we collect 91707 diverse semantic segmentation masks with various objects and scenes with the coverage rates in $[5\%, 40\%]$ from the COCO dataset [23]. Overall, the final mask will be chosen from irregular masks and COCO segment masks randomly with $50\%$ in both training and test set. To be fair, all comparison methods are retrained with the same masking strategy. + +# 4.1. Image Inpainting Results + +For fair comparisons in image inpainting, we do not leak any line segments of the uncorrupted images for the image inpainting task and related discussions. The wireframe parser LSM-HAWP is trained in ShanghaiTech, and it predicts the line segments for the other two datasets. Besides, results from the object removal with $m = 0$ in Eq. (1) are offered for reference only in this section. + +Quantitative Comparisons. In this section, we evaluate results with PSNR, SSIM [36], and FID [11]. As discussed + +![](images/a1eae3223b194f44aff3127a211243eafab0bf6668ec105483afd51cf8f6dc27.jpg) +Figure 6: (From left to right) Original image, masked image, edges $\mathbf{O}_e$ generated from EC [28], edges and lines $\mathrm{clip}(\mathbf{O}_l + \mathbf{O}_e)$ generated from our model, our inpainted results. Blue lines indicate the generated lines or edges. + +in [46], we find that $l_{2}$ based metrics such as PSNR and SSIM often contradict human judgment. For example, some meaningless blurring areas will cause large perceptual deviations but small $l_{2}$ loss [46]. Therefore, we pay more attention to the perceptual metric FID in quantitative comparisons. The results on ShanghaiTech, P2M, and York Urban are shown in Tab. 1. From the quantitative results, our method outperforms other approaches in PSNR and FID. Especially for the FID, which accords with the human perception, our method achieves considerable advantages. Besides, our method enjoys good generalization, as it also works properly in P2M, York Urban, and even P2C. + +Qualitative Comparisons. Qualitative results among our method and other state-of-the-art methods are shown in Fig. 5. Compared with other methods, our approach achieves more semantically coherent results. From the enlarged regions, our schema significantly outperforms other approaches in preserving the perspectivity and the structures of man-made scenes. Moreover, we show the edge results of EC [28] and partial sketch tensor space (edges and lines) results of our method in ShanghaiTech, P2M, and P2C in Fig. 6. Results in Fig. 6 demonstrate that line segments can supply compositional information to avoid indecisive and meaningless generations in edges. Furthermore, line segments can also provide clear and specific structures + +
GCECOurs
S.-T.3.007.6733.67
P2M6.678.6732.33
+ +Table 2: Average user scores of ShanghaiTech (S.-T.) and man-made Places2 (P2M). + +in masked regions to reconstruct more definitive results in man-made scenes. Besides, for the natural scene images in P2C without any lines, our method can still outperform EC with reasonable generated edges for the masked regions. As discussed in Sec. 3.2, the proposed PDS works properly to handle the sparse generative problem. + +Results of Natural Scenes. In the last three rows of Tab. 1, we present the results of ours method on the comprehensive Places2 dataset (P2C) to confirm the generalization. They are compared with GC and EC, which have achieved fine scores in man-made Places2 (P2M). Note that all metrics are improved in P2C compared with ones in P2M of Tab. 1, which demonstrates man-made scenes are more difficult to tackle. Our methods still get the best results among all competitors, and the object removal results achieve superior performance. Besides, the last two rows of Fig. 6 show that our method can generate reliable edge sketches even without lines in natural scenes. These phenomenons are largely due to two reasons: 1) There is still a considerable quantity of line segments in the comprehensive scenes, and these instances are usually more difficult than others. 2) The proposed partially gated convolutions, efficient attention, and PDS blocks can work properly for various scenes. + +Human Judgements. For more comprehensive comparisons, 50 inpainted images from GC [43], EC [28], and ours are chosen from ShanghaiTech and P2M randomly. And these samples are compared by 3 uncorrelated volunteers. Particularly, volunteers need to choose the best one from the mixed pool of the inpainted images with different methods, and give one score to the respective approach. If all methods work roughly the same for a certain sample, it will be ignored. The average scores are shown in Tab. 2. Ours method is significantly better than other competitors. + +# 4.2. Other Applications and Ablation Study + +Object Removal. From the last column in Fig. 5, we show the inpainting results of our MST working in the postprocess of LSM with $m = 0$ for the object removal. These refined images with more reasonable structures indicate that the our model can strengthen the capability of image reconstruction without redundant residues. From Fig. 7, some object removal cases are shown to confirm the practicability of the proposed method. Numerical results are presented in the last columns of Tab. 1. So, our method can achieve further improvements in all metrics compared with the vanilla image inpainting schema for the object removal, and it can correctly mask undesired lines. Therefore, the post-process + +![](images/97b9cb154b9e89c9478689f6b620f6432bc76b9324320243f968bc47d338347c.jpg) +Figure 7: Object removal examples. From left to right: origin image, masked image, and our inpainted image. + +
unmasked testsetmasked testset
Threshold5101551015
HAWP62.1665.9467.6435.3938.4740.15
LSM-HAWP63.2067.0668.7048.9353.3055.39
+ +Table 3: Structural average precision scores [49] with different thresholds of parsers trained with (LSM-HAWP) and without (HAWP) the mask augmentation on ShanghaiTech. + +
PSNR↑SSIM↑FID↓Param
w/o GC26.510.87124.8410.8M
Partially GC26.780.87422.6812.1M
All GC26.710.87422.6225.1M
+ +Table 4: Ablation study of the gated convolution of our model in ShanghaiTech, Param indicates the parameter scale of the compared inpainting model. + +
w/o linesw/o EAw/o PDSOurs
PSNR↑26.7826.7726.6326.90
SSIM↑0.8740.8750.8730.876
FID↓22.6821.3921.8821.16
+ +Table 5: Quantitative ablation studies in ShanghaiTech. + +of LSM can significantly improve the performance in the object removal task with the separability of line segments. Masked Wireframe Detection. As discussed in Sec. 3.1, we retrain the HAWP with mask augmentation to ensure the robustness for the corrupted data as LSM-HAWP in ShanghaiTech dataset [14]. To confirm the effect of the augmentation, we further prepare another masked ShanghaiTech testset with the same images. The results are shown in Tab. 3. The structural average precision (sAP) metric is proposed + +![](images/8ca60c3e2814d78e583d904d4057307cc6f0be6441068ba8c952d6fbaff8bf61.jpg) +Figure 8: Ablation studies on line segments and PDS blocks in ShanghaiTech. Blue and red lines indicate recovered and ground truth in masked regions, respectively. + +in [49], which is defined as the area under the PR curve of detected lines with different thresholds. From Tab. 3, LSM-HAWP performs better than vanilla HAWP significantly for the masked testset. Moreover, HAWP can also gain improvements in the uncorropted testset with more than $1\%$ in sAP, which indicates the great generality of the mask augmentation for the wireframe detection task. + +Simplification of Gated Convolutions. The related ablation study of GC are shown in Tab. 4. Only replacing vanilla convolutions for input and output stages of the model with partially GC gains satisfactory improvements. But replacing all convolution layers with GC fails to achieve a further large advance, while the parameters are doubled2. + +Contributions of Lines, PDS, and EA. We explored the effects of lines, Pyramid Decomposing Separable (PDS) blocks and the Efficient Attention (EA) module in Tab. 5 in ShanghaiTech. Specifically, line segments, PDS blocks and the EA module are removed respectively, while other settings unchanged. As shown in Fig. 8, our method without line segments causes severe structural loss, and the one without PDS suffers from contradictory perspectivity. From Tab. 5, we can see all line segments, PDS blocks and the EA module can improve the performance in image inpainting. + +# 5. Conclusions + +This paper studies an encoder-decoder MST-net for inpainting. It learns a sketch tensor space restoring edges, lines, and junctions. Specifically, the encoder extracts and refines line and edge structures into a sketch tensor space. The decoder recovers the image from it. Moreover, the LSM algorithm is proposed to update the line extractor HAWP to fit the inpainting and object removal tasks. Several effective network modules are proposed to improve the MST for tough man-made scenes inpainting. Extensive experiments validate the efficacy of our MST-net for inpainting. + +Acknowledgment Yanwei Fu is the corresponding author. This project is supported by Huawei, and released on https://ewrfcas.github.io/MST_inpainting. + +# References + +[1] Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. Patchmatch: A randomized correspondence algorithm for structural image editing. ACM Trans. Graph., 28(3):24, 2009. 2 +[2] Antonio Criminisi, Patrick Perez, and Kentaro Toyama. Object removal by exemplar-based inpainting. In 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2003. Proceedings., volume 2, pages II-II. IEEE, 2003. 1, 1 +[3] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9268-9277, 2019. 3.4 +[4] Patrick Denis, James H Elder, and Francisco J Estrada. Efficient edge-based methods for estimating Manhattan frames in urban imagery. In European conference on computer vision, pages 197-210. Springer, 2008. 1, 4 +[5] Lijun Ding and Ardeshir Goshtasby. On the canny edge detector. Pattern Recognition, 34(3):721-725, 2001. 1, 3 +[6] Omar Elharrouss, Noor Almaadeed, Somaya Al-Maadeed, and Younes Akbari. Image inpainting: A review. Neural Processing Letters, pages 1-22, 2019. 1 +[7] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2414-2423, 2016. 3.4 +[8] Qiang Guo, Shanshan Gao, Xiaofeng Zhang, Yilong Yin, and Caiming Zhang. Patch-based image inpainting via two-stage low rank approximation. IEEE transactions on visualization and computer graphics, 24(6):2023-2036, 2017. 1 +[9] Peter E Hart and RO Duda. Use of the hough transformation to detect lines and curves in pictures. Communications of the ACM, 15(1):11-15, 1972. 2 +[10] James Hays and Alexei A Efros. Scene completion using millions of photographs. Communications of the ACM, 51(10):87-94, 2008. 2 +[11] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pages 6626-6637, 2017. 4.1 +[12] Bin Jiang Hongyu Liu, Yibing Song, Wei Huang, and Chao Yang. Rethinking image inpainting via a mutual encoder-decoder with feature equalizations. In Proceedings of the European Conference on Computer Vision, 2020. 2, 3.4, 4 +[13] Jia-Bin Huang, Sing Bing Kang, Narendra Ahuja, and Johannes Kopf. Image completion using planar structure guidance. ACM Transactions on graphics (TOG), 33(4):1-10, 2014. 2 +[14] Kun Huang, Yifan Wang, Zihan Zhou, Tianjiao Ding, Shenghua Gao, and Yi Ma. Learning to parse wireframes in images of man-made environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 626-635, 2018. 1, 2, 4, 4.2 + +[15] Youngjoo Jo and Jongyoul Park. Sc-fegan: Face editing generative adversarial network with user's sketch and color. In Proceedings of the IEEE International Conference on Computer Vision, pages 1745-1753, 2019. 2 +[16] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision, pages 694–711. Springer, 2016. 3.4 +[17] Avisek Lahiri, Arnav Kumar Jain, Sanskar Agrawal, Pabitra Mitra, and Prabir Kumar Biswas. Prior guided gan based semantic inpainting. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1 +[18] Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: Towards diverse and interactive facial image manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5549-5558, 2020. 2 +[19] Haodong Li, Weiqi Luo, and Jiwu Huang. Localization of diffusion-based inpainting in digital images. IEEE Transactions on Information Forensics and Security, 12(12):3050-3064, 2017. 1 +[20] Jingyuan Li, Fengxiang He, Lefei Zhang, Bo Du, and Dacheng Tao. Progressive reconstruction of visual structure for image inpainting. In Proceedings of the IEEE International Conference on Computer Vision, pages 5962-5971, 2019. 1, 2 +[21] Jingyuan Li, Ning Wang, Lefei Zhang, Bo Du, and Dacheng Tao. Recurrent feature reasoning for image inpainting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7760-7768, 2020. 1, 3.2, 4 +[22] Liang Liao, Jing Xiao, Zheng Wang, Chia-Wen Lin, and Shinichi Satoh. Guidance and evaluation: Semantic-aware image inpainting for mixed scenes. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXVII 16, pages 683-700. Springer, 2020. 1, 2 +[23] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dálár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740-755. Springer, 2014. 4 +[24] Guilin Liu, Fitsum A Reda, Kevin J Shih, Ting-Chun Wang, Andrew Tao, and Bryan Catanzaro. Image inpainting for irregular holes using partial convolutions. In Proceedings of the European Conference on Computer Vision (ECCV), pages 85-100, 2018. 1 +[25] Hongyu Liu, Bin Jiang, Yi Xiao, and Chao Yang. Coherent semantic attention for image inpainting. In Proceedings of the IEEE International Conference on Computer Vision, pages 4170-4179, 2019. 3.2 +[26] Xiaohu Lu, Jian Yao, Kai Li, and Li Li. Cannylines: A parameter-free line segment detector. In 2015 IEEE International Conference on Image Processing (ICIP), pages 507-511. IEEE, 2015. 2 +[27] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative ad + +versarial networks. In International Conference on Learning Representations, 2018. 3.2 +[28] Kamyar Nazeri, Eric Ng, Tony Joseph, Faisal Qureshi, and Mehran Ebrahimi. Edgeconnect: Structure guided image inpainting using edge prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, Oct 2019. 1, 1, 2, 3.2, 3.4, 3.4, 4, 6, 4.1, 4.1 +[29] Yurui Ren, Xiaoming Yu, Ruonan Zhang, Thomas H Li, Shan Liu, and Ge Li. Structureflow: Image inpainting via structure-aware appearance flow. In Proceedings of the IEEE International Conference on Computer Vision, pages 181-190, 2019. 2 +[30] Patsorn Sangkloy, Jingwan Lu, Chen Fang, Fisher Yu, and James Hays. Scribbler: Controlling deep image synthesis with sketch and color. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5400-5409, 2017. 2 +[31] Zhuoran Shen, Mingyuan Zhang, Haiyu Zhao, Shuai Yi, and Hongsheng Li. Efficient attention: Attention with linear complexities. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3531-3539, 2021. 3.2 +[32] Yuhang Song, Chao Yang, Yeji Shen, Peng Wang, Qin Huang, and C-C Jay Kuo. Spg-net: Segmentation prediction and guidance network for image inpainting. arXiv preprint arXiv:1805.03356, 2018. 1, 2 +[33] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008, 2017. 3.2 +[34] Rafael Grompone Von Gioi, Jeremie Jakubowicz, Jean-Michel Morel, and Gregory Randall. Lsd: A fast line segment detector with a false detection control. IEEE transactions on pattern analysis and machine intelligence, 32(4):722-732, 2008. 2 +[35] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8798-8807, 2018. 3.2 +[36] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004. 4.1 +[37] Wei Xiong, Jiahui Yu, Zhe Lin, Jimei Yang, Xin Lu, Connelly Barnes, and Jiebo Luo. Foreground-aware image inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5840-5848, 2019. 4 +[38] Nan Xue, Tianfu Wu, Song Bai, Fudong Wang, Gui-Song Xia, Liangpei Zhang, and Philip HS Torr. Holistically-attracted wireframe parsing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2788-2797, 2020. 1, 2, 3.1 + +[39] Jie Yang, Zhiquan Qi, and Yong Shi. Learning to incorporate structure knowledge for image inpainting. In AAAI, pages 12605-12612, 2020. 1, 2, 3.2 +[40] Zili Yi, Qiang Tang, Shekoofeh Azizi, Daesik Jang, and Zhan Xu. Contextual residual aggregation for ultra high-resolution image inpainting. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1 +[41] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015. 3.2 +[42] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5505-5514, 2018. 3.2 +[43] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Free-form image inpainting with gated convolution. In Proceedings of the IEEE International Conference on Computer Vision, pages 4471-4480, 2019. 1, 1, 2, 3.1, 3.2, 3.2, 3.4, 4, 4.1 +[44] Yanhong Zeng, Jianlong Fu, Hongyang Chao, and Baining Guo. Learning pyramid-context encoder network for high-quality image inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1486-1494, 2019. 1 +[45] Yu Zeng, Zhe Lin, Jimei Yang, Jianming Zhang, Eli Shechtman, and Huchuan Lu. High-resolution image inpainting with iterative confidence feedback and guided upsampling. In European Conference on Computer Vision, pages 1-17. Springer, 2020. 3.1, 4 +[46] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 586-595, 2018. 4.1 +[47] Richard Zhang, Jun-Yan Zhu, Phillip Isola, Xinyang Geng, Angela S Lin, Tianhe Yu, and Alexei A Efros. Real-time user-guided image colorization with learned deep priors. ACM Transactions on Graphics (TOG), 9(4), 2017. 2 +[48] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452-1464, 2017. 1, 4 +[49] Yichao Zhou, Haozhi Qi, and Yi Ma. End-to-end wireframe parsing. In Proceedings of the IEEE International Conference on Computer Vision, pages 962-971, 2019. 2, 3, 4.2 \ No newline at end of file diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/images.zip b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c1dcf22488ff3d5ceae7aa2ff460a71950cba554 --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:878340e055986d846fb8ba06b791be5efc2f6964fc319bd360239748923f7d5d +size 843162 diff --git a/learningasketchtensorspaceforimageinpaintingofmanmadescenes/layout.json b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a0bc136b5b78d2779ad13446a20d805b5bad0cdb --- /dev/null +++ b/learningasketchtensorspaceforimageinpaintingofmanmadescenes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1846205de3ef0f3f8201c0f12b17765bccb490669253d0345fd496d548e1245 +size 420274 diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_content_list.json b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..13f86233c1c0a1415f7f9c9189fcc4b2c9210ff9 --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57841fb53b9fd26c788d7450984605185324fca2488558bf3bbd87b7e45106ea +size 80776 diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_model.json b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cac40c487a84b82cb9cdf6b16a2801fc065b9fbd --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5eda4231ec7a109112d62f061a3bb53afe2e86368a15025a80c1eb17d91a9e4e +size 99057 diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_origin.pdf b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5a5bc5753612db2d1118fada8f7195ae138b2b6e --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/944d4805-ff15-4986-bc52-1f53322d407a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ac3cba4e867b10f40b9ef2358d1cfb5a55bce63b050635b9ce9d599e0a7c188 +size 815905 diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/full.md b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/full.md new file mode 100644 index 0000000000000000000000000000000000000000..13d3b4ce7cc41016c1dfee1bdf71feba8cf7768e --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/full.md @@ -0,0 +1,301 @@ +# Learning by Aligning: +Visible-Infrared Person Re-identification using Cross-Modal Correspondences + +Hyunjong Park* + +Sanghoon Lee* + +Junghyup Lee + +Bumsub Ham† + +School of Electrical and Electronic Engineering, Yonsei University + +https://cvlab.yonsei.ac.kr/projects/LbA + +# Abstract + +We address the problem of visible-infrared person re-identification (VI-reID), that is, retrieving a set of person images, captured by visible or infrared cameras, in a cross-modal setting. Two main challenges in VI-reID are intraclass variations across person images, and cross-modal discrepancies between visible and infrared images. Assuming that the person images are roughly aligned, previous approaches attempt to learn coarse image- or rigid part-level person representations that are discriminative and generalizable across different modalities. However, the person images, typically cropped by off-the-shelf object detectors, are not necessarily well-aligned, which distract discriminative person representation learning. In this paper, we introduce a novel feature learning framework that addresses these problems in a unified way. To this end, we propose to exploit dense correspondences between cross-modal person images. This allows to address the cross-modal discrepancies in a pixel-level, suppressing modality-related features from person representations more effectively. This also encourages pixel-wise associations between cross-modal local features, further facilitating discriminative feature learning for VI-reID. Extensive experiments and analyses on standard VI-reID benchmarks demonstrate the effectiveness of our approach, which significantly outperforms the state of the art. + +# 1. Introduction + +Person re-identification (reID) aims at retrieving person images, captured across multiple cameras, with the same identity as a query person. It provides a wide range of applications, including surveillance, security, and pedestrian analysis, and has gained a lot of attention over the last decade [40, 47]. Most reID methods formulate the task as a single-modality retrieval problem, and focus on finding matches, e.g., between RGB images. Visible cameras are incapable of capturing appearances of persons, particularly + +![](images/d95aed1898cf652507d3a2856aa59f8985c0e0e10e36bf4babcb5e481684a02b.jpg) +Figure 1: An example of dense cross-modal correspondences between RGB and IR images from the SYSU-MM01 dataset [36]. For the visualization purpose only, we show the top 20 matches according to similarities between local person representations learned without (left) and with (right) our approach. Our person representations are robust to the cross-modal discrepancies, while being highly discriminative, especially for person regions. (Best viewed in color.) + +![](images/9771f61961a760e8c5a755af2dae1c68db78a159a2ee161d97830f4d5b97c654.jpg) + +important for person reID, under poor-illumination conditions (e.g., at night time or dark indoors). Infrared (IR) cameras, on the other hand, work well, regardless of visual light, capturing an overall scene layout, while not taking scene details, such as texture and color. Accordingly, visible-IR person re-identification (VI-reID), that is, retrieving IR person images of the same identity as an RGB query and vice versa, has recently been of great interest [36]. + +VI-reID is extremely challenging due to intra-class variations (e.g. viewpoint, pose, illumination and background clutter), noisy samples (e.g. misalignment and occlusion), and cross-modal discrepancies between RGB and IR images. Visual attributes and statistics of RGB/IR images are significantly different from one another [36]. VI-reID methods based on convolutional neural networks (CNNs) alleviate the discrepancies using cross-modal metric losses [7, 37, 41] along with a modality discriminator [4] to learn person representations robust to the cross-modal discrepancies, and further refine the representations with self-attention [39] or disentanglement techniques [3]. These approaches focus on learning coarse image-level or rigid part-level representations, assuming that person images are roughly aligned. + +Misaligned features from RGB and IR images, however, have an adverse effect on handling the cross-modal discrepancies, distracting learning person representations. + +In this paper, we propose to leverage dense correspondences between cross-modal images during training for VI-reID. To this end, we encourage person representations of RGB images to reconstruct those from IR images of the same identity, which often depict different appearances due to viewpoint and pose variations, and vice versa. We achieve this by establishing dense cross-modal correspondences between RGB and IR person images in a probabilistic way. We incorporate parameter-free person masks to focus on the reconstructions of person regions, while discarding others including background or occluded regions. We also introduce novel ID consistency and dense triplet losses using pixel-level associations, allowing the network to learn more discriminative person representations. Dense cross-modal correspondences align pixel-level person representations from RGB and IR image explicitly, which is beneficial to person representation learning for VI-reID due to two main reasons. First, by enforcing semantically similar regions from RGB and IR images to be embedded nearby, we encourage the network to extract features invariant to the input modalities, even from misaligned RGB and IR person images. Second, by encouraging a local association, we enforce the network to focus on extracting discriminative pixel-wise local features, which further facilitates the person representation learning. The network trained using our framework is thus able to offer local features that are robust to cross-modal discrepancies and highly discriminative (Fig. 1), which are aggregated to form a final person representation for VI-reID, without any additional parameters at test time. Experimental results and extensive analyses on standard VI-reID benchmarks demonstrate the effectiveness and efficiency of our approach. The main contributions of this paper can be summarized as follows: + +- We propose a novel feature learning framework for VIReID using dense cross-modal correspondences that alleviates the discrepancies between multi-modal images effectively, while further enhancing the discriminative power of person representations. +- We introduce ID consistency and dense triplet losses to train our network end-to-end, which help to extract discriminative person representations using cross-modal correspondences. +- We achieve a new state of the art on standard VIreID benchmarks and demonstrate the effectiveness and efficiency of our approach through extensive experiments with ablation studies. + +# 2. Related work + +In this section, we briefly describe representative works related to ours, including person reID, VI-reID, cross-modal + +image retrieval and dense correspondence. + +ReID. Person reID methods typically tackle a single-modality case, that is, RGB-to-RGB matching. They formulate the reID task as a multi-class classification problem [49], where person images of the same identity belong to the same category. A triplet loss is further exploited to encourage person representations obtained from the same identity to be embedded nearby, while those from the different identities to be distant in feature space [12]. Recent methods focus on extracting person representations robust to intra-class variations, exploiting attributes to offer complementary information [19], disentangling identity-related features [9, 48], or incorporating attention techniques to see discriminative regions [18, 46]. Many reID methods leverage part-based representations [8, 32, 33], which further enhance the discriminative power of person features. Specifically, they divide person images into multiple horizontal grids exploiting human body parts implicitly. Local features from the horizontal parts are more robust to intra-class variations, especially for occlusion, than the global one. However, when body parts from corresponding horizontal grids are misaligned, this rather distracts learning person representations. The works of [15, 23, 45, 52] propose to align semantically related regions between person images, by employing auxiliary pose estimators [23, 45] or human semantic parsing techniques [15, 52]. While these auxiliary branches offer reliable estimations to guide the alignment, they have two main drawbacks: First, they typically require additional datasets during training. Second, the auxiliary predictions are required at test time, making the overall pipeline computationally heavy. On the other hand, we perform the alignment during training only, by leveraging dense correspondences, without additional supervisory signals except ID labels, while enabling an efficient pipeline at test time. + +VI-reID. VI-reID has recently been explored compared to single-modality reID, according to the wide spread of RGB-IR cameras. VI-reID methods focus on handling cross-modal discrepancies between RGB and IR images, while learning discriminative person representations. Early works try to learn discriminative features generalizable across different modalities. They adopt classification and/or triplet losses, widely used in single-modality reID methods [36, 40], which however do not mitigate the cross-modal discrepancies explicitly. To address this problem, recent methods use a cross-modal triplet loss, where positive/negative pairs and an anchor are sampled from person images with different modalities [7, 37, 41]. For example, RGB images are used as anchors, while exploiting IR ones as positive/negative samples. These approaches encourage the features, obtained from person images of the same identity but having different modalities, to be sim + +ilar, providing person representations robust to the cross-modal discrepancies. More recently, DDAG [39] proposes to leverage a graph attention network in order to consider cross-modal relations between RGB and IR images explicitly. VI-reID methods based on generative adversarial networks (GANs) alleviate the cross-modal discrepancies in an image level. For example, they synthesize novel IR person images, with an identity-preserving constraint [34] or cycle consistency [35], given RGB inputs, in order to compare person images with the same modality. Other approaches to leveraging adversarial learning techniques for VI-reID are to disentangle identity-related features from person representations [3], or to exploit a modality discriminator to better align feature distributions of RGB/IR images [4]. Although GANs better capture discriminative factors for person reID, they require lots of parameters and heuristics to train networks [28]. In contrast to current VI-reID methods, we address the cross-modal discrepancies in a pixel level. To this end, we align semantically related regions explicitly via dense cross-modal correspondences, which also allows discriminative feature learning, even from misaligned person images. + +Cross-modal image retrieval. VI-reID is closely related to cross-modal image retrieval that focuses on finding matches between images of different modalities, e.g., sketch/natural images [27, 29], and RGB/IR images [1, 20]. Existing works typically employ a siamese network [42] to learn a metric function between input image pairs [1, 29], or disentangle feature representations into modality shared-and specific- embeddings [20, 27]. They attempt to alleviate the cross-modal discrepancies between multi-modal images in an image-level. We instead address the discrepancies in a pixel-level by leveraging dense correspondences. + +Correspondence. Establishing correspondences between images has long been of particular importance in many computer vision tasks, including depth prediction [13, 43], optical flow [2, 6], 3D scene reconstruction [16, 51], and colorization [11, 44]. In context of person reID, the work of [31] leverages dense correspondences to learn a metric function for single-modality person reID. The learned metric function, however, is required even at test time, demanding large computational power and memory. In contrast, we exploit the correspondences as explicit regularizers to guide the feature learning during training only, enabling a simple cosine distance computation between person representations at test time. + +# 3. Approach + +We describe in this section an overview of our framework for VI-reID (Sec. 3.1), and present detailed descriptions of a network architecture (Sec. 3.2) and training losses (Sec. 3.3). + +![](images/b39487e929ddba60dabb63431c9b76e1f8f1103b2db28af370820478445efafe.jpg) +Figure 2: Overview of our framework for VI-reID. We extract RGB and IR features, denoted by $\mathbf{f}_{\mathrm{RGB}}$ and $\mathbf{f}_{\mathrm{IR}}$ , respectively, using a two-stream CNN. The CMAAlign module computes cross-modal feature similarities and matching probabilities between these features, and aligns the cross-modal features w.r.t each other using soft warping, together with parameter-free person masks to mitigate ambiguous matches between background regions. We exploit both original RGB and IR features and aligned ones ( $\hat{\mathbf{f}}_{\mathrm{RGB}}$ and $\hat{\mathbf{f}}_{\mathrm{IR}}$ ) during training, and incorporate them into our objective function consisting of ID ( $\mathcal{L}_{\mathrm{ID}}$ ), ID consistency ( $\mathcal{L}_{\mathrm{IC}}$ ) and dense triplet ( $\mathcal{L}_{\mathrm{DT}}$ ) terms. At test time, we compute cosine distances between person representations, obtained by pooling RGB and IR features. See text for details. + +# 3.1. Overview + +We show in Fig. 2 an overview of our framework for VI-reID. We first extract RGB and IR features from corresponding person images, and then align the features with a CMAlign module. It establishes dense cross-modal correspondences between RGB and IR features, and warps these features w.r.t each other using corresponding matching probabilities. Note that we exploit the CMAlign module at training time only, enabling an efficient inference at test time. To train our framework, we exploit three terms: ID $(\mathcal{L}_{\mathrm{ID}})$ , ID consistency $(\mathcal{L}_{\mathrm{IC}})$ , and dense triplet $(\mathcal{L}_{\mathrm{DT}})$ losses. The ID loss applies to each feature from RGB or IR images, separately, similar to single-modality reID [12]. It enforces the features from person images of the same identity to be the same, while providing different ones for the images of different identities. The ID consistency and dense triplet terms exploit the matching probabilities, and encourage RGB and IR features from the same identity to reconstruct one another in a pixel-level, while those from different identities do not. The person representations obtained using these terms are thus robust to the cross-modal discrepancies between RGB and IR images. Note that we use identification labels alone to train our model, without exploiting auxiliary supervisory signals, such as e.g., body + +parts [15] or landmarks [23], for the alignment. Note also that all components in our model are fully differentiable, making it possible to train the whole network end-to-end. + +# 3.2. Network Architecture + +Feature extractor. We use a two-stream CNN to extract feature maps of size $h \times w \times d$ from a pair of RGB/IR person images, where $h$ , $w$ and $d$ are the height, width and number of channels, respectively. Assuming that the cross-modal discrepancies between RGB/IR images mainly lie in low-level features [36, 40], we use separate parameters specific to the input modalities for shallow layers, while sharing the remaining ones for others. + +CMAlign. The CMAlign module aligns RGB and IR features bidirectionally, i.e., from RGB to IR and from IR to RGB, using dense cross-modal correspondences in a probabilistic way. In the following, we describe an IR-to-RGB alignment. The other case can be performed similarly. + +For the IR-to-RGB alignment, we compute local similarities between all pairs of RGB and IR features. Concretely, we compute cosine similarities between RGB and IR features, denoted by $\mathbf{f}_{\mathrm{RGB}} \in \mathbb{R}^{h \times w \times d}$ and $\mathbf{f}_{\mathrm{IR}} \in \mathbb{R}^{h \times w \times d}$ , respectively, as follows: + +$$ +C (\mathbf {p}, \mathbf {q}) = \frac {\mathbf {f} _ {\mathrm {R G B}} (\mathbf {p}) ^ {\top} \mathbf {f} _ {\mathrm {I R}} (\mathbf {q})}{\| \mathbf {f} _ {\mathrm {R G B}} (\mathbf {p}) \| _ {2} \| \mathbf {f} _ {\mathrm {I R}} (\mathbf {q}) \| _ {2}}, \tag {1} +$$ + +where $\| \cdot \|_2$ computes the L2 norm of a vector. We denote by $\mathbf{f}_{\mathrm{RGB}}(\mathbf{p})$ and $\mathbf{f}_{\mathrm{IR}}(\mathbf{q})$ RGB and IR features of size $d$ at position $\mathbf{p}$ and $\mathbf{q}$ , respectively. Based on the similarities, we compute RGB-to-IR matching probabilities using a softmax function as follows: + +$$ +P (\mathbf {p}, \mathbf {q}) = \frac {\exp (\beta C (\mathbf {p} , \mathbf {q}))}{\sum_ {\mathbf {q} ^ {\prime}} \exp (\beta C (\mathbf {p} , \mathbf {q} ^ {\prime}))}, \tag {2} +$$ + +where we denote by $P$ a matching probability, a 4D tensor of size $h \times w \times h \times w$ , and $\beta$ is a temperature parameter. Note that we can establish dense correspondences explicitly from RGB to IR images, by applying an argmax operator to the matching probabilities for each RGB feature, i.e., $\operatorname{argmax}_{\mathbf{q}} P(\mathbf{p}, \mathbf{q})$ . This offers reliable cross-modal correspondences for semantically similar regions, but aligning IR and RGB features using the hard correspondences is problematic. The correspondences are easily distracted by background clutter and image-specific details (e.g., texture and occlusion), and appearance variations between RGB and IR images are even more significant. Moreover, we could not establish correspondences between different background regions, e.g., from person images captured with different surrounding environments. To alleviate these problems, we instead exploit the matching probabilities, and align IR and RGB features between foreground + +regions only, typically correspond to persons, via soft warping as follows: + +$$ +\hat {\mathbf {f}} _ {\mathrm {R G B}} (\mathbf {p}) = \tag {3} +$$ + +$$ +M _ {\mathrm {R G B}} (\mathbf {p}) \mathcal {W} (\mathbf {f} _ {\mathrm {I R}} (\mathbf {p})) + (1 - M _ {\mathrm {R G B}} (\mathbf {p})) \mathbf {f} _ {\mathrm {R G B}} (\mathbf {p}), +$$ + +where we denote by $\hat{\mathbf{f}}_{\mathrm{RGB}} \in \mathbb{R}^{h \times w \times d}$ and $M_{\mathrm{RGB}} \in \mathbb{R}^{h \times w}$ a reconstructed RGB feature by the IR-to-RGB alignment and a person mask, respectively. We denote by $\mathcal{W}$ a soft warping operator that aggregates features using the matching probabilities, defined as follows: + +$$ +\mathcal {W} (\mathbf {f} _ {\mathrm {I R}} (\mathbf {p})) = \sum_ {\mathbf {q}} P (\mathbf {p}, \mathbf {q}) \mathbf {f} _ {\mathrm {I R}} (\mathbf {q}). \tag {4} +$$ + +The person mask ensures that the features $\hat{\mathbf{f}}_{\mathrm{RGB}}$ , for person regions are reconstructed by aggregating IR features in a probabilistic way, while others come from original RGB features $\mathbf{f}_{\mathrm{RGB}}$ . This reconstruction together with ID consistency and dense triplet losses encourages our model to provide similar person representations, regardless of image modalities, for the corresponding regions. To infer the mask without ground-truth labels, we assume that features, learned with ID labels for the reID task, are highly activated on person regions than other parts, and compute an activation map based on L2 norms of the local feature vectors, denoted by $\mathbf{g}_{\mathrm{RGB}} \in \mathbb{R}^{h \times w}$ for an RGB feature, as follows: + +$$ +\mathbf {g} _ {\mathrm {R G B}} (\mathbf {p}) = \left\| \mathbf {f} _ {\mathrm {R G B}} (\mathbf {p}) \right\| _ {2}. \tag {5} +$$ + +With the activation map of an RGB feature, $\mathbf{g}_{\mathrm{RGB}}$ , at hand, we define a person mask for an RGB feature as follows: + +$$ +M _ {\mathrm {R G B}} = f \left(\mathbf {g} _ {\mathrm {R G B}}\right), \tag {6} +$$ + +where $f$ performs min-max normalization: + +$$ +f (\mathbf {x}) = \frac {\mathbf {x} - \operatorname* {m i n} (\mathbf {x})}{\operatorname* {m a x} (\mathbf {x}) - \operatorname* {m i n} (\mathbf {x})}. \tag {7} +$$ + +The CMAlign, which is a non-parametric module that operates directly on the features obtained from the feature extractor, facilitates learning robust person representations by providing the following advantages in VI-reID: First, a cross-modal alignment helps to alleviate the discrepancies between RGB and IR images in a pixel-level, allowing to suppress modality-related features from person representations more effectively, even with misaligned person images; Second, a dense alignment allows our network to focus on learning local features, especially for person regions, further enhancing the discriminative power of person representations. Note that a pair of RGB and IR images does not have to be of the same identity in our framework, enabling exploiting both positive and negative pairs for training. + +# 3.3. Loss + +We exploit ground-truth ID labels of person images to train our model with an overall objective function as follows: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {I D}} + \lambda_ {\mathrm {I C}} \mathcal {L} _ {\mathrm {I C}} + \lambda_ {\mathrm {D T}} \mathcal {L} _ {\mathrm {D T}}, \tag {8} +$$ + +where $\mathcal{L}_{\mathrm{ID}}$ , $\mathcal{L}_{\mathrm{IC}}$ and $\mathcal{L}_{\mathrm{DT}}$ are ID, ID consistency, and dense triplet losses, respectively. $\lambda_{\mathrm{IC}}$ and $\lambda_{\mathrm{DT}}$ are hyperparameters to balance corresponding terms. In the following, we present a detailed description of each term in the loss. + +ID loss $(\mathcal{L}_{\mathrm{ID}})$ . As an ID loss, we adopt a sum of classification and hard triplet losses [12] using image-level person representations, which have shown the effectiveness on learning discriminative person features in single-modality person reID. We denote by $\phi(\mathbf{f}_{\mathrm{RGB}}) \in \mathbb{R}^d$ and $\phi(\mathbf{f}_{\mathrm{IR}}) \in \mathbb{R}^d$ image-level person representations for the RGB and IR features, respectively, which are obtained by applying a GeM pooling operation [26] to each feature. To compute the classification term, we feed each image-level feature, $\phi(\mathbf{f}_{\mathrm{RGB}})$ and $\phi(\mathbf{f}_{\mathrm{IR}})$ , into a same classifier to predict class probabilities, that is, likelihoods of being particular identities for the image-level feature, where the classifier consists of a Batch Normalization layer [14], followed by a fully-connected layer with a softmax activation [22]. We then compute a cross-entropy between the class probabilities and ground-truth identities. The hard triplet term is also computed using image-level person representations, obtained from anchor, positive, and negative images, where the anchor and positive ones share the same ID label, while other pairs do not. Note that the ID loss does not address the cross-modal discrepancies between RGB and IR images explicitly. + +ID consistency loss $(\mathcal{L}_{\mathrm{IC}})$ . We design a term to consider the cross-modal discrepancies between RGB and IR features in an image-level. Suppose that we have a positive pair with the same identity but having different modalities, i.e., RGB and IR images are of the same identity. The features $\hat{\mathbf{f}}_{\mathrm{RGB}}$ for person regions are reconstructed by aggregating IR features $\mathbf{f}_{\mathrm{IR}}$ , suggesting that the identity of the reconstruction $\hat{\mathbf{f}}_{\mathrm{RGB}}$ should be the same as ground-truth identity for the original features $\mathbf{f}_{\mathrm{RGB}}$ and $\mathbf{f}_{\mathrm{IR}}$ . More specifically, image-level representations of $\phi(\hat{\mathbf{f}}_{\mathrm{RGB}})$ and $\phi(\hat{\mathbf{f}}_{\mathrm{IR}})$ should have the same ID labels as corresponding positive counterparts of different modalities, $\mathbf{f}_{\mathrm{IR}}$ and $\mathbf{f}_{\mathrm{RGB}}$ , respectively. To implement this idea, we define an ID consistency loss as a cross-entropy using image-level representations, similar to the classification term in the ID loss. We instead exploit reconstructed features, $\phi(\hat{\mathbf{f}}_{\mathrm{RGB}})$ and $\phi(\hat{\mathbf{f}}_{\mathrm{IR}})$ . Note that we use the same classifier as in the ID loss. The ID consistency loss enforces ID predictions from person images of the same identity but with different modalities to be consistent, allowing to suppress modality-related features from person representations. Moreover, the reconstructions, $\phi(\hat{\mathbf{f}}_{\mathrm{RGB}})$ and $\phi(\hat{\mathbf{f}}_{\mathrm{IR}})$ provide an effect of offering additional samples to train the classifier, further guiding the discriminative person representation learning. + +Dense triplet loss $(\mathcal{L}_{\mathrm{DT}})$ . The ID loss facilitates learning discriminative person representations, and the ID con + +![](images/c9d8365c3bc5e42bd0dde1b8acc8cb802b8fb1f0a93e8a96936263d907244002.jpg) +Figure 3: Visualization of person masks for IR and RGB images, $M_{\mathrm{IR}}$ (left) and $M_{\mathrm{RGB}}$ (right), and a corresponding co-attention map, $A_{\mathrm{IR}}$ (middle). We overlay the masks and the attention map over corresponding images from SYSU-MM01 [36]. We can see that the IR image depicts a person with fully visible body parts, whereas the person of the same identity in the RGB image is partially occluded (lower body). The co-attention map highlights image regions that are mutually visible in both images and suppresses others using dense cross-modal alignments via soft warping. (Best viewed in color.) + +![](images/c0fa7236d4674045060ad218fdd165cc23edac238e8d7792ecdb7c1595288f4e.jpg) + +![](images/0884f16d886e3b325f4b180180b41a0dc3b7364888f45bcea8c03a27dcccc4cd.jpg) + +![](images/185e26fb7964af276ad8fb2d33ca3b99b63575d07d07ca30fcabe4031854f416.jpg) + +sistency term alleviates the cross-modal discrepancies explicitly. They, however, focus on learning image-level person representations, which prohibits discriminative feature learning, especially when the person images are occluded or misaligned. To address this problem, we introduce a dense triplet loss. It locally compares original features and reconstructed ones using the features of different modalities, encouraging final image-level person representations to be discriminative, while alleviating the cross-modal discrepancies in a pixel-level. A straight-forward approach is to compute L2 distances between local features, which is, however, suboptimal in that this does not take occluded regions into consideration. This is particularly problematic when each of person images in a pair depicts disassociated human parts. Enforcing local alignments between the entire person regions in this case is infeasible, and maybe even harmful. To circumvent this issue, we incorporate a coattention map highlighting person regions visible in both RGB and IR images. This considers feature alignments within mutually visible foreground regions only to compute the dense triplet loss. We define a co-attention map, denoted by $A_{\mathrm{RGB}} \in \mathbb{R}^{h \times w}$ for an RGB image, as follows: + +$$ +A _ {\mathrm {R G B}} (\mathbf {p}) = M _ {\mathrm {R G B}} (\mathbf {p}) \mathcal {W} \left(M _ {\mathrm {I R}} (\mathbf {p})\right). \tag {9} +$$ + +For $\mathcal{W}(M_{\mathrm{IR}}(\mathbf{p}))$ , in this case, we compute the matching probabilities $P$ between $\mathbf{f}_{\mathrm{RGB}}$ and $\mathbf{f}_{\mathrm{IR}}$ , similar to (4), whereas the person masks are exploited for soft warping. Namely, the co-attention map $A_{\mathrm{RGB}}$ is an intersection of the RGB person mask $M_{\mathrm{RGB}}(\mathbf{p})$ and the warped IR one, w.r.t the RGB image, $\mathcal{W}(M_{\mathrm{IR}}(\mathbf{p}))$ . We compute a coattention map for an IR image similarly, and show in Fig. 3 an example of a co-attention map. Note that we define coattention maps between positive pairs of the same identity + +only. Note also that we perform min-max normalization $f$ on the obtained co-attention map, which we omit for notational brevity. + +To facilitate training with the dense triplet term, we sample a triplet of anchor, positive, and negative images, where the anchor and other two images have different modalities $e.g.$ , an RGB image for the anchor, and IR images for a pair of positive and negative samples. We use the superscripts, a, p, and n to indicate features from anchor, positive, and negative images, respectively. For example, we denote by $\hat{\mathbf{f}}_{\mathrm{RGB}}^{\mathrm{p}}$ a reconstructed RGB feature using an anchor $\mathbf{f}_{\mathrm{RGB}}^{\mathrm{a}}$ and a positive pair $\mathbf{f}_{\mathrm{IR}}^{\mathrm{p}}$ with the same identity as the anchor $\mathbf{f}_{\mathrm{RGB}}^{\mathrm{a}}$ . Similarly, $\hat{\mathbf{f}}_{\mathrm{IR}}^{\mathrm{n}}$ is a reconstructed IR feature using an anchor $\mathbf{f}_{\mathrm{IR}}^{\mathrm{a}}$ and a negative pair $\mathbf{f}_{\mathrm{RGB}}^{\mathrm{n}}$ with the different identity from the anchor $\mathbf{f}_{\mathrm{IR}}^{\mathrm{a}}$ . With co-attention maps at hand, we define the dense triplet loss as follows: + +$$ +\mathcal {L} _ {\mathrm {D T}} = \sum_ {i \in \{\text {R G B , I R} \}} \sum_ {\mathbf {p}} A _ {i} (\mathbf {p}) \left[ d _ {i} ^ {+} (\mathbf {p}) - d _ {i} ^ {-} (\mathbf {p}) + \alpha \right] _ {+}, \tag {10} +$$ + +where $\alpha$ is a pre-defined margin and the operation $[\cdot]_{+}$ indicates $\max(0, \cdot)$ . $d_{i}^{+}(\mathbf{p})$ and $d_{i}^{-}(\mathbf{p})$ compute local distances between an anchor feature and reconstructed ones from positive and negative images, respectively, as follows: + +$$ +d _ {i} ^ {+} (\mathbf {p}) = \left\| \mathbf {f} _ {i} ^ {\mathrm {a}} (\mathbf {p}) - \hat {\mathbf {f}} _ {i} ^ {\mathrm {p}} (\mathbf {p}) \right\| _ {2}, d _ {i} ^ {-} (\mathbf {p}) = \left\| \mathbf {f} _ {i} ^ {\mathrm {a}} (\mathbf {p}) - \hat {\mathbf {f}} _ {i} ^ {\mathrm {n}} (\mathbf {p}) \right\| _ {2}. \tag {11} +$$ + +Note that the reconstructions, $\hat{\mathbf{f}}_i^{\mathrm{p}}$ and $\hat{\mathbf{f}}_i^{\mathrm{n}}$ , are the aggregations of similar features w.r.t the anchor $\mathbf{f}_i^{\mathrm{a}}$ from positive and negative images, respectively. We can thus interpret that our loss enforces an aggregation of similar features from negative images to be distant in the embedding space, compared to its positive counterpart by a margin. This is similar to the typical triplet loss [12, 30], but ours penalizes incorrect distances for all local features visible in both anchor and positive images in a soft manner. Note that this local association is possible due to the CMAAlign module that performs the dense cross-modal alignment between RGB and IR person images in a probabilistic way. + +# 4. Experiments + +In this section, we present a detailed analysis and evaluation of our approach including ablation studies on different losses and network architectures. + +# 4.1. Implementation details + +Dataset. We use two benchmarks for evaluation: 1) The RegDB dataset [24] contains 412 persons, where each person has 10 visible and 10 far-infrared images collected by dual camera systems. Following the experimental protocol in [24], we divide the dataset into training and test splits randomly, each of which includes non-overlapping 206 identities. We test our model in both visible-to-IR and IR-to-visible settings, which correspond to retrieving IR images + +from RGB ones and RGB images from IR ones, respectively, and report the results averaged over 10 trials with different training/test splits. 2) SYSU-MM01 [36] is a large-scale dataset for VI-reID, consisting of RGB and IR images obtained by four visible and two near-infrared sensors, respectively. Concretely, it contains 22,258 visible and 11,909 near-infrared images with 395 identities for training. The test set contains 96 identities with 3,803 near-infrared images for a query set and 301 visible images for a gallery set. We adopt the evaluation protocol in [36], which uses all-search and indoor-search modes for testing, where the gallery sets for the former and the latter contain images captured by all four and two indoor visible cameras, respectively. Note that all our results are obtained by taking an average value over 4 training and test runs. + +Training. Following the previous VI-reID methods [3, 21, 39], we adopt ResNet50 [10], trained for ImageNet classification [5], as our backbone network. The backbone networks for visible and infrared images share the parameters, except for the first residual blocks that take images of different modalities, and the stride of the last convolutional block is set to 1. We resize each person image to the size of 288 $\times$ 144, and apply horizontal flipping for data augmentation. We set the size of a person representation $d$ to 2,048. For a mini-batch, we randomly choose 8 identities from each modality and sample 4 person images for each identity. We train our model for 80 epochs with a batch size of 64, using the SGD optimizer with momentum of 0.9 and weight decay of 5e-4. We use a warm-up strategy [22], gradually raising learning rates for the backbones and other parts of the network up to 1e-2 and 1e-1, respectively, which are then decayed by a factor of 10 at the 20th and 50th epochs. We use a grid search to set hyper-parameters: $\lambda_{\mathrm{IC}} = 1$ , $\lambda_{\mathrm{DT}} = 0.5$ , $\alpha = 0.3$ , $\beta = 50$ . Note that we employ BNN trick [22] during training only, exploiting ResNet50 [10] at test time without any additional parameters. We implement our model with PyTorch [25] and train it end-to-end, taking about 6 and 8 hours for RegDB [24] and SYSU-MM01 [36], respectively, with a Geforce RTX 2080 Ti GPU. + +# 4.2. Results + +Comparison with the state of the art. We present in Table 1 a quantitative comparison of our method with the state of the art for VI-reID [3, 4, 17, 21, 34, 35, 36, 37, 38, 39]. We report mean average precision (mAP) (\%) and rank-1 accuracy (\%) for a single-shot setting on RegDB [24] and SYSU-MM01 [36]. From the table, we can see that our model sets a new state of the art for VI-reID, except for an indoor-search mode on SYSU-MM01 [36], where DDAG [39] shows better results. This method, however, requires additional parameters, other than the ResNet50 [10] backbone, for a feature refinement with self-attention at test + +Table 1: Quantitative comparison with the state of the art for VI-reID. We measure mAP (%) and rank-1 accuracy (%) on the RegDB [24] and SYSU-MM01 [36] datasets and report the average and standard deviations over 4 training and test runs. Numbers in bold indicate the best performance and underscored ones indicate the second best. + +
MethodsRegDB [24]SYSU-MM01 [36]
Visible to InfraredInfrared to VisibleAll-searchIndoor-search
mAPrank-1mAPrank-1mAPrank-1mAPrank-1
One-stream [36]14.0213.11--13.6712.0422.9516.94
Two-stream [36]13.4212.43--12.8511.6521.4915.60
Zero-Pad [36]18.9017.7517.8216.6315.9514.8026.9220.58
TONE [37]14.9216.87--14.4212.5226.3820.82
HCML [37]20.0824.4422.2421.7016.1614.3230.0824.52
cmGAN [4]----31.4926.9742.1931.63
BDTR [38]32.7633.5631.9632.9227.3227.3241.8631.92
D²RL [35]44.1043.40--29.2028.90--
AlignGAN [34]53.6057.9053.4056.3040.7042.4054.3045.90
Xmodal [17]60.1862.2161.8068.0650.7349.92--
Hi-CMD [3]66.0470.93--35.9434.94--
cm-SSFT [21]63.0062.20--52.1052.40--
DDAG [39]63.4669.3461.8068.0653.0254.7567.9861.02
Ours67.64 ± 0.0874.17 ± 0.0465.46 ± 0.1872.43 ± 0.4254.14 ± 0.3355.41 ± 0.1866.33 ± 1.2758.46 ± 0.67
+ +Table 2: Comparison of the average runtime for extracting a final person representation and the number of parameters required at test time. + +
MethodsModel size (M)Runtime (ms)
RGBIRRGBIR
AlignGAN [34]30.7124.667.573.32
Hi-CMD [3]52.6352.634.434.43
DDAG [39]40.3240.322.032.03
Ours23.5223.521.901.90
+ +time, while being outperformed by ours in other benchmarks. We can also see that our model achieves better results than $\mathrm{cm - SSFT}^1$ [21] by a significant margin on both datasets. Note that cm-SSFT [21] uses multiple RGB and IR images to extract person representations, even at test time. That is, it exploits additional images of different modalities, e.g., multiple IR images to extract features from an RGB input. cm-SSFT [21] is thus computationally expensive, and requires a lot of memory. Overall, the experimental results on the standard benchmarks demonstrate that our approach provides person representations robust to the cross-modal discrepancies and intra-class variations across RGB and IR images. Qualitative comparisons along with rank-10 accuracy (\%) can be found in the supplementary material. + +Parameter and runtime analysis. We compare in Table 2 the average runtime to extract a final person representation. For fair comparison, we measure the average runtime over 50 executions, for person images of the size $288 \times 144$ on the same machine with a Geforce RTX 2080 + +Table 3: Quantitative comparison for variants of our model on the SYSU-MM01 dataset [36] (All-search mode). + +
\( \mathcal{L}_{\text{IC}} \)\( \mathcal{L}_{\text{DT}} \)ALayermAPrank-1
XX--49.5450.43
✓X-4, 552.8854.44
X✓X4, 550.0850.38
X✓✓4, 551.2351.06
✓✓X4, 552.7853.44
✓✓✓453.0254.63
✓✓✓553.8154.66
✓✓✓4, 554.1455.41
+ +Ti GPU. Table 2 also compares the number of network parameters required at test time. Our method is fastest among the state of the art, and uses the smallest number of parameters, as it does not use any additional parameters, except the ones for a backbone network, at test time. Other methods on the contrary exploit additional layers or networks. + +# 4.3. Discussion + +Ablation study. We show in Table 3 an ablation analysis on training losses and the CMAAlign module. We train variants of our model using different combinations of loss terms, $\mathcal{L}_{\mathrm{IC}}$ and $\mathcal{L}_{\mathrm{DT}}$ , and co-attention map $A$ , while adding CMAAlign modules to different layers of the backbone network. We compare the performance in terms of mAP and rank-1 accuracy on SYSU-MM01 [36] under the all-search mode. For the baseline model in the first row, we exclude the CMAAlign module and train it using the ID loss alone. Overall, we can see that the baseline shows the worst performance, indicating that incorporating the CMAAlign module is beneficial for VI-reID. For example, exploiting the CMAAlign module with either the ID consistency term (the second + +row) or the dense triplet term coupled with the co-attention map (the fourth row) boosts the performance significantly. This is because the ID consistency term mainly addresses cross-modal discrepancies in an image-level and the dense triplet term handles them in a pixel-level, while further enhancing the discriminative power of person representations. From the second, fourth, and last rows, we can observe that using all losses and the co-attention map gives the best results, suggesting that they are complementary to each other. Note that the co-attention map is particularly important for the dense triplet term, as shown in the fifth and last rows. Computing the loss on distinctive regions (e.g., occlusions and background clutter) may hinder learning discriminative representations. We also compare in the last three rows our models involving the CMAAlign modules in different layers of the backbone network, where the modules are added on top of conv4-6 and/or conv5-3 of ResNet50 [10]. We can see that adding the modules to both conv4-6 and conv5-3 gives the best results, as this allows to consider cross-modal discrepancies in multiple levels of features. + +Visualizations of dense correspondences. We show in Fig. 4 examples of cross-modal correspondences between RGB and IR images on SYSU-MM01 [36]. We can see that the matches are established well between persons of the same identity, and they are not influenced by cross-modal discrepancies, appearance variations, and background clutter. Specifically, our model provides local features that are robust against scale variations (Fig. 4(a)) and occlusions (Fig. 4(b)). This implies that our model is able to extract discriminative person representations with rich semantics, which are important for the person reID task, while alleviating the cross-modal discrepancies. In particular, our model offers local features that are robust to viewpoint variations (Fig. 4(c)), where a person's sweatshirt or trousers often matches to its pair regardless of front or side view. This indicates that our network provides local person features that are robust to viewpoint variations, which is particularly useful for VI-reID. This aspect of correspondences for reID is in contrast to typical correspondence tasks, e.g., stereo matching and optical flow estimation, that favor viewpoint-specific matches. We also provide in Fig. 5 a visual comparison of correspondences for different configurations of losses. Our model trained with the ID loss alone is unable to establish reliable matches between cross-modal images and easily distracted by background clutter (Fig. 5(a)), mainly due to cross-modal discrepancies and a lack of discriminative power in local feature representations, particularly for person regions. The ID consistency loss handles the cross-modal discrepancies, establishing correspondences between local person representations from different modalities (Fig. 5(b)). The dense triplet loss further encourages each local feature to be discriminative, which in turn offers matching results focusing on person re + +![](images/60bfc44c3e4ca3ae711d2f06fcc6e1b27e1eb5c974e75f754c943de985bcb9c3.jpg) +(a) Scale variation + +![](images/bb6248ff184d5dad070109fef4854fa3ceb2fe65f9f9bc598b0ca2f36c885b97.jpg) +(b) Occlusion + +![](images/4c3c59d5486ca81262ca0fcedea19cb07394a235eec034e77d63e2ec1e4281bd.jpg) +(c) Viewpoint variation + +![](images/b883c94e5891d88fa070102c89307255af7c8ef8dacc27a90bbc98a75c9b24c9.jpg) +Figure 4: Visualization of correspondences between RGB and IR images on SYSU-MM01 [36]. We show the top 20 matches chosen by matching probabilities. Our local person representations are robust to scale variations (a), occlusion (b), and viewpoint variations (c). (Best viewed in color.) +(a) $\mathcal{L}_{\mathrm{ID}}$ +Figure 5: Visual comparison of correspondences for different configurations of losses: (a) $\mathcal{L}_{\mathrm{ID}}$ ; (b) $\mathcal{L}_{\mathrm{ID}} + \mathcal{L}_{\mathrm{IC}}$ ; (c) $\mathcal{L}_{\mathrm{ID}} + \mathcal{L}_{\mathrm{IC}} + \mathcal{L}_{\mathrm{DT}}$ . Our models in (b-c) exploit CMAAlign modules. ID consistency and dense triplet terms help to alleviate the cross-modal discrepancies between RGB and IR images, while further enhancing the discriminative power of person features. (Best viewed in color.) + +![](images/05216a2572143da6bbd58ba90a8ffd91116604eecc58682e06f2a0bb32c5ce63.jpg) +(b) $\mathcal{L}_{\mathrm{ID}} + \mathcal{L}_{\mathrm{IC}}$ + +![](images/c3ac38a05a0c56ed7ba6fd87544ccaa67d2b64ba8d748e9c43f732d7d75ee7b7.jpg) +(c) $\mathcal{L}_{\mathrm{ID}} + \mathcal{L}_{\mathrm{IC}} + \mathcal{L}_{\mathrm{DT}}$ + +gions (Fig. 5(c)). The features trained by leveraging dense cross-modal correspondences are more discriminative, establishing matches focusing on person regions, while being robust to the cross-modal discrepancies. More examples can be found in the supplementary material. + +# 5. Conclusion + +We have introduced a novel feature learning framework for VI-reID that exploits dense correspondences between cross-modal person images, allowing to learn person representations that are robust to intra-class variations and cross-modal discrepancies across RGB and IR person images. We have also proposed ID consistency and dense triplet losses exploiting pixel-level associations, enabling our model to learn more discriminative person representations. We set a new state of the art on standard benchmarks, outperforming other VI-reID methods by a significant margin. Extensive experimental results clearly demonstrate the effectiveness of our approach. + +Acknowledgements. This research was partly supported by R&D program for Advanced Integrated-intelligence for Identification (AIID) through the National Research Foundation of KOREA (NRF) funded by Ministry of Science and ICT (NRF2018M3E3A1057289), Institute for Information and Communications Technology Promotion (IITP) funded by the Korean Government (MSIP) under Grant 2016-0-00197, and Yonsei University Research Fund of 2021 (2021-22-0001). + +# References + +[1] Cristhian A Aguilera, Francisco J Aguilera, Angel D Sappa, Cristhian Aguilera, and Ricardo Toledo. Learning cross-spectral similarity measures with deep convolutional neural networks. In CVPR Workshop, 2016. 3 +[2] Thomas Brox and Jitendra Malik. Large displacement optical flow: Descriptor matching in variational motion estimation. IEEE TPAMI, 2010. 3 +[3] Seokeon Choi, Sumin Lee, Youngeun Kim, Taekyung Kim, and Changick Kim. Hi-CMD: Hierarchical cross-modality disentanglement for visible-infrared person re-identification. In CVPR, 2020. 1, 3, 6, 7 +[4] Pingyang Dai, Rongrong Ji, Haibin Wang, Qiong Wu, and Yuyu Huang. Cross-modality person re-identification with generative adversarial training. In *IJCAI*, 2018. 1, 3, 6, 7 +[5] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. 6 +[6] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. FlowNet: Learning optical flow with convolutional networks. In ICCV, 2015. 3 +[7] Zhanxiang Feng, Jianhuang Lai, and Xiaohua Xie. Learning modality-specific representations for visible-infrared person re-identification. IEEE TIP, 2019. 1, 2 +[8] Yang Fu, Yunchao Wei, Yuqian Zhou, Honghui Shi, Gao Huang, Xinchao Wang, Zhiqiang Yao, and Thomas Huang. Horizontal pyramid matching for person re-identification. In AAAI, 2019. 2 +[9] Yixiao Ge, Zhuowan Li, Haiyu Zhao, Guojun Yin, Shuai Yi, Xiaogang Wang, et al. FD-GAN: Pose-guided feature distilling GAN for robust person re-identification. In NeurIPS, 2018. 2 +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6, 8 +[11] Mingming He, Dongdong Chen, Jing Liao, Pedro V Sander, and Lu Yuan. Deep exemplar-based colorization. ACM TOG, 2018. 3 +[12] Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. 2, 3, 5, 6 +[13] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. IEEE TPAMI, 2012. 3 +[14] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 5 +[15] Mahdi M Kalayeh, Emrah Basaran, Muhittin Gokmen, Mustafa E Kamasak, and Mubarak Shah. Human semantic parsing for person re-identification. In CVPR, 2018. 2, 4 +[16] Angjoo Kanazawa, David W Jacobs, and Manmohan Chandraker. WarpNet: Weakly supervised matching for single-view reconstruction. In CVPR, 2016. 3 +[17] Diangang Li, Xing Wei, Xiaopeng Hong, and Yihong Gong. Infrared-visible cross-modal person re-identification with an x modality. In AAAI, 2020. 6, 7 + +[18] Wei Li, Xiatian Zhu, and Shaogang Gong. Harmonious attention network for person re-identification. In CVPR, 2018. 2 +[19] Yutian Lin, Liang Zheng, Zhedong Zheng, Yu Wu, Zhilan Hu, Chenggang Yan, and Yi Yang. Improving person re-identification by attribute and identity learning. PR, 2019. 2 +[20] Fangcen Liu, Chenqiang Gao, Yongqing Sun, Yue Zhao, Feng Yang, Anyong Qin, and Deyu Meng. Infrared and visible cross-modal image retrieval through shared features. IEEE TCSVT, 2021. 3 +[21] Yan Lu, Yue Wu, Bin Liu, Tianzhu Zhang, Baopu Li, Qi Chu, and Nenghai Yu. Cross-modality person re-identification with shared-specific feature transfer. In CVPR, 2020. 6, 7 +[22] Hao Luo, Youzhi Gu, Xingyu Liao, Shenqi Lai, and Wei Jiang. Bag of tricks and a strong baseline for deep person re-identification. In CVPR Workshop, 2019. 5, 6, 7 +[23] Jiaxu Miao, Yu Wu, Ping Liu, Yuhang Ding, and Yi Yang. Pose-guided feature alignment for occluded person re-identification. In ICCV, 2019. 2, 4 +[24] Dat Tien Nguyen, Hyung Gil Hong, Ki Wan Kim, and Kang Ryoung Park. Person recognition system based on a combination of body images from visible light and thermal cameras. Sensors, 2017. 6, 7 +[25] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. 2017. 6 +[26] Filip Radenovic, Giorgos Tolias, and Ondrej Chum. Finetuning CNN image retrieval with no human annotation. IEEE TPAMI, 2018. 5 +[27] Aneeshan Sain, Ayan Kumar Bhunia, Yongxin Yang, Tao Xiang, and Yi-Zhe Song. Stylemeup: Towards style-agnostic sketch-based image retrieval. In CVPR, 2021. 3 +[28] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In NeurIPS, 2016. 3 +[29] Patsorn Sangkloy, Nathan Burnell, Cusuh Ham, and James Hays. The sketchy database: learning to retrieve badly drawn bunnies. ACM TOG, 2016. 3 +[30] Florian Schroff, Dmitry Kalenichenko, and James Philbin. FaceNet: A unified embedding for face recognition and clustering. In CVPR, 2015. 6 +[31] Yantao Shen, Tong Xiao, Hongsheng Li, Shuai Yi, and Xiaogang Wang. End-to-end deep kronecker-product matching for person re-identification. In CVPR, 2018. 3 +[32] Yifan Sun, Liang Zheng, Yi Yang, Qi Tian, and Shengjin Wang. Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In ECCV, 2018. 2 +[33] Guanshuo Wang, Yufeng Yuan, Xiong Chen, Jiwei Li, and Xi Zhou. Learning discriminative features with multiple granularities for person re-identification. In ACM MM, 2018. 2 +[34] Guan'an Wang, Tianzhu Zhang, Jian Cheng, Si Liu, Yang Yang, and Zengguang Hou. RGB-infrared cross-modality person re-identification via joint pixel and feature alignment. In ICCV, 2019. 3, 6, 7 +[35] Zhixiang Wang, Zheng Wang, Yinqiang Zheng, Yung-Yu Chuang, and Shin'ichi Satoh. Learning to reduce dual-level + +discrepancy for infrared-visible person re-identification. In CVPR, 2019. 3, 6, 7 +[36] Ancong Wu, Wei-Shi Zheng, Hong-Xing Yu, Shaogang Gong, and Jianhuang Lai. RGB-infrared cross-modality person re-identification. In ICCV, 2017. 1, 2, 4, 5, 6, 7, 8 +[37] Mang Ye, Xiangyuan Lan, Jiawei Li, and Pong C Yuen. Hierarchical discriminative learning for visible thermal person re-identification. In AAAI, 2018. 1, 2, 6, 7 +[38] Mang Ye, Xiangyuan Lan, Zheng Wang, and Pong C Yuen. Bi-directional center-constrained top-ranking for visible thermal person re-identification. IEEE TIFS, 2019. 6, 7 +[39] Mang Ye, Jianbing Shen, David J. Crandall, Ling Shao, and Jiebo Luo. Dynamic dual-attentive aggregation learning for visible-infrared person re-identification. In ECCV, 2020. 1, 3, 6, 7 +[40] Mang Ye, Jianbing Shen, Gaojie Lin, Tao Xiang, Ling Shao, and Steven CH Hoi. Deep learning for person re-identification: A survey and outlook. IEEE TPAMI, 2021. 1, 2, 4 +[41] Mang Ye, Zheng Wang, Xiangyuan Lan, and Pong C Yuen. Visible thermal person re-identification via dual-constrained top-ranking. In *IJCAI*, 2018. 1, 2 +[42] Sergey Zagoruyko and Nikos Komodakis. Learning to compare image patches via convolutional neural networks. In CVPR, 2015. 3 +[43] Jure Zbontar and Yann LeCun. Stereo matching by training a convolutional neural network to compare image patches. JMLR, 2016. 3 +[44] Bo Zhang, Mingming He, Jing Liao, Pedro V Sander, Lu Yuan, Amine Bermak, and Dong Chen. Deep exemplar-based video colorization. In CVPR, 2019. 3 +[45] Zhizheng Zhang, Cuiling Lan, Wenjun Zeng, and Zhibo Chen. Densely semantically aligned person re-identification. In CVPR, 2019. 2 +[46] Zhizheng Zhang, Cuiling Lan, Wenjun Zeng, Xin Jin, and Zhibo Chen. Relation-aware global attention for person re-identification. In CVPR, 2020. 2 +[47] Liang Zheng, Yi Yang, and Alexander G Hauptmann. Person re-identification: Past, present and future. arXiv preprint arXiv:1610.02984, 2016. 1 +[48] Zhedong Zheng, Xiaodong Yang, Zhiding Yu, Liang Zheng, Yi Yang, and Jan Kautz. Joint discriminative and generative learning for person re-identification. In CVPR, 2019. 2 +[49] Zhedong Zheng, Liang Zheng, and Yi Yang. A discriminatively learned CNN embedding for person re-identification. ACM TOMM, 2017. 2 +[50] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In AAAI, 2020. 7 +[51] Tinghui Zhou, Yong Jae Lee, Stella X Yu, and Alyosha A Efros. FlowWeb: Joint image set alignment by weaving consistent, pixel-wise correspondences. In CVPR, 2015. 3 +[52] Kuan Zhu, Haiyun Guo, Zhiwei Liu, Ming Tang, and Jinqiao Wang. Identity-guided human semantic parsing for person re-identification. In ECCV, 2020. 2 \ No newline at end of file diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/images.zip b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..41658ea30478287509c199b6f7c693d8f814a576 --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2439d6fca89620c820115e6db81438a7d02d6b6f5d1da978e6fe16686170315 +size 372827 diff --git a/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/layout.json b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..18d06e175afb5d6401ebf566b584da28f7724986 --- /dev/null +++ b/learningbyaligningvisibleinfraredpersonreidentificationusingcrossmodalcorrespondences/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c66e56f3db8f58da04d730d56fb4a666fb464fd0d30072eb6c9ee223a64b56e +size 391368 diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_content_list.json b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c27ac594d83166a1974488671c2019f6b68d2d9a --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b524a8794732a789c5ed1054dee9278e7a18de9e4df2a310aea642b45c3dc9a1 +size 77081 diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_model.json b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2aedff520b386bc36667a8ad3cc55ddd287d0524 --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:901a8080e7b278d9aa730b32c37ac546dd7b033b43850be070dc37ca08eed476 +size 96832 diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_origin.pdf b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..579eb36a68ff573c40298ea9d9a72d7fc267aeb5 --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/a52a64d2-29b0-4409-8985-64e23b45dcf7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92136c9bdf6b647f4937c27509bcd66f36a57b282b0cb9378c176e0c77aeed0c +size 1199377 diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/full.md b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1e82df55fe3b93af9c690f5c669c4f4bda135123 --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/full.md @@ -0,0 +1,322 @@ +# Learning Conditional Knowledge Distillation for Degraded-Reference Image Quality Assessment + +Heliang Zheng $^{1*}$ , Huan Yang $^{2}$ , Jianlong Fu $^{2}$ , Zheng-Jun Zha $^{1}$ , Jiebo Luo $^{3}$ + +1University of Science and Technology of China, Hefei, China + +$^{2}$ Microsoft Research, Beijing, China + +3University of Rochester, Rochester, NY + +zhenghl@mail.ustc.edu.cn, {huayan, jianf} @microsoft.com, zhazj@ustc.edu.cn, jluo@cs.rochester.edu + +# Abstract + +An important scenario for image quality assessment (IQA) is to evaluate image restoration (IR) algorithms. The state-of-the-art approaches adopt a full-reference paradigm that compares restored images with their corresponding pristine-quality images. However, pristine-quality images are usually unavailable in blind image restoration tasks and real-world scenarios. In this paper, we propose a practical solution named degraded-reference IQA (DR-IQA), which exploits the inputs of IR models, degraded images, as references. Specifically, we extract reference information from degraded images by distilling knowledge from pristine-quality images. The distillation is achieved through learning a reference space, where various degraded images are encouraged to share the same feature statistics with pristine-quality images. And the reference space is optimized to capture deep image priors that are useful for quality assessment. Note that pristine-quality images are only used during training. Our work provides a powerful and differentiable metric for blind IRs, especially for GAN-based methods. Extensive experiments show that our results can even be close to the performance of full-reference settings. + +# 1. Introduction + +Digital images may be subject to various quality degradations during processing, compression, transmission, etc. [36]. And image restoration (IR) algorithms are developed to improve the quality of degraded images [18, 35, 38, 41, 43, 46, 47]. A consequential question is how to assess the quality of restored images and evaluate IR algorithms. The state-of-the-art IQA approaches adopt a full-reference paradigm (FR-IQA), which learns to compare restored images with their corresponding pristine-quality im + +![](images/c0506550ec0ae9ee8210a589ffb47dde8c21b3c0fb776ab8942ce4a1514e9e5d.jpg) + +![](images/ecdfcca81114a091462ccaad4e86886902068de1f20576410ddecf798201122d.jpg) +Figure 1. (a) Pristine-quality images can provide strong reference information for IQA. When pristine-quality images are unavailable, (b) directly regressing restored images to quality scores causes a dramatic drop in performance. To this end, (c) we propose to extract reference information from degraded images and make such a solution effective. FR, NR, DR, S, and SRCC indicate full-reference, no-reference, degraded-reference, quality score, and Spearman's Rank order Correlation Coefficients [30], respectively. + +ages (as shown in Figure 1 (a)). FR-IQA algorithms have been widely adopted as IR evaluation metrics, e.g., PSNR, SSIM [36], and LPIPS [45]. However, they cannot be applied to blind image restoration tasks and real-world applications, where pristine-quality images are unavailable. In this paper, we study the problem of evaluating IR models without relying on pristine-quality images. + +To evaluate IR models without pristine-quality images, no-reference IQA (NR-IQA) methods provide a solution, that is, directly regressing restored images to quality scores, i.e., mean opinion scores (MOS) [2, 13, 20, 32]. However, the absence of reference information makes the problem much more challenging and causes a dramatic drop in performance, e.g., 0.1409 SRCC (Spearman's Rank order Correlation Coefficients [30]) drops. This motivates us to seek available reference information. We find that the in + +puts of IR models (i.e., degraded images) are usually free to be obtained, and it has been verified that degraded images also contain useful image priors like pristine-quality images for solving under-constrained problems in computer vision [25, 33]. To this end, we propose a new solution named degraded-reference IQA (DR-IQA). However, directly replacing the pristine-quality references of existing FR-IQA models [5] by degraded references causes 0.1239 SRCC drops, because the noises involved by various degradations make it difficult to mine and leverage reference information from degraded images. + +To leverage degraded images and improve the effectiveness of DR-IQA, we propose a Conditional Knowledge Distillation Network (CKDN). As shown in Figure 2, CKDN consists of three modules, i.e., a degradation-tolerant embedding module (DTE), a quality-sensitive embedding module (QSE), and a convolutional score predictor (CSP). The DTE is the key module, which aims to effectively extract reference information for IQA from degraded images. Specifically, it learns a reference space, where various degraded images are optimized to share the same feature statistics with pristine-quality images. Such space is learned in the condition of conducting quality assessments with the QSE and CSP, where the QSE learns discriminative features from restored images, and the CSP maps feature differences to human-annotated scores. Moreover, we find that pre-training such conditions can help to learn quality-sensitive features and further advance the optimization of the reference space. In particular, we propose a relative score regression task that can enlarge the space of training data by creating data pairs. + +We conduct extensive experiments to evaluate our proposed solution. It is shown that our proposed CKDN enables DR-IQA to achieve comparable performance to the full-reference setting on various IR tasks, e.g., traditional/GAN-based super-resolution, de-noising, etc. Moreover, we further study the influence of reference quality and the performance of current IQA methods on evaluating different IR tasks. We draw three conclusive insights: 1) our CKDN works well with a large range of degradation types, 2) reference images are extremely important for evaluating GAN-based images, and 3) current IQA methods can provide around $85\%$ reliable judgments for evaluating IR algorithms. Please refer to Section 5 for more details. Our main contributions can be summarized as follows: 1) To the best of our knowledge, we are the first to leverage degraded images for IQA. 2) We formulate this practical setting and propose an effective conditional knowledge distillation network to solve this problem. 3) Extensive analyses show that degraded references are of great help for evaluating GAN-based images. Overall, we believe our work would contribute to the IQA and the blind SR communities, and providing insights for evaluating GAN-based models. + +# 2. Related Work + +No-reference Image Quality Assessment. NR-IQA aims to predict the perceived quality of distorted images without referring to pristine-quality images. Getting rid of reference images makes such a setting more practical in many applications and therefore receives more and more attention in recent years. Early works in the literature of NR-IQA proposed to model statistics of natural images and regress parametric deviations to image degradations [22, 23, 29]. In recent years, deep neural networks (DNNs) show promising capacity and are leveraged to fit distorted images to quality scores for NR-IQA [2, 13, 20, 32]. Considering the problem of limited training data, dipIQ proposed to learn-to-rank large-scale unlabeled image pairs in a self-supervised manner [19]. Inspired by FR-IQA, Hallucinated-IQA proposed to compare the distorted images to hallucinated references, which are restored from the distorted images by adversarial training [3, 17, 28]. And some researchers also propose to generate a quality map for NR-IQA [24]. There are three differences compared to these works: 1) Compared to hallucinated references that generated from assessed images, degraded references are independent of assessed images and can provide additional information. 2) Previous works use a handcraft space (i.e., RGB image/SSIM map), while we learn deep embeddings end-to-end. 3) previous works try to "distill" all the information instead of only reference information for IQA. + +Full-reference Image Quality Assessment. The full-reference setting significantly simplifies the IQA problem by converting it to two sub-problems, i.e., calculating the distance between restored and reference images and mapping such distance to quality scores [21, 36, 37, 44]. Here we mainly review the full-reference IQA methods that have been widely used to evaluate IR models [36, 45]. PSNR and SSIM [36] are appealing because they are simple to calculate and have clear physical meanings. But they do not correlate well with perceived visual quality [5, 27, 45], especially for evaluating the images generated by GANs [4]. LPIPS [45] analyzed the unreasonable effectiveness of deep features as a perceptual metric, which has been adopted by more and more IR models as a perceptual metric [7, 18]. And SWDN further improves LPIPS by taking the spatial misalignment for GAN-based distortion into consideration [5, 6]. Different from FR-IQA, our proposed DR-IQA only requires degraded images as reference, and we proposed a Conditional Knowledge Distillation Network to leverage deep image priors from the degraded images. Note that our proposed DR-IQA is also different from traditional reduced-reference IQA (RR-IQA), which extracts predefined features, such as frequency domain coefficients and image gradients, as references under the scenario of visual communication systems [16, 34]. + +![](images/e8c257ca0149d8c9bbde1d91430868b35eaab0519e6d8b5fe9a9120f5c152b8d.jpg) +Figure 2. Overview of the proposed Conditional Knowledge Distillation Network (CKDN). CKDN consists of three components, i.e., a degradation-tolerant embedding module (DTE) in (b), a quality-sensitive embedding module (QSE) in (d), and a convolutional score predictor (CSP) in (e). The DTE embeds the degraded image in (a) to a reference space in (h) by optimizing a conditional knowledge distillation (CKD) loss. Such a loss learns reference information from pristine-quality images in (g) and minimizes the difference between the features of degraded and pristine-quality images. Note that the QSE and CSP provide conditions to learn the reference space, and the learned representation of degraded images provides reference information for IQA. + +# 3. Approach + +In this section, we will introduce the setting of DR-IQA and our proposed model for DR-IQA. Our model takes as input a degraded image in Figure 2 (a) (i.e., the input of IR models) and a restored image in Figure 2 (c) (i.e., the output of IR models), and aims to predict a quality score for the restored image in Figure 2 (f). Similar to FR-IQA, the basic idea is to compare the restored image to the reference and further map the learned difference to a quality score. However, the reference images in DR-IQA are noisy due to degradations. To solve this problem, we propose to learn a reference space in Figure 2 (h) to capture deep image priors that are useful for quality assessment. In particular, our proposed Conditional Knowledge Distillation Network (CKDN) consists of a degradation-tolerant embedding module (DTE) in Figure 2 (b), a quality-sensitive embedding module (QSE) in Figure 2 (d), and a convolutional score predictor (CSP) in Figure 2 (e). We propose a conditional knowledge distillation (CKD) loss to guide the learning of the reference space. Moreover, we propose a relative score regression loss to pre-train the QSE (shown in Figure 4). We will introduce the details in the following. + +# 3.1. Formulations + +Formulation of DR-IQA. Given a pristine-quality image $\mathbf{H}$ ; the degraded image can be denoted as $\mathbf{D}$ ; image restoration (IR) algorithms can be applied to obtain restored images, i.e., $\mathbf{R}$ ; and the human annotated quality score, i.e., mean opinion score (MOS) can be denoted as $s$ . In the training phase, all of these $\{\mathbf{H}, \mathbf{D}, \mathbf{R}, s\}$ are available. While in + +the testing phase, the model takes as input only $\{\mathbf{D},\mathbf{R}\}$ and predicts the quality score $s$ + +Formulation of CKDN. CKDN consists of three modules, i.e., a degradation-tolerant embedding module (DTE), a quality-sensitive embedding module (QSE), and a convolutional score predictor (CSP), which are denoted as $\mathcal{E}_1$ , $\mathcal{E}_2$ , $S$ , respectively. We can obtain the quality score by: + +$$ +s = \mathcal {S} \left(\mathcal {E} _ {1} (\mathbf {D}) - \mathcal {E} _ {2} (\mathbf {R})\right), \tag {1} +$$ + +where $\mathbf{D},\mathbf{R}$ , and $s$ are the degraded image, restored image, and quality score of the restored image, respectively. + +Special designs of CKDN for DR-IQA. Compared to the state-of-the-art FR-IQA models [27, 45], the proposed CKDN has two advantages for the DR-IQA problem (as shown in Figure 3). 1) FR-IQA models extract the restored image features and reference features with the same parameters, while our CKDN learns task-specific embeddings (i.e., the DTE and QSE). 2) FR-IQA models focus on extracting feature difference, while we pay more attention (by stacking residual blocks in the CSP) to mapping feature difference to quality scores. Such designs can better handle the degradation of reference images. + +# 3.2. Learning quality-sensitive embedding + +Learning quality-sensitive features for restored images is important for image quality assessment. We propose to learn a quality-sensitive embedding (QSE) to extract such discriminative features. Regressing absolute quality scores is the most intuitive loss function to optimize the QSE, i.e., + +![](images/67dfcb3c80f6aa81700b2c5117465d34facaafa0d751b36f3620dbf212bfa212.jpg) +Figure 3. Comparison of (a) FR-IQA models and (b) DR-IQA model (CKDN). FR-IQA models focus on calculating difference between restored and reference images, while DR-IQA requires 1) different embeddings for restored and reference images and 2) convolutional layers for mapping feature difference to scores. + +training the model to fit the input data $\{\mathbf{D},\mathbf{R}\}$ to the absolute quality score $s$ . Specifically, we minimize the Mean Square Error (MSE) for such a regression problem: + +$$ +L _ {a} = \frac {1}{N} \sum_ {i} \| s _ {i} - \mathcal {S} (\mathcal {E} _ {1} (\mathbf {D}) - \mathcal {E} _ {2} (\mathbf {R} _ {i})) \| _ {2} ^ {2}, \tag {2} +$$ + +where $N$ is the number of training images. Note that in this paper, we show the case of single content with single degradation for simplicity. + +# 3.3. Learning degradation-tolerant embedding + +In this subsection, we will introduce how to learn the DTE, which is the key module of our model. The DTE is supposed to capture reference information from degraded images. Our basic idea is to learn reference information from pristine-quality images and use the learned knowledge to guide the learning of DTE. To achieve this, we propose a conditional knowledge distillation loss and design an effective pre-training method. + +Conditional knowledge distillation. Knowledge distillation is powerful tool for feature learning [11, 39, 48, 49]. Our extended conditional knowledge distillation leverages restored images as context information (condition), which is important in various vision tasks [40, 42]. Equation 2 shows the basic objective function for learning CKDN. Let us consider training CKDN in a full-reference setting: + +$$ +L _ {a} ^ {H} = \frac {1}{N} \sum_ {i} \| s _ {i} - \mathcal {S} ^ {H} \left(\mathcal {E} _ {1} ^ {H} (\mathbf {H}) - \mathcal {E} _ {2} ^ {H} (\mathbf {R} _ {i})\right) \| _ {2} ^ {2}, \tag {3} +$$ + +where $L_{a}^{H}$ , $\mathcal{E}_1^H (\cdot)$ , $\mathcal{E}_2^H (\cdot)$ , and $S^H (\cdot)$ denote the score regression loss, degradation-tolerant embedding module, quality-sensitive embedding module, and the convolutional score predictor that trained with pristine-quality images. + +Compared to degraded images, it is much easier to learn deep image priors for IQA from pristine-quality images, i.e., $\mathcal{E}_1^H (\mathbf{H})$ is supposed to be better than $\mathcal{E}_1(\mathbf{D})$ . Such an observation motivates us to guide the learning of $\mathcal{E}_1(\mathbf{D})$ by + +![](images/aebab4eafd34fdcd7225d2aea3491108cc920ceeb26f30aba4070333784f081a.jpg) +Figure 4. An illustration of pre-training the QSE by the proposed relative score regression loss. + +$\mathcal{E}_1^H (\mathbf{H})$ . Specifically, our proposed conditional knowledge distillation loss can be denoted as: + +$$ +\begin{array}{l} L _ {c k d} = L _ {a} + L _ {a} ^ {H} + \lambda \left\| \mathcal {E} _ {1} ^ {H} (\mathbf {H}) - \mathcal {E} _ {1} (\mathbf {D}) \right\| _ {2} ^ {2}, \tag {4} \\ s. t., \quad \mathcal {E} _ {2} ^ {H} = \mathcal {E} _ {2}, \quad \mathcal {S} ^ {H} = \mathcal {S}, \\ \end{array} +$$ + +where $L_{ckd}$ is the conditional knowledge distillation loss. $L_{a}$ , and $L_{a}^{H}$ are the score regression loss, which are shown in Equation 2 and Equation 3, respectively. $\lambda$ is the loss weight. $\mathcal{E}_2^H = \mathcal{E}_2$ , and $S^H = S$ are the constraints. Note that such constraints are essential to achieve effective distillation for DR-IQA, which can ensure $\mathcal{E}_1(\mathbf{D})$ and $\mathcal{E}_1^H (\mathbf{H})$ to be in the same latent space. In other words, the learning of embeddings for pristine-quality and degraded images should be in the same condition. + +Pre-training for conditional knowledge distillation. The objective function in Equation 4 can be applied to train the CKDN in an end-to-end manner, where the parameters are initialized by ImageNet [14] pre-trained parameters. Taking one step further, we study how the condition in Equation 4 influences the knowledge distillation performance. We find that pre-training the QSE, i.e., $\mathcal{E}_2$ , can advance the optimization and achieve better performance. That is, before training the CKDN by Equation 4, we first learn the QSE by a relative score regression loss. Specifically, we train the model by comparing two restored images, e.g., $\mathbf{R_i}$ , $\mathbf{R_j}$ , and regressing the possibility of $s_i > s_j$ . Such loss can be denoted as: + +$$ +L _ {r} = \frac {1}{N} \sum_ {i, j} \| \Pr \left(s _ {i} > s _ {j}\right) - \mathcal {S} \left(\mathcal {E} _ {2} \left(\mathbf {R} _ {i}\right) - \mathcal {E} _ {2} \left(\mathbf {R} _ {j}\right)\right) \| _ {2} ^ {2}, \tag {5} +$$ + +where $N$ is the number of training pairs, $\operatorname{Pr}(s_i > s_j)$ can be obtained by $\operatorname{Pr}(s_i > s_j) = 1 / (1 + 10^{(s_j - s_i) / M})$ [5], $M$ is a dataset-specific parameter of the distribution, and $M = 400$ in the dataset we used. + +We call such training stage "pre-training" because the relative score regression loss enlarges the training data by creating pairs. And the pre-trained QSE can provide a better condition for the subsequent knowledge distillation. + +Comparisons to previous work. We analyze the difference between our proposed conditional knowledge dis + +Table 1. The details of the subset of PIPAL [5] dataset that used in our experiments. # IR indicates the number of IR models and settings, and #Img means the number of distorted images. + +
IR tasksSub-tasks# IR#Img
SR(a) interpolation(b) traditional SR(c) PSNR-oriented SR(d) GAN-based SR6212,400
Denoise(e) mean filtering(f) traditional denoising(g) Deep Denoising132,600
Mixture(h) noisy images SR(i) SR after denoising(j) SR after decompression142,800
+ +tillation and previous arts, e.g., data augmentation, vanilla knowledge distillation [11], and hallucinated reference [17]. + +The data augmentation method adds the $\{\mathbf{H},\mathbf{R_i}\}$ pair to training data, which would improve the generality of the model. Such a strategy can be regarded as an indirect knowledge distillation in a parameter-sharing manner. + +The vanilla knowledge distillation method optimizes the model by Equation 4 without additional constraints. Such a strategy distills unaligned feature distributions from the teacher network (trained with pristine-quality images) to the student network (trained with degraded images). + +Hallucinated reference methods can be applied to DR-IQA by generating hallucinated references from the degraded images, and use the generated reference to conduct IQA. Such a solution tries to "distill" all the information from pristine-quality images to degraded images. + +Compared to data augmentation and vanilla knowledge distillation, our method is more direct and effective with well-aligned features. And compared to hallucinated reference methods, our selectively feature distillation is easier to learn as it is an ill-posed problem to recover all information from degraded images to pristine-quality images. + +# 4. Experiments + +# 4.1. Experiment setup + +Datasets. We evaluate our model on the Perceptual Image Processing ALgorithms dataset (PIPAL) [5], which is the largest IQA dataset with 1.13 million human annotations. PIPAL contains two types of images which are traditional distorted images (e.g., JPEG compression, noise, spatial warping, etc.) and images restored by IR algorithms. Since our proposed IQA method is designed for evaluating IR algorithms, we remove the traditional distorted images and use a subset of the released PIPAL, which contains three important image restoration tasks (i.e., super-resolution, denoising, and mixture restoration). We split training and validation sets in a manner that is consistent with the real-world + +Table 2. Comparisons to previous works. We implement FR-IQA models to our DR-IQA setting, $\uparrow$ indicates the higher the better. + +
MethodsSRCC↑PLCC↑
NR-IQADIQaM [2]0.62550.6019
NIMA [32]0.63300.6540
Hall-IQA [17]0.63900.6167
MEON [20]0.64360.6610
DR-IQAPSNR0.32310.3516
SSIM [36]0.35730.3509
PieAPP [27]0.65630.5937
LPIPS [45]0.66500.5872
SWDN [5]0.67290.6052
CKDN (Ours)0.76690.7514
+ +scenario for developing novel IR algorithms. Specifically, we randomly split 200 reference images into 175 training images and 25 validation images, which can ensure us to validate our model on unseen image contents. Moreover, we further split 89 IR algorithms into 50 algorithms for training and 39 algorithms for validation, which can ensure validating on unseen algorithms. Note that we split old algorithms for training and recent algorithms for validation. More details can be found in Table 1. + +Evaluation metrics. We follow previous works [2, 5, 20], to use two most widely obtained IQA metrics, i.e., Spearman's Rank order Correlation Coefficients (SRCC) [30] and Pearson Linear Correlation Coefficients (PLCC). SRCC evaluates the monotonicity of two lists, i.e., whether the order of predicted scores is consistent with human-annotated orders. And PLCC considers both orders and values. + +Baselines. We compared our method to previous methods in image quality assessment, including both NR-IQA and FR-IQA methods. In the following, the first four methods are NR-IQA models, and the latter five are FR-IQA models. We compare to them, due to their state-of-the-art performance and high relevance. + +- DIQaM [2]: Propose to jointly learn the local quality and local weights, i.e., the relative importance of local quality to the global quality estimate. +- MEON [20]: Formulate the NR-IQA to a multi-task training problem, i.e., a distortion identification task and a quality prediction task. +- NIMA [32]: Propose to predict the distribution of MOS and introduced an EMD-based loss that penalizes misclassifications based on class distances. +- Hall-IQA [17]: Propose to compare the distorted images to hallucinated references, which are restored from the distorted images by GAN. +- PSNR: Peak signal-to-noise ratio (PSNR) is an extension of mean square error (MSE), which further considers the ratio between the signal and noise. + +Table 3. Ablation experiments for main components. + +
MethodsSRCC↑PLCC↑
FR model [5]0.67290.6052
CKDN0.71270.6606
CKDN + CKD0.75490.7473
CKDN + CKD + Pret.0.76690.7514
FR upper bound0.79220.8233
+ +Table 4. Ablation experiments on conv. blocks w/o CKD. + +
MethodsConv. blocksSRCC↑PLCC↑
FR model [5]VGG0.67290.6052
CKDN (Ours)VGG0.70060.6420
CKDN (Ours)Residual0.71270.6606
+ +- SSIM [36]: The structural similarity index measure (SSIM) considers image degradation as a perceived change in structural information. +- PieAPP [27]: Perceptual Image-Error Assessment through Pairwise Preference (PieAPP) proposed a pairwise-learning framework. +- LPIPS [45]: Learned Perceptual Image Patch Similarity (LPIPS) proposed to use a learned weighted sum of deep features as a perceptual metric. +- SWDN [5]: Space Warping Difference IQA Network (SWDN) proposed to consider the robustness of spatial misalignment, especially for GAN-based distortions. + +Implementation details. We follow previous work [5] and set the input image resolution to $288 \times 288$ . The learning rate is set to 0.15, and we use a constant learning rate strategy with a warm-up. We first train 10 epochs to initialize the quality-sensitive embedding, and then we train the CKDN by 20 epochs. We find the loss weight $\lambda$ in Equation 4 is robust to optimization, which is empirically set to 10. All the distortions are combined during training, and our model is trained end-to-end. The model size is 103MB and the training memory is 6.8GB (the batch size is 8 per GPU). We use PyTorch [26] as our codebase. Our CKDN is efficient, and each experiment can be finished in 30 minutes on 8 Tesla V100 GPUs. + +Architectures of CKDN. We implement the two embeddings, i.e., the DTE and QSE, by a convolutional layer and three residual blocks [10]; and we implement the convolutional score predictor by four residual blocks and three fully connected layers. Note that although the DTE and QSE share the same architecture, their training strategies are different and specifically designed. + +# 4.2. Comparisons + +To evaluate our proposed CKDN, we implement the methods proposed for both NR-IQA and FR-IQA tasks. Specifically, for NR-IQA models, we only use the restored images for validation; and for FR-IQA models, we keep the same setting as our model and used the degraded im + +Table 5. Ablation experiments on model architectures. + +
EmbeddingFeature sizeSRCC↑PLCC↑
Shared72 × 720.73110.6926
Unshared36 × 360.74360.7387
Unshared18 × 180.72340.7176
Unshared72 × 720.76690.7514
+ +Table 6. Ablation experiments on knowledge distillations. + +
MethodsSRCC↑PLCC↑
w/o distillation0.71270.6606
Data augmentation0.74690.7087
Hallucinated reference0.73480.7087
Knowledge distillation0.73380.7093
Conditional knowledge distillation0.76690.7514
+ +ages as references. We train and validate all the models on the same train/validation split to keep the comparison fair. The results can be found in Table 2. It can be observed that our proposed CKDN outperforms all previous works with a clear margin, which yields the best solution when pristine-quality images are not available. PSNR and SSIM cannot work well with degraded references as the distance calculated by these methods are not robust for degradations. Moreover, without well-designed mechanisms for degraded reference, FR-IQA models cannot leverage such information and can only slightly outperform NR-IQA models in the term of SRCC. FR-IQA models even perform worse in the term of PLCC. Since PLCC is influenced by the value of scores, different reference images (e.g., $2 \times$ and $4 \times$ downsampled LR images) would cause disturbances and be considered as noises. However, with our proposed method, the degraded images can be leveraged to achieve 0.0940 SRCC gains compared to the state-of-the-art model [5]. + +# 4.3. Ablation Studies + +Main components. We evaluate the main components of our proposed CKDN in Table 3. It can be observed that our proposed backbone works well for DR-IQA, which outperforms previous FR models by 0.0398 SRCC. Moreover, the proposed conditional knowledge distillation mechanism can further boost the performance by 0.0422 SRCC, which demonstrates the effectiveness of guiding DTE by pristine-quality images. Our proposed pre-training method can improve more than 0.01 SRCC, which makes our DR setting's performance close to the full reference upper bound. + +Model architectures. We study core techniques for model design in Table 5. Sharing parameters for the quality-sensitive embedding and the degradation-tolerant embedding would cause 0.0358 SRCC drops, which show the necessity of learning unshared embeddings. Moreover, we want to emphasize that the spatial information of feature difference is important, which is ignored by FR-IQA models. Specifically, by down-sampling the input feature of + +Table 7. Ablation experiments on pre-training in the term of SRCC. "Pret." indicates pre-training. + +
Epochs571015
ImageNet Pret.0.75490.75490.75490.7549
LaPret.0.75610.75740.75360.7543
LrPret.0.75870.76290.76690.7643
+ +Table 8. Extensive experiments for robustness evaluation by different train/validation splits (SRCC). + +
Train/VAL SplitBaselineOursFR setting
50 train + 39 val0.67290.76690.7922
54 train + 35 val0.68840.77940.8011
59 train + 30 val0.65610.76970.7943
+ +CSP, we can observe 0.0233 SRCC drops. Last but not least, Table 4 shows that it is the formulation of CKDN that matters and the influence of specific architectures (e.g., residual or VGG [31] blocks) are marginal. + +Knowledge distillation. Table 6 shows the effectiveness of different knowledge distillation methods. As analyzed in Section 3, our proposed conditional knowledge distillation can more effectively distill useful information for quality assessment into the degradation-tolerant embedding. We find that hallucinated references even bring a performance drop, which would be caused by involving feature noises when restoring the hallucinated references. + +Pre-training methods. Table 7 shows how different pretraining methods (pre-trained by different loss with different epochs) influence the performance. It can be observed that the proposed relative score regression loss performs better than the absolute score regression loss and ImageNet pre-training. Such improvements show the effectiveness of training on highly related tasks with enlarged pairwise data. + +Robustness on train/validation splits. We further explored how train/validation splits influence the effectiveness of the proposed methods. First, we study various train/validation splits from the aspect of image contents. We find that different train/validation splits lead to comparable performance (within 0.01 SRCC). Moreover, we study three different train/validation splits from the aspect of distortion types. The results can be found in Table 8, where the "Baseline" indicates SWDN [5]. It can be observed that our proposed method can achieve consistent improvements on all three settings, and are close to the performance achieved by using pristine-quality images. + +CKDN can improve SR algorithms as a loss term. Specifically, we follow the setting of NTIRE 2020 challenge winner [12], i.e., use DIV8K [9] dataset and obtain LPIPS [45] as a metric. The results (85k iterations) can be found in Table 9. It can be observed that our CKDN can improve the SR performance. We only conduct experiments on the above settings, and more extensive experi + +Table 9. CKDN can be used as a loss term. "Baseline" and "VGG" indicate ESRGAN [35] and Perceptual Loss, respectively. + +
MethodBaselineBaseline + VGGBaseline + CKDN
LPIPS ↓0.53800.50390.4957
+ +Table 10. Experiments on cross dataset evaluation. 2AFC scores are the original metric of BAPPS [45]. + +
ReferenceFR-IQA (LPIPS)×2 LR×4 LR
2AFC scores ↑69.8069.7168.98
Reference×8 LRL25 noiseL50 noise
2AFC scores ↑68.3868.5867.63
+ +Table 11. The results in practice: use CKDN as a SR metric. The results are in the format of PI $\downarrow$ /LPIPS $\downarrow /\left( {1 - \mathrm{{CKDN}}}\right) \downarrow$ . + +
MethodSet5Set14BSD100
Bicubic7.36/0.34/0.487.02/0.43/0.417.00/0.52/0.51
SRGAN3.98/0.08/0.403.08/0.16/0.352.54/0.19/0.43
SPSR3.27/0.06/0.362.90/0.13/0.322.35/0.16/0.40
+ +ments would be conducted in future work. + +CKDN can generalize well across datasets. We test our model on an unseen dataset BAPPS [45], and Table 10 shows that our model can achieve comparable performance even with degraded references and without fine-tuning. + +CKDN can help in practice. In Table 11, we replace subjective image quality experiments from the state-of-the-art SPSR [18]. The baseline is SRGAN [15]. CKDN delivers the same conclusion as PI [1] and LPIPS [45]. We also find some inconsistent results, when evaluating comparable IR algorithms. And this problem would be further studied in the future. + +# 5. Discussions + +In this section, we conduct extensive experiments and detailed analyses to 1) evaluate the robustness of CKDN, 2) show the extreme effectiveness of reference images for evaluating images generated by GANs, and 3) provide an intuitive comprehension of how well current IQA models can be used as IR metrics. + +The proposed method works well on degraded references with a large range of degradation types. We proposed to use IR inputs, i.e., degraded images, to help to assess the quality of restored images, which is practical in real-world scenarios. We further studied using the same degraded image (e.g., $4\times$ downsampled LR image) as a reference for assessing all the restored (e.g., SR, Denoised) images. Such a setting is not practical, while it can intuitively show the influence of reference quality on IQA performance. The results can be found in Table 12 and an illustration can be found in Figure 5. We choose the most common 5 degradations in the dataset. It can be observed that the proposed method performs well with a large range of degradation, e.g., $2\times$ downsample, $4\times$ downsam + +![](images/320e562092ffb96127853235a3a81f07e462a297bee7a60f8828935406c1f7b6.jpg) +8x Downsampled LR Image (↑0.0591) + +![](images/739ef242a7587a11ded59c933dc4f845a0bab0e5c5a40c9fb883d382d0d47a8d.jpg) +Gaussian noise, Level: 50 (↑0.1289) + +![](images/c85273c6d7ea2aea835a202ba9d2b8b1525cec8e0f808a3be406ceb55a7dd8c7.jpg) +JPEG compression, Q: 10 (↑0.1331) +Figure 5. An illustration of the SRCC improvements obtained by different types of reference images. The percentage numbers marked in green is the SRCC improvements compared to no-reference settings. + +![](images/ee974f1978eb1591a060b0cda84b8b72287b54ea49c473a4638fd34969621bf9.jpg) +Pristine-quality Image (↑0.1409) + +Table 12. Extensive experiments on how the quality of reference images influence IQA performances. + +
ReferenceSRCC↑PLCC↑
NR baseline0.65130.6312
LR images2×0.78590.8286
4×0.76390.7806
8×0.71040.7251
Gauss. noiseLevel: 250.78880.8291
Level: 500.78020.8190
JPEGQ: 300.79110.8239
Q: 100.78440.8288
IR inputs (our DR setting)0.76690.7514
FR upper bound0.79220.8233
+ +ple, Gaussian noise with levels: 25 and 50, JPEG compression with quality of 30 and 10. The performance dropped on the $8 \times$ downsample setting, while still outperforms the no-reference setting by 0.0591 SRCC. + +Reference images is extremely important for evaluating images generated by GANs. Evaluating GAN-based IR models attracts lots of attention in recent years [8, 5, 45] as the artifacts generated by GANs yield new challenges for IQA. We study the performance of our model on GAN-based images in Table 13 and find introducing reference (e.g., full reference or degraded reference) can significantly benefit assessing GAN-based images (with 0.3101 SRCC gains). Such a result is reasonable as the textures generated by GANs may confuse NR-IQA models on distinguishing the artifacts and image contents. Thus reference images can provide strong guidance to disentangle quality-sensitive factors from image contents. + +Current IQA methods can provide around $85\%$ reliable judgments when they are adopted as IR metrics. We provide an intuitive comprehension of how well current IQA models can be used as IR metrics. In particular, we use IQA models to compare IR algorithms under the same task and setting (e.g., the $\times 4$ SR task by GAN) and calculate the accuracy of the predicted judgments. We train all the settings by the same backbone, i.e., our CKDN, for fair comparisons. The results in Table 13 show that the accuracy of + +Table 13. Extensive experiments on evaluating GAN-based images by SRCC and accuracy. Accuracy: we use IQA models to compare the output images of two IR algorithms (which one is better), and calculates the percentage of right judgments (the same as human judgments). $\uparrow$ indicates the higher the better. + +
MetricsNR-IQADR-IQAFR-IQA
SRCC↑0.40810.71820.7560
Accuracy ↑0.68530.85070.8580
+ +the FR-IQA setting is around $85\%$ , which means $85\%$ preferences of the IQA model are consistent with human judgments. Moreover, DR-IQA can achieve comparable results with the FR-IQA setting, while the NR-IQA setting causes $17.27\%$ accuracy drops. + +# 6. Conclusion + +In this paper, we study the problem of evaluating IR models without pristine-quality images. We present a degraded-reference solution (DR-IQA) that introduces IR inputs to boost the quality assessment performance. We find it is nontrivial to leverage degraded images as reference, and by learning a Conditional Knowledge Distillation Network (CKDN), promising performance can be achieved. We have conducted extensive evaluations to demonstrate the effectiveness of our proposed method. Moreover, we draw three valuable conclusions about IQA and IR metrics: 1) our CKDN works well with a large range of degradation types, 2) reference images are extremely important for evaluating GAN-based images, and 3) current IQA methods can provide around $85\%$ reliable judgments for evaluating IR algorithms. In the future, we will focus on 1) extending our model to evaluate other conditional GAN tasks (e.g., in-painting, and semantic segmentation to images), and 2) further studying the problem of using our model as a loss/metric for IR algorithms. + +# 7. Acknowledgement + +This work was supported by the National Key R&D Program of China under Grand 2020AAA0105702, National Natural Science Foundation of China (NSFC) under Grants U19B2038, the University Synergy Innovation Program of Anhui Province under Grants GXXT-2019-025. + +# References + +[1] Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In CVPR, pages 6228-6237, 2018. +[2] Sebastian Bosse, Dominique Maniry, Klaus-Robert Müller, Thomas Wiegand, and Wojciech Samek. Deep neural networks for no-reference and full-reference image quality assessment. TIP, 27(1):206-219, 2017. +[3] Diqi Chen, Yizhou Wang, and Wen Gao. No-reference image quality assessment: An attention driven approach. TIP, 29:6496-6506, 2020. +[4] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, pages 2672-2680, 2014. +[5] Jinjin Gu, Haoming Cai, Haoyu Chen, Xiaoxing Ye, Ren Jimmy S, and Chao Dong. PIPAL: A large-scale image quality assessment dataset for perceptual image restoration. In ECCV, pages 633-651, 2020. +[6] Jinjin Gu, Haoming Cai, Haoyu Chen, Xiaoxing Ye, Jimmy Ren, and Chao Dong. Image quality assessment for perceptual image restoration: A new dataset, benchmark and metric. arXiv preprint arXiv:2011.15002, 2020. +[7] Jinjin Gu and Chao Dong. Interpreting super-resolution networks with local attribution maps. In CVPR, 2021. +[8] Shuyang Gu, Jianmin Bao, Dong Chen, and Fang Wen. GIQA: Generated image quality assessment. In ECCV, pages 369-385, 2020. +[9] Shuhang Gu, Andreas Lugmayr, Martin Danelljan, Manuel Fritsche, Julien Lamour, and Radu Timofte. DIV8K: Diverse 8k resolution image dataset. In ICCVW, pages 3512-3516, 2019. +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. +[11] Geoffrey Hinton, Oriol Vinyls, and Jeff Dean. Distilling the knowledge in a neural network. In NeurIPSW, 2014. +[12] Younghyun Jo, Sejong Yang, and Seon Joo Kim. Investigating loss functions for extreme super-resolution. In CVPRW, pages 424-425, 2020. +[13] Le Kang, Peng Ye, Yi Li, and David Doermann. Convolutional neural networks for no-reference image quality assessment. In CVPR, pages 1733-1740, 2014. +[14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, volume 25, pages 1097-1105, 2012. +[15] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative adversarial network. In CVPR, pages 4681-4690, 2017. +[16] Qiang Li and Zhou Wang. Reduced-reference image quality assessment using divisive normalization-based image representation. JSTSP, 3(2):202-211, 2009. +[17] Kwan-Yee Lin and Guanxiang Wang. Hallucinated-IQA: No-reference image quality assessment via adversarial learning. In CVPR, pages 732-741, 2018. + +[18] Cheng Ma, Yongming Rao, Yean Cheng, Ce Chen, Jiwen Lu, and Jie Zhou. Structure-preserving super resolution with gradient guidance. In CVPR, pages 7769-7778, 2020. +[19] Kede Ma, Wentao Liu, Tongliang Liu, Zhou Wang, and Dacheng Tao. dipIQ: Blind image quality assessment by learning-to-rank discriminable image pairs. TIP, 26(8):3951-3964, 2017. +[20] Kede Ma, Wentao Liu, Kai Zhang, Zhengfang Duanmu, Zhou Wang, and Wangmeng Zuo. End-to-end blind image quality assessment using deep neural networks. TIP, 27(3):1202-1213, 2017. +[21] Rafal Mantiuk, Kil Joong Kim, Allan G Rempel, and Wolfgang Heidrich. HDR-VDP-2: A calibrated visual metric for visibility and quality predictions in all luminance conditions. TOG, 30(4):1-14, 2011. +[22] Anish Mittal, Anush K Moorthy, and Alan C Bovik. No-reference image quality assessment in the spatial domain. TIP, 21(12):4695-4708, 2012. +[23] Anish Mittal, Rajiv Soundararajan, and Alan C Bovik. Making a "completely blind" image quality analyzer. IEEE Signal processing letters, 20(3):209-212, 2012. +[24] Da Pan, Ping Shi, Ming Hou, Zefeng Ying, Sizhe Fu, and Yuan Zhang. Blind predicting similar quality map for image quality assessment. In CVPR, pages 6373-6382, 2018. +[25] Xingang Pan, Xiaohang Zhan, Bo Dai, Dahua Lin, Chen Change Loy, and Ping Luo. Exploiting deep generative prior for versatile image restoration and manipulation. In ECCV, pages 262-277, 2020. +[26] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, pages 8024-8035, 2019. +[27] Ekta Prashnani, Hong Cai, Yasamin Mostofi, and Pradeep Sen. PieAPP: Perceptual image-error assessment through pairwise preference. In CVPR, pages 1808-1817, 2018. +[28] Hongyu Ren, Diqi Chen, and Yizhou Wang. RAN4IQA: Restorative adversarial nets for no-reference image quality assessment. In AAAI, volume 32, 2018. +[29] Michele A Saad, Alan C Bovik, and Christophe Charrier. Blind image quality assessment: A natural scene statistics approach in the DCT domain. TIP, 21(8):3339-3352, 2012. +[30] Hamid R Sheikh, Muhammad F Sabir, and Alan C Bovik. A statistical evaluation of recent full reference image quality assessment algorithms. TIP, 15(11):3440-3451, 2006. +[31] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. +[32] Hossein Talebi and Peyman Milanfar. NIMA: Neural image assessment. TIP, 27(8):3998-4011, 2018. +[33] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In CVPR, pages 9446-9454, 2018. +[34] Shiqi Wang, Xiang Zhang, Siwei Ma, and Wen Gao. Reduced reference image quality assessment using entropy of primitives. In PCS, pages 193-196, 2013. +[35] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. ESRGAN: + +Enhanced super-resolution generative adversarial networks. In ECCVW, pages 0-0, 2018. +[36] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: From error visibility to structural similarity. TIP, 13(4):600-612, 2004. +[37] Zhou Wang, Eero P Simoncelli, and Alan C Bovik. Multiscale structural similarity for image quality assessment. In ACSSC, volume 2, pages 1398-1402, 2003. +[38] Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In CVPR, pages 5791-5800, 2020. +[39] Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In CVPR, pages 4133-4141, 2017. +[40] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. In CVPR, pages 5505-5514, 2018. +[41] Yanhong Zeng, Jianlong Fu, Hongyang Chao, and Baining Guo. Learning pyramid-context encoder network for high-quality image inpainting. In CVPR, pages 1486-1494, 2019. +[42] Zheng-Jun Zha, Daqing Liu, Hanwang Zhang, Yongdong Zhang, and Feng Wu. Context-aware visual policy network for fine-grained image captioning. TPAMI, 2019. +[43] Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. TIP, 26(7):3142-3155, 2017. +[44] Lin Zhang, Lei Zhang, Xuanqin Mou, and David Zhang. FSIM: A feature similarity index for image quality assessment. TIP, 20(8):2378-2386, 2011. +[45] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, pages 586-595, 2018. +[46] Wenlong Zhang, Yihao Liu, Chao Dong, and Yu Qiao. RankSRGAN: Generative adversarial networks with ranker for image super-resolution. In ICCV, pages 3096-3105, 2019. +[47] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In ECCV, pages 286-301, 2018. +[48] Ziqi Zhang, Yaya Shi, Chunfeng Yuan, Bing Li, Peijin Wang, Weiming Hu, and Zheng-Jun Zha. Object relational graph with teacher-recommended learning for video captioning. In CVPR, pages 13278-13288, 2020. +[49] Heliang Zheng, Jianlong Fu, Zheng-Jun Zha, and Jiebo Luo. Looking for the devil in the details: Learning trilinear attention sampling network for fine-grained image recognition. In CVPR, pages 5012-5021, 2019. \ No newline at end of file diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/images.zip b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e9608f9b768ad5c3338a485b314d97f2d71d8897 --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d144593aa8159235911d22a382d54b17a682034c68ac005e675b065492cb7b3 +size 572427 diff --git a/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/layout.json b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e7ca9415e0c048f68569b9322bec206627af4b47 --- /dev/null +++ b/learningconditionalknowledgedistillationfordegradedreferenceimagequalityassessment/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:474216d582427aaaa69a3cb81429a7b72c309170e917178d7f480df09e2103df +size 374600 diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_content_list.json b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..34b10a4e6d6be19ad8ebc78e5e8145241d27b370 --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:744f1cd76e00a2b1d003eef8532cbd82f641991173ac52fa6937e2ff7fe8aeb4 +size 82634 diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_model.json b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e8c174a5b86d3f8b0193d400e2306114a2e36c63 --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b4d997b0988ab10ff33395aee3732f1429292344b3fab5a4d68ad8aca0e39ce +size 106767 diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_origin.pdf b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..caad28c8d3135a7938e013f60915d4dc2f0d6887 --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/d219473c-e7f6-4c20-b05f-c7dabd155c35_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69087c5a2a01970ef9e4226a6d13d6f240d3ad78de3660f5ec41d10d01cb2915 +size 4178999 diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/full.md b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..501a55f41f0c3cdd75eb5cd9b9c4937652c63ebf --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/full.md @@ -0,0 +1,342 @@ +# Learning Cross-Modal Contrastive Features for Video Domain Adaptation + +Dongyun Kim $^{1}$ , Yi-Hsuan Tsai $^{2}$ , Bingbing Zhuang $^{2}$ , Xiang Yu $^{2}$ + +Stan Sclaroff1, Kate Saenko1,3, Manmohan Chandraker2 + +$^{1}$ Boston University, $^{2}$ NEC Labs America, $^{3}$ MIT-IBM Watson AI Lab + +$^{1}$ {donhk, sclaroff, saenko}@bu.edu, $^{2}$ {ytsai, bzhuang, xiangyu, manu}@nec-labs.com + +# Abstract + +Learning transferable and domain adaptive feature representations from videos is important for video-relevant tasks such as action recognition. Existing video domain adaptation methods mainly rely on adversarial feature alignment, which has been derived from the RGB image space. However, video data is usually associated with multi-modal information, e.g., RGB and optical flow, and thus it remains a challenge to design a better method that considers the cross-modal inputs under the cross-domain adaptation setting. To this end, we propose a unified framework for video domain adaptation, which simultaneously regularizes cross-modal and cross-domain feature representations. Specifically, we treat each modality in a domain as a view and leverage the contrastive learning technique with properly designed sampling strategies. As a result, our objectives regularize feature spaces, which originally lack the connection across modalities or have less alignment across domains. We conduct experiments on domain adaptive action recognition benchmark datasets, i.e., UCF, HMDB, and EPIC-Kitchens, and demonstrate the effectiveness of our components against state-of-the-art algorithms. + +# 1. Introduction + +Recently, domain adaptation has gained a lot of attention due to its efficiency during training without the need of collecting ground truth labels in the target domain. Existing methods have made significant progress in image-based tasks, such as classification [33, 14, 54, 42], semantic segmentation [16, 53, 56, 31, 38] and object detection [8, 43, 24, 17]. While several works have sought to extend this success to video-based tasks like action recognition by aligning appearance (e.g., RGB) features through adversarial learning [6, 9, 37], challenges persist in video adaptation tasks due to the greater complexity of the video data. Moreover, different from the image data, domain shifts in videos for action recognition often involve more complicated environments, which increases the difficulty for adaptation. For + +![](images/8ec7fa392c0e6e84d5a393a04fffaa30c791c0a5de1e5225e95516be6eed82ac.jpg) +Figure 1. We propose a cross-modal contrastive learning framework for video domain adaptation. Our framework consists of two contrastive learning objectives: (1) cross-modal contrastive learning to align cross-modal representations from the same video, and (2) cross-domain contrastive learning to align representations between the source and target domains in each modality. + +example, the "fencing" action usually happens in a stadium, but it can happen in other places such as home or outdoors. Also, different actions can take place under the same background. Therefore, purely relying on aligning RGB features can be biased to the background and affect the performance. + +In addition to the appearance cue, other modalities such as motion, audio, and text are considered in (self-)supervised learning methods on the video data [46, 2, 26, 39]. In this work, we focus on appearance and motion as the two most common modalities in the cross-domain action recognition task, in which the motion modality (i.e., optical flow) is shown to be more domain-invariant (e.g., background changes) than RGB [36]. As a result, motion can better capture background-irrelevant information, while RGB can identify semantically meaningful information under different camera setups, e.g., camera perspective. + +As shown in Figure 1, with two modalities across two domains, adaptation becomes a task of how to explore the relationship of cross-modal and cross-domain features, to fully exploit the multi-modal property for video domain + +adaptation. That is, given either the source video $V_{s}$ or the target one $V_{t}$ , they can be associated to either the appearance feature $F^{a}$ or the motion feature $F^{m}$ , which results in four combinations of feature spaces, i.e., $F_{s}^{a}, F_{t}^{a}, F_{s}^{m}, F_{t}^{m}$ . Thus, the ensuing task is to design an effective adaptation mechanism for dealing with these four feature spaces. Since each modality has its characteristics and benefit (e.g., flow is more domain-invariant and RGB can capture semantic cues), it is of great interest to enable feature learning across the two modalities. Our key contribution stems from the observation that typical adversarial feature alignment schemes used in e.g. [6, 10] may not be directly applied in the cross-modal setting. For example, it is not reasonable to directly align the RGB feature $F_{s}^{a}$ in the source domain with the flow feature $F_{s}^{m}$ or $F_{t}^{m}$ in either domain. + +To tackle this issue, motivated by the recent advancements in self-supervised multi-view learning [50] that achieves powerful feature representations, we propose to treat each modality as a view, while introducing the cross-domain video data in our multi-modal learning framework. To this end, we leverage the contrastive learning objectives for performing feature regularization mutually among those four feature spaces (see Figure 1) under the video domain adaptation setting. We note that the prior work [36] also adopts a multi-modal framework, but it focuses on typical adversarial alignment and a self-supervised objective to predict whether the RGB/flow modality comes from the same video clip, without the exploration of jointly regularizing cross-modal and cross-domain features like our work. + +More specifically, our framework is allowed to contrast features across modalities within a domain (e.g., between $F_{s}^{a}$ and $F_{s}^{m}$ ) or across domains using one modality (e.g., between $F_{s}^{a}$ and $F_{t}^{a}$ ). Two kinds of loss functions are designed accordingly: 1) a cross-modal loss that considers each modality as one view in a video while contrasting views in other videos from the same domain; 2) a cross-domain loss that considers one modality at a time and contrasts features based on the (pseudo) class labels of videos across two domains. There are several benefits of the proposed contrastive learning-based feature regularization strategies: 1) it is a unified framework that allows the interplay across features in different modalities and domains, while still enjoying the benefits of each modality; 2) it enables sampling strategies of selecting multiple positive and negative samples in the loss terms, coupled with memory banks to record large variations in video clips; 3) our cross-domain loss can be considered as a soft version of pseudo-label self-training with the awareness of class labels, which performs more robustly than typical adaptation methods. + +We conduct experiments in video action recognition benchmark datasets, including the UCF [47] $\leftrightarrow$ HMDB [27] setting, and the EPIC-Kitchens [11, 36] dataset. We show that including either our cross-modal or cross-domain con + +trastive learning objective improves accuracy while combining these two strategies in a unified framework obtains the best results. Moreover, our method performs favorably against state-of-the-art domain adaptation techniques, e.g., adversarial feature alignment [6, 36], self-learning scheme [10], and pseudo-label self-training. The main contributions of this work are summarized as follows. + +- We propose a new multi-modal framework for video domain adaptation that leverages the property in four different feature spaces across modalities and domains. +- We leverage the contrastive learning technique with well-designed sampling strategies and demonstrate the application to adaptation for cross-domain action recognition by exploiting appearance and flow modalities. +- We show the effectiveness of both the cross-modal and cross-domain contrastive objectives, by achieving state-of-the-art results on UCF-HMDB and EPIC-Kitchens adaptation benchmarks with extensive analysis. + +# 2. Related Work + +In this section, we discuss existing fully-supervised and domain adaptation methods for action recognition, as well as methods on unsupervised learning for video representations. + +Supervised Action Recognition. Action recognition is one of the important tasks for understanding video representations. With the recent advancements in deep learning, early works either adopt 2D [22] or 3D [19] convolutional networks on RGB video frames, which achieve significant progress. To improve upon the single-modal framework, optical flow is commonly used as the temporal cue to greatly improve the action recognition accuracy [46]. Following this multi-modal pipeline, several methods are proposed to further incorporate the long-term temporal context [58, 12] and structure [52, 66, 57], or extend to the 3D convolutional networks [4, 51]. Moreover, recent approaches show the benefit of adopting 1D/2D separable convolutional networks [52, 63], while other methods [12, 20] focus on improving the 3D convolutional architecture for action recognition, to be computationally efficient. Despite the promising performance of these methods in a fully-supervised manner, our focus is to develop an effective action recognition framework under the unsupervised domain adaptation setting. + +Domain Adaptation for Action Recognition. Due to the convenience of recording videos under various conditions, there is an increasing demand for developing approaches for cross-domain action recognition. Previous methods focus on the setting of cross-domain transfer learning [49, 65, 64] or tackle the problem of view-point variance in videos [25, 29, 41, 45]. However, unsupervised domain adaptation (UDA) for action recognition has received less attention until + +![](images/3610db7066cd03c3695a6e5a2f5972aaa79dbc9346eaa2869b31ec0778558727.jpg) +Figure 2. An overview of our cross-modal contrastive learning framework. We use a two-stream network for RGB and flow. Each stream takes video clips and outputs feature vectors for each domain and modality $(F_s^a, F_t^a, F_s^m, F_t^m)$ . For cross-modal contrastive learning, we add the projection head $(h)$ to learn an embedding where the flow and RGB features from the same video are matched (e.g., $h(F_{s_i}^a)$ , $h(F_{s_i}^m)$ ). For cross-domain contrastive learning, we match the cross-domain features of the same class without the projection head (e.g. $F_{s_i}^a$ , $F_{t_j}^a$ ) in the same modality. For the unlabeled target domain, we use high-confidence pseudo-labels $\hat{Y}_t$ to find positive samples in the source domain. + +Table 1. Summary of notations. + +
NotationMeaning
{Vs, Vt}{Source, Target} video clips
Fs^aSource appearance feature
Fs^mSource motion feature
F^a_tTarget appearance feature
F^m_tTarget motion feature
h(·)Shared projection head
Ŷ_tTarget pseudo-label
+ +recently. Early attempts align distributions across the source and target domains using hand-crafted features [3, 67], while recent deep learning based methods [18, 37, 9, 6, 10, 36] leverage the insight from UDA on image classification and extend it to the video case. For instance, approaches [6, 37] utilize adversarial feature alignment [14, 54] and propose a temporal version with attention modules. Moreover, self-supervised learning strategies are adopted by considering the video properties, such as clip orders [10], sequential domain prediction [5], and modality correspondence prediction [36] in videos. Similar to [36], our method also considers the multi-modal property, but focuses on a different problem regime. To be specific, we propose a contrastive learning framework that can better exploit the multi-modality to regularize the feature spaces simultaneously across modalities and across domains, which is previously unstudied. + +# Self-supervised Learning for Video Representation. + +Learning from unlabeled videos is beneficial for video representations as video labeling is expensive. For instance, numerous approaches are developed via exploiting the temporal structure in videos [13, 60], e.g., temporal order verification [34] and sorting sequences [28]. By leveraging the temporal connection across frames, patch tracking over time [59] or prediction of future frames [48] also facilitates feature learning in videos. Moreover, to incorporate the multi-modal information into learning, RGB frames, audio, + +and optical flow are used to align with each other for self-learning [2, 26, 39, 15, 1, 35, 40]. After the learning process, such methods are usually served as a pre-training step for the downstream tasks. In this paper, we study the UDA setting for cross-domain and cross-modal action recognition, which involves a labeled source dataset and unlabeled target videos. + +# 3. Proposed Method + +In this section, we first introduce the overall pipeline of the proposed approach for video domain adaptation. Then we describe individual modules for cross-modal and cross-domain feature regularization, followed by the complete objective in a unified framework using contrastive learning. + +# 3.1. Algorithm Overview + +Given the source dataset that contains videos $\{s_i\} \in V_s$ with its action label set $Y_{s}$ , our goal is to learn an action recognition model that is able to perform reasonably well on the unlabeled target video set $\{t_i\} \in V_t$ . Since we aim to investigate an effective way to construct a domain adaptive model that leverages the benefit of multi-modal information (i.e., RGB and flow) across domains, we utilize a two-stream network [36] that takes the RGB and flow images as the input. As a result, the two-stream network would output the RGB modality feature $F^{a}$ and the flow modality feature $F^{m}$ , which forms four different feature spaces across the modality and domain, i.e., $F_{s}^{a}, F_{t}^{a}, F_{s}^{m}, F_{t}^{m}$ . + +In our contrastive learning framework, we jointly consider the relationship of these four spaces via two kinds of contrastive loss functions to regularize features as shown in Figure 1. First, we treat each modality as a view, extract the RGB/flow features from the same domain (either source or target), and contrast them based on whether the features come from the same video, e.g., the cross-modal features of one video, $F_{s}^{a}$ and $F_{s}^{m}$ , should be closer to each other in an embedding space than others extracted from different + +![](images/a9462b3187cb49b64ec472a6a57829de62ba8329b9ade38525c564c5ac5dc9cd.jpg) +Figure 3. An overview of cross-modal contrastive learning. We pull an RGB feature and a flow feature from the same video clip as positives but push cross-modal features from different video clips. + +video clips. Second, for features across the domains, e.g., $F_{s}^{a}$ and $F_{t}^{a}$ , but within the same modality, we contrast them based on whether the videos are likely to share the same action label. To this end, we calculate the pseudo-labels $\hat{Y}_{t}$ on target videos and form positive/negative samples to perform contrastive learning. Figure 2 illustrates our overall framework and Table 2 summarizes the notations. + +# 3.2. Cross-modal Regularization + +Motivated by the unsupervised multi-view feature learning method [50], we treat each modality as a view and form positive training samples within the same video, as well as negative samples from different videos. However, the difference is that we cannot directly apply negative pairing to all the videos, as in our problem, the videos from two different domains under the same view could still be largely different because of the domain gap. Therefore, it would not be proper to mix source and target videos, and instead, we form a contrastive objective in each domain separately. + +Sampling Strategy. It has been studied that the sampling strategy is crucial in image-based contrastive learning [21]. Considering videos from one domain in our case, we select positive training samples from the same video but with different modalities, while sampling the negative ones when the RGB and flow frames are from different videos, regardless of their action labels. An illustration of cross-modal sampling for the source domain is in Figure 3, and a similar strategy is used for the target domain. + +In addition, since one video clip contains many frames, every time we need to randomly sample a window of consecutive frames within a video clip, following the setting in [10, 36]. To account for the large intra-variation within a video clip, we do not assume that the RGB and flow modality need to have the same window of frames. For example, given a video clip, the RGB frames can be randomly sampled from the time window $t \sim t + 15$ , while the flow frames can be different, e.g., $t + 5 \sim t + 20$ . Empirically, we find that + +![](images/aff623401583ffe61d56fc839b7fced8df31a0caec4c3f449159055fdb2ab166.jpg) +Figure 4. Based on pseudo-labels, we pull source and target features sharing the same labels but push cross-domain features otherwise. + +such a sampling strategy is especially beneficial for our contrastive learning objective, which is aware of the variation within video clips in the embedding space. + +Similarity Between Samples. Another important aspect in contrastive learning is the feature similarity. Taking the source domain as one example, we have features from RGB and flow, i.e., $F_{s}^{a}$ and $F_{s}^{m}$ . Since each modality maintains its own feature characteristic, directly contrasting these two features may make the negative impact on the feature representation and reduce the recognition accuracy. To this end, given source features $F_{s_i}$ and $F_{s_j}$ from two videos $\{s_i,s_j\} \in V_s$ , we apply an additional projection head $h(\cdot)$ in a way similar to SimCLR [7], and then we can define the similarity function $\phi^s (\cdot)$ between samples with a temperature parameter $\tau$ as: + +$$ +\phi^ {s} \left(F _ {s _ {i}} ^ {k}, F _ {s _ {j}} ^ {l}\right) _ {k, l \in \{a, m \}} = \exp \left(h \left(F _ {s _ {i}} ^ {k}\right) ^ {\top} h \left(F _ {s _ {j}} ^ {l}\right) / \tau\right). \tag {1} +$$ + +where $\{a, m\}$ represents either the appearance (RGB) or motion (flow) modality. + +Loss Function. Based on the aforementioned sampling strategy and similarity measurement as depicted in Figure 3, the loss function for the source domain is written as: + +$$ +\mathcal {L} _ {m o} ^ {s} = - \log \frac {\sum_ {s _ {i} \in V _ {s}} \phi^ {s} \left(F _ {s _ {i}} ^ {k} , F _ {s _ {i} +} ^ {l}\right) _ {k \neq l}}{\sum_ {s _ {i} \in V _ {s}} \phi^ {s} \left(F _ {s _ {i}} ^ {k} , F _ {s _ {i} +} ^ {l}\right) _ {k \neq l} + \phi^ {s} \left(F _ {s _ {i}} ^ {k} , F _ {s _ {j} -} ^ {l}\right) _ {k \neq l}}, \tag {2} +$$ + +where $F_{s_i+}$ is the positive sample with a different view (modality) from the same video clip $F_{s_i}$ , while $F_{s_j-}$ is the negative sample with another view of a different video from $F_{s_i}$ , regardless of their action labels. Here, we omit the notation $k, l \in \{a, m\}$ to have a concise presentation. + +On the other hand, for videos in the target domain, we construct another loss $\mathcal{L}_{mo}^t$ similar to (2) with the same projection head $h(\cdot)$ , where the similarity measurement $\phi^t$ between features of target videos $\{t_i,t_j\} \in V_t$ is defined as: + +$$ +\phi^ {t} \left(F _ {t _ {i}} ^ {k}, F _ {t _ {j}} ^ {l}\right) _ {k, l \in \{a, m \}} = \exp \left(h \left(F _ {t _ {i}} ^ {k}\right) ^ {\top} h \left(F _ {t _ {j}} ^ {l}\right) / \tau\right). \tag {3} +$$ + +Here, to consider individual domain characteristics, we find that the key is to form the cross-modal loss for each domain separately, while these two loss functions can still share the same projection head $h^1$ . The projection head helps to prevent overfitting to this regularization. Without it, the RGB and flow features would be aligned to be the same, so that they are not complementary to each other anymore. Therefore, by combining these two loss functions in each of the source and target domains (i.e., $\mathcal{L}_{mo}^s$ and $\mathcal{L}_{mo}^t$ ), features within the same video but from different modalities are closer in an embedding space, which is also served as a feature regularization on unlabeled target videos. + +# 3.3. Cross-domain Regularization + +In addition to the cross-modal regularization introduced in the previous section, we find that there is a missing connection between features across domains. To further exploit the interplay between four feature spaces $(F_{s}^{a}, F_{t}^{a}, F_{s}^{m}, F_{t}^{m})$ , we propose to use another contrastive learning objective for cross-domain samples. + +Sampling Strategy via Pseudo-labels. Taking one modality, RGB, as the example, we consider cross-domain features of $F_{s}^{a}$ and $F_{t}^{a}$ in a similar contrastive learning setup as described in Section 3.2. Here, an intuitive way to form positive samples is to find the videos with the same label across domains. However, since we do not know the action label in the target domain, we first apply our two-stream action recognition model and obtain the prediction score of the target-domain video. Then, if the score is larger than a certain threshold $T$ (e.g., $T = 0.8$ in our setting), we obtain the pseudo-label of this target sample and sample other source videos with the same action label from positive samples (otherwise they are negative samples). The procedure for the RGB modality is illustrated in Figure 4, while a similar way is used for the flow modality. + +Similarity Between Samples. To measure the sample similarity in our contrastive objective, we adopt $\phi^{st}$ to calculate the similarity between cross-domain features: + +$$ +\phi^ {s t} \left(F _ {t _ {i}} ^ {k}, F _ {s _ {i}} ^ {k}\right) _ {k \in \{a, m \}} = \exp \left(F _ {t _ {i}} ^ {k \top} F _ {s _ {i}} ^ {k} / \tau\right), \tag {4} +$$ + +where the modality $k$ can be appearance or motion in our work. Note that, for cross-domain feature regularization, in order to align features, we do not use an additional projection head $h(\cdot)$ like Section 3.2 or Figure 3 (explained as the follows). + +Loss Function. The corresponding loss function with respect to the sampling strategy (Figure 4) and the similarity + +measurement $\phi^{st}$ for the RGB modality is defined as: + +$$ +\mathcal {L} _ {d o} ^ {a} = - \log \frac {\sum_ {t _ {i} \in \hat {V} _ {t}} \phi^ {s t} \left(F _ {t _ {i}} ^ {a} , F _ {s _ {i} +} ^ {a}\right)}{\sum_ {t _ {i} \in \hat {V} _ {t}} \phi^ {s t} \left(F _ {t _ {i}} ^ {a} , F _ {s _ {i} +} ^ {a}\right) + \phi^ {s t} \left(F _ {t _ {i}} ^ {a} , F _ {s _ {i} -} ^ {a}\right)}, \tag {5} +$$ + +where $t_i \in \hat{V}_t$ is the set of target videos with a more confident pseudo labels $\hat{Y}_t$ . $F_{s_i+}^a$ are the positive samples of source videos $s_i \in V_s$ with the same class label as $\hat{Y}_t$ , while $F_{s_i-}^a$ are the negative samples with different class labels. Similarly, when the modality is flow, the loss function is: + +$$ +\mathcal {L} _ {d o} ^ {m} = - \log \frac {\sum_ {t _ {i} \in \hat {V} _ {t}} \phi^ {s t} \left(F _ {t _ {i}} ^ {m} , F _ {s _ {i} +} ^ {m}\right)}{\sum_ {t _ {i} \in \hat {V} _ {t}} \phi^ {s t} \left(F _ {t _ {i}} ^ {m} , F _ {s _ {i} +} ^ {m}\right) + \phi^ {s t} \left(F _ {t _ {i}} ^ {m} , F _ {s _ {i} -} ^ {m}\right)}. \tag {6} +$$ + +We also note that the choice without using the projection head $h(\cdot)$ is reasonable as our objectives in (5) and (6) essentially try to make features with the same action labels closer to each other, which is consistent with the final goal for performing action recognition. + +Connections to Pseudo-label Self-training. Using pseudo labels on the target sample to self-train the model is one commonly used approach in domain adaptation [69, 68, 32]. In the proposed cross-domain contrastive learning, we also adopt pseudo labels to form positive samples. However, these two methods are distinct, in terms of the way that reshapes the feature space. + +Given the target video $V_{t}$ , one can produce a pseudo-label $\hat{Y}_{t}$ and use it for training the action recognition network with the standard cross-entropy loss. Therefore, such supervision is a strong signal that forces the feature $F_{t}$ to map into the space of action label $\hat{Y}_{t}$ , which is sensitive to noisy labels such as pseudo-labels. On the contrary, using contrastive learning with pseudo-labels is similar in spirit to the soft nearest-neighbor loss [44, 61], which encourages soft feature alignments, rather than enforcing the hard final classification, hence more robust to potential erroneous pseudo-labels. Similar observations are also presented in the recent work, which shows that the supervised contrastive loss [23] is more robust than the cross-entropy loss in image classification. In our case, we utilize such property and show that cross-domain contrastive learning can be achieved by using pseudo-labels in video domain adaptation, and is more robust than pseudo-label self-training. More empirical comparisons will follow in the experiments. + +# 3.4. A Contrastive Learning Framework + +In previous sections, we have introduced how we incorporate cross-modal and cross-domain contrastive loss functions to regularize features extracted from RGB/flow branches across the source and target domains. Next, we introduce the entire objective. + +Overall Objective. Overall, we include loss functions in Section 3.2 and 3.3 without using any supervisions, and a standard supervised cross-entropy loss $\mathcal{L}_{src}$ on source videos $V_{s}$ with action labels $Y_{s}$ . To obtain the final output from the two-stream network, we average the outputs from individual classifiers of RGB and flow branches (see Figure 2). + +$$ +\begin{array}{l} \mathcal {L} _ {\text {a l l}} = \mathcal {L} _ {\text {s r c}} \left(V _ {s}, Y _ {s}\right) + \tag {7} \\ \lambda \left(\mathcal {L} _ {m o} ^ {s} \left(V _ {s}\right) + \mathcal {L} _ {m o} ^ {t} \left(V _ {t}\right) + \mathcal {L} _ {d o} \left(V _ {s}, V _ {t}, \hat {Y} _ {t}\right)\right), \\ \end{array} +$$ + +where $\lambda$ is the weight to balance the terms. Here, we treat loss functions in (5) and (6) as one term: $\mathcal{L}_{do} = \mathcal{L}_{do}^{a} + \mathcal{L}_{do}^{m}$ , as they are with the same form but using different modalities. Since all the loss terms are with a similar form, it does not require heavy tuning on each of them, so that we use the same $\lambda$ for cross-modal and cross-domain losses (i.e., $\lambda = 1.25$ in this paper). + +Leveraging Memory Banks. To compute the cross-modal and cross-domain loss functions, we need to compute all feature representations summed from video sets $V_{s}$ and $V_{t}$ . However, it is impossible to obtain all the features at every training iteration. Therefore, we store the features in the memory banks following [62], i.e., an individual memory bank for a domain and a modality, totally with four combinations $M_{s}^{a}, M_{s}^{m}, M_{t}^{a}$ , and $M_{t}^{m}$ . Given the features in a batch (i.e., $F_{s_i}^a, F_{s_i}^m, F_{t_j}^a$ , and $F_{t_j}^m$ ), we pull out features from the memory banks for positive and negative features (e.g., $F_{s_i+}^a$ or $F_{s_i-}^a$ in (5) is replaced by $M_{s_i+}^a$ and $M_{s_i-}^a$ ). Then, the memory bank features are updated with the features in the batch at the end of each iteration. We use a momentum update $\delta = 0.5$ following [62]: + +$$ +M _ {s _ {i}} ^ {a} = \delta M _ {s _ {i}} ^ {a} + (1 - \delta) F _ {s _ {i}} ^ {a}. \tag {8} +$$ + +The other memory banks, $M_s^m$ , $M_t^a$ , and $M_t^m$ , are also updated in the same way. Using the momentum update also encourages smoothness in training dynamics [62]. In our case, during the training process, we randomly sample consecutive frames in a video clip. Therefore, by using the memory banks, our model can also encourage the temporal smoothness within each clip in feature learning. + +# 4. Experimental Results + +In this section, we show performance comparisons on numerous domain adaptation benchmark scenarios for action recognition, followed by comprehensive ablation studies to validate the effectiveness of our cross-domain and cross-modal feature regularization. Please refer to the supplementary material for more results and analysis. + +# 4.1. Datasets and Experimental Setting + +We use the three standard benchmark datasets for video domain adaptation, UCF [47], HMDB [27], and EPIC-Kitchens [11]. We then show that our method is a general + +Table 2. Performance comparisons on UCF $\leftrightarrow$ HMDB. + +
SettingTwo-streamUCF → HMDBHMDB → UCF
Source-only [6]80.688.8
TA3N [6]81.490.5
Supervised-target [6]93.197.0
TCoN [37]87.289.1
Source-only [10]80.388.8
SAVA [10]82.291.2
Supervised-target [10]95.096.8
Source-only✓82.890.7
MM-SADA [36]✓84.291.1
Ours (cross-modal)✓84.792.5
Ours (cross-domain)✓83.691.1
Ours (final)✓84.792.8
Supervised-target✓98.895.0
+ +framework to work for different types of action recognition settings: UCF $\leftrightarrow$ HMDB for human activity recognition, as well as EPIC-Kitchens for fine-grained action recognition in egocentric videos. + +UCF $\leftrightarrow$ HMDB. Chen et al. [6] release the UCF $\leftrightarrow$ HMDB dataset for studying video domain adaptation. This dataset has 3209 videos with 12 action classes. All the videos come from the original UCF [47] and HMDB [27] datasets, which sample the overlapping 12 classes out of 101/51 classes from UCF/HMDB, respectively. There are two settings of interest, UCF $\rightarrow$ HMDB and HMDB $\rightarrow$ UCF. We show the performance of our method in both settings following the official split provided by the authors [6]. + +EPIC-Kitchens. This dataset contains fine-grained action classes with videos recorded in different kitchens from the egocentric view. We follow the train/test split used in [36] for the domain adaptation task. There are 8 action categories in the three largest kitchens, i.e., D1, D2, and D3, and we use all the pairs of them as source/target domains. Note that, compared to UCF $\leftrightarrow$ HMDB, EPIC-Kitchens is more challenging as it has more fined-grained classes (e.g., "Take", "Put", "Open", "Close") and imbalanced class distributions. We report the top-1 accuracy on the test set averaged over the last 9 epochs following [36]. + +Implementation Details. Our entire framework is implemented in PyTorch using 2 TITANXP GPUs. We use an I3D two-stream network [4] composed of an RGB stream and a flow stream, where the network is pre-trained on Kinetics following [10]. During training, we use the same setting as [10, 36] to randomly sample 16 consecutive frames out of a video clip. Then each RGB and flow stream takes these 16 frames with a size of $224 \times 224$ . Each stream is followed by a fully-connected layer to compute individual output logits. Then the logits from each stream are averaged to predict the final class scores. To optimize the entire network, we use the SGD optimizer with a learning rate of 0.01. We set the temperature $\tau = 0.1$ and $\delta = 0.5$ for all experiments following [62]. For UCF $\leftrightarrow$ HMDB, we follow the setting as [10] for batch size, total training epochs, learning rate, etc. For EPIC-Kitchens, we implement it upon the official code + +Table 3. Performance comparisons on EPIC-Kitchens. + +
SettingD2 → D1D3 → D1D1 → D2D3 → D2D1 → D3D2 → D3MeanGain
Source-only42.544.342.056.341.246.545.5
AdaBN [30]44.647.847.054.740.348.847.2+1.7
MMD [33]43.148.346.655.239.248.546.8+1.3
MCD [42]42.147.946.552.743.551.047.3+1.8
MM-SADA [36]47.448.650.856.942.553.349.9+4.4
Ours (modality)44.350.249.556.643.048.848.7+3.2
Ours (domain)47.452.852.456.141.749.950.1+4.6
Ours (final)49.551.550.356.346.352.051.0+5.5
Supervised-target62.862.871.771.774.074.069.5
+ +of [36] but set the batch size as 32 to fit the memory of 2 GPUs and train the model for 6K iterations. The learning rate decreases by a factor of 10 every 3K iterations. + +# 4.2. Results on UCF $\leftrightarrow$ HMDB + +We show experimental results for UCF $\rightarrow$ HMDB and HMDB $\rightarrow$ UCF in Table 2, comparing with state-of-the-art methods — TA $^3$ N [6], TCoN [37], SAVA [10], and MM-SADA [36]. + +Comparisons with State-of-the-art Methods. In each group of Table 2, in addition to the result for each method, we show the "Source-only" model that only trains on videos in the source domain, and the "Supervised-target" model that trains on target videos with ground truths, which serves as an upper bound. We also implement [36] on UCF-HMDB in the same setup for fair comparisons. Different from the $\mathrm{TA}^3\mathrm{N}$ , TCoN, and SAVA that only exploit the single modality via adversarial feature alignment and self-learning schemes, our method leverages both the RGB and flow modalities in a domain adaptation framework, which achieves the state-of-the-art performance. We also notice that our source-only model performs slightly better than the other source-only baselines, due to the usage of the flow stream. Despite that the domain gap is reduced by leveraging the flow modality, our approach still obtains comparable performance gains with respect to the source-only model and performs better than MM-SADA [36] that adopts the same two-stream model. For example, on UCF $\rightarrow$ HMDB, the gain for $\mathrm{TA}^3\mathrm{N}$ and SAVA is $0.8\%$ and $1.9\%$ , respectively, while our gain is the same as SAVA and is much higher than $\mathrm{TA}^3\mathrm{N}$ . + +Ablation Study. In the fourth group of Table 2, we show model variants to validate the usefulness of individual components in our contrastive learning framework, i.e., cross-modal and cross-domain feature regularization. From the results, the two modules consistently improve the performance over the source-only baseline. By combining both, it provides the highest accuracy. Here, interestingly, we find that the cross-domain module is less helpful than the cross-modal one. One reason is that on UCF $\leftrightarrow$ HMDB, these two domains already share a high similarity, which reduces the impact of using the cross-domain loss. However, this + +Table 4. Ablation study on EPIC-Kitchens. + +
SettingModalityDomainMeanGain
Source-only45.5
MM-SADA [36]✓47.9+2.4
Ours✓48.7+3.2
MM-SADA [36]✓49.4+3.9
Pseudo-labeling✓49.0+3.5
Ours✓50.1+4.6
MM-SADA [36]✓✓49.9+4.4
Ours✓✓51.0+5.5
+ +also shows the importance of incorporating the proposed two modules, in which the cross-modal loss can still provide effective regularization, even when the domain gap is smaller. In the next section, we will show a different scenario, where both modules are important. + +# 4.3. Results on EPIC-Kitchens + +We present results on the EPIC-Kitchens benchmark for domain adaptation [36], including comparisons with state-of-the-art methods, ablation study, and more analysis. + +Comparisons with State-of-the-art Methods. In Table 3, we present several domain adaptation methods, including distribution alignment via adversarial learning [33], maximum classifier discrepancy [42], and adaptive batch normalization [30], and a recently proposed method that uses a self-learning objective [36]. We note that these results are reported from [36] using the same two-stream feature extractor as ours, and they share the same "Source-only" model and "Supervised-target" upper bound in Table 3. For fair comparisons, we reproduce results of MM-SADA [36] using their official implementation and the same computing resources as ours, and show that our final model performs better than MM-SADA by $1.1\%$ on average. The results show the advantages of our contrastive learning framework. More detailed analysis is provided as follows. + +Ablation Study. In Table 4, we ablate the two components for our cross-modal and cross-domain loss functions with other approaches that consider the similar aspect. For fair comparisons, we use the same two-stream backbone, implementation, and computing resources for generating all the results. Considering only modality or domain, our method consistently performs better than MM-SADA [36], in which it uses a self-learning module to predict whether the RGB/flow modality comes from the same video clip and a typical adversarial learning scheme to align cross-domain features. Combining these two factors, our method improves the "Source-only" model the most, which shows the effectiveness of the proposed unified framework using contrastive learning. In addition, it is worth mentioning that our cross-domain loss performs better than pseudo-label self-training by $1.1\%$ , which validates the discussion in Section 3.3 on + +![](images/5cc9922f3b84c41e7703d1f2e4fa020cbf7a3254063572d8c481142d7f724544.jpg) +Blue: Source RGB Green: Source Flow +(a) +Figure 5. t-SNE visualization on cross-modal and cross-domain features after the projection head $h(\cdot)$ on UCF $\rightarrow$ HMDB, i.e. $h(F_s^a)$ , $h(F_s^m)$ , $h(F_t^a)$ , $h(F_t^m)$ . In (a)(b), we show the visualization for individual domains, where each domain contains the multi-modality features. In (c)(d), we visualize features for each modality, and each plot uses the features from two domains. (e) includes all the features from two domains and two modalities, where each color represents one action class. + +![](images/30a128a9d890c8aad5a8610650aa043110ead2eb552c8f96654e69afe50dfbcf.jpg) +Blue: Target RGB Green: Target Flow +(b) + +![](images/4490a8bab6ea9b1b62149c344a14b948560682119fcaa15333d26ad99d6e2927.jpg) +Red: Source RGB Black: Target RGB +(c) + +![](images/bed57d607343897dd0c363dba9e5d938c4a46fd2920aa21c28c8b27d64c71bb1.jpg) +Red: Source Flow Black: Target Flow +(d) + +![](images/54ccde24a17d8af1b3201a505d2e27a94d6e1b9c968ba3f420e65669be185b27.jpg) +Each color represents one category +(e) + +![](images/20ea099bd837ead0603facf270b545b6170ad50649354b39c21b1505ad34e16d.jpg) +Figure 6. Cross-domain retrievals using the RGB feature. Given the target feature $F_{t}^{a}$ , we retrieve the closest neighbor $F_{s}^{a}$ in the source domain. Our model correctly aligns videos of the same class under view-angle (1st row) and background (2nd row) differences. + +the difference of leveraging pseudo-labels. + +Sampling Strategy. In Table 5, we present the ablation for sampling strategy in the cross-modal loss (see Section 3.2), where we do not assume that the RGB and flow modality have the same window of frames, which handles the large intra-variation within a video clip. When applying this strategy in MM-SADA [36], acting as a way for data augmentation, the performance gain is smaller than ours (i.e., $0.5\%$ vs $1.1\%$ ). This validates our sampling strategy with the proposed contrastive learning objective that enriches feature regularization under the domain adaptation setting. + +# 4.4. More Results and Analysis + +We present more analysis including the feature visualizations using t-SNE [55], and example results for cross-domain retrieval to understand our model predictions. + +t-SNE Visualizations. In this paper, we use a projection head $h(\cdot)$ to project RGB/flow features to an embedding space for cross-modal loss in our framework. Therefore, it is of great interest to understand how the features behave in this embedding space. To this end, we samples features from both domains across two modalities, and perform t-SNE visualizations on UCF $\rightarrow$ HMDB in Figure 5. + +Here, although our cross-modal loss is calculated in each domain, the projection head is shared across the domains. Therefore, we provide different combinations of the feature spaces to visualize how the four feature spaces look like, i.e., $h(F_s^a), h(F_s^m), h(F_t^a), h(F_t^m)$ . First, in Figure 5(a)(b), it + +Table 5. Ablation study on the sampling strategy. + +
SettingSamplingMeanGain via sampling
MM-SADA [36]✓49.4
49.9+0.5
Ours✓49.9
51.0+1.1
+ +is not surprising to observe that in each domain, features from different modalities are aligned together (e.g., Source RGB/Flow in Figure 5(a)), as it is exactly what the cross-modal objective in (2) optimizes for. + +More interestingly, if we consider each modality at a time in Figure 5(c)(d), e.g., Source RGB and Target RGB, their features are also aligned well, even we do not explicitly have an objective to align them in the embedding space via $h(\cdot)$ . This shows the merit of our framework that enables feature regularization and interplay across four feature spaces. Also, we present a visualization on the distribution for each class, including all the source and target features across two modalities in Figure 5(e). This illustrates that features from the same category are aligned well. + +Cross-domain Retrievals. In Figure 6, we show the cross-domain video retrievals using the RGB feature. Based on the target feature in HMDB, we show the nearest neighbor one from UCF. We show that our method can correctly retrieve the videos of the same class, either having the same context background but from a different view-angle or acting in a similar movement but with a different background. + +# 5. Conclusions + +We investigate the video domain adaptation task with our cross-modal contrastive learning framework. To this end, we leverage the multi-modal, RGB and flow information, and exploit their relationships. In order to handle feature spaces across modalities and domains, we propose two objectives to regularize such feature spaces, namely cross-modal and cross-domain contrastive losses, that learn better feature representations for domain adaptive action recognition. Moreover, our framework is modular, so it can be applicable to other domain adaptive multi-modal applications, which will be considered as the future work. + +# References + +[1] Humam Alwassel, Dhruv Mahajan, Bruno Korbar, Lorenzo Torresani, Bernard Ghanem, and Du Tran. Self-supervised learning by cross-modal audio-video clustering. In NeurIPS, 2020. 3 +[2] Relja Arandjelovic and Andrew Zisserman. Look, listen and learn. In ICCV, 2017. 1, 3 +[3] Liangliang Cao, Zicheng Liu, and Thomas S Huang. Cross-dataset action detection. In CVPR, 2010. 3 +[4] J. Carreira and A. Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, 2017. 2, 6 +[5] M.H. Chen, B. Li, Y. Bao, G. AlRegib, and Z. Kira. Action segmentation with joint self-supervised temporal domain adaptation. In CVPR, 2020. 3 +[6] Min-Hung Chen, Zsolt Kira, Ghassan AlRegib, Jaekwon Yoo, Ruxin Chen, and Jian Zheng. Temporal attentive alignment for large-scale video domain adaptation. In ICCV, 2019. 1, 2, 3, 6, 7 +[7] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 4 +[8] Yuhua Chen, Wen Li, Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Domain adaptive faster r-cnn for object detection in the wild. In CVPR, 2018. 1 +[9] Jinwoo Choi, Gaurav Sharma, Manmohan Chandraker, and Jia-Bin Huang. Unsupervised and semi-supervised domain adaptation for action recognition from drones. In WACV, 2020. 1, 3 +[10] Jinwoo Choi, Gaurav Sharma, Samuel Schulter, and Jia-Bin Huang. Shuffle and attend: Video domain adaptation. In ECCV, 2020. 2, 3, 4, 6, 7 +[11] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, and Will Price. Scaling egocentric vision: The epic-kitchens dataset. In ECCV, 2018. 2, 6 +[12] C. Feichtenhofer, H. Fan, J. Malik, and K. He. Slowfast networks for video recognition. In ICCV, 2019. 2 +[13] Basura Fernando, Hakan Bilen, Efstratios Gavves, and Stephen Gould. Self-supervised video representation learning with odd-one-out networks. In CVPR, 2017. 3 +[14] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. In JMLR, 2016. 1, 3 +[15] Tengda Han, Weidi Xie, and Andrew Zisserman. Self-supervised co-training for video representation learning. In NeurIPS, 2020. 3 +[16] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei A. Efros, and Trevor Darrell. Cycada: Cycle-consistent adversarial domain adaptation. In ICML, 2018. 1 +[17] Cheng-Chun Hsu, Yi-Hsuan Tsai, Yen-Yu Lin, and Ming-Hsuan Yang. Every pixel matters: Center-aware feature alignment for domain adaptive object detector. In ECCV, 2020. 1 + +[18] Arshad Jamal, Vinay P Namboodiri, Dipti Deodhare, and KS Venkatesh. Deep domain adaptation in action space. In BMVC, 2018. 3 +[19] S. Ji, W. Xu, M. Yang, and K. Yu. 3d convolutional neural networks for human action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(1):221-231, 2013. 2 +[20] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In ICCV, 2019. 2 +[21] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. In NeurIPS, 2020. 4 +[22] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In CVPR, 2014. 2 +[23] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In NeurIPS, 2020. 5 +[24] Taekyung Kim, Minki Jeong, Seunghyeon Kim, Seokeon Choi, and Changick Kim. Diversify and match: A domain adaptive representation learning paradigm for object detection. In CVPR, 2019. 1 +[25] Y. Kong, Z. Ding, J. Li, and Y. Fu. Deeply learned view-invariant features for cross-view action recognition. IEEE Transactions on Image Processing, 26(6):3028-3037, 2017. 2 +[26] Bruno Korbar, Du Tran, , and Lorenzo Torresani. Cooperative learning of audio and video models from self-supervised synchronization. In NeurlPS, 2018. 1, 3 +[27] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre. Hmdb: A large video database for human motion recognition. In ICCV, 2011. 2, 6 +[28] Hsin-Ying Lee, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Unsupervised representation learning by sorting sequences. In ICCV, 2017. 3 +[29] Junnan Li, Yongkang Wong, Qi Zhao, and Mohan Kankanhalli. Unsupervised learning of view-invariant action representations. In NeurIPS, 2018. 2 +[30] Yanghao Li, Naiyan Wang, Jianping Shi, Xiaodi Hou, and Jiaying Liu. Adaptive batch normalization for practical domain adaptation. Pattern Recognition, 80:109 - 117, 2018. 7 +[31] Yunsheng Li, Lu Yuan, and Nuno Vasconcelos. Bidirectional learning for domain adaptation of semantic segmentation. In CVPR, 2019. 1 +[32] Qing Lian, Fengmao Lv, Lixin Duan, and Boqing Gong. Constructing self-motivated pyramid curriculums for cross-domain semantic segmentation: A non-adversarial approach. In ICCV, 2019. 5 +[33] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In ICML, 2015. 1, 7 +[34] Ishan Misra, C Lawrence Zitnick, and Martial Hebert. Shuffle and learn: unsupervised learning using temporal order verification. In ECCV, 2016. 3 + +[35] Pedro Morgado, Yi Li, and Nuno Vasconcelos. Learning representations from audio-visual spatial alignment. In NeurIPS, 2020. 3 +[36] Jonathan Munro and Dima Damen. Multi-modal domain adaptation for fine-grained action recognition. In CVPR, 2020. 1, 2, 3, 4, 6, 7, 8 +[37] Boxiao Pan, Zhangjie Cao, Ehsan Adeli, and Juan Carlos Niebles. Adversarial cross-domain action recognition with co-attention. In AAAI, 2020. 1, 3, 6, 7 +[38] Sujoy Paul, Yi-Hsuan Tsai, Samuel Schulter, Amit K. Roy-Chowdhury, and Manmohan Chandraker. Domain adaptive semantic segmentation using weak labels. In ECCV, 2020. 1 +[39] AJ Piergiovanni, Anelia Angelova, and Michael S. Ryoo. Evolving losses for unsupervised video representation learning. In CVPR, 2020. 1, 3 +[40] AJ Piergiovanni, Anelia Angelova, and Michael S Ryoo. Evolving losses for unsupervised video representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 133-142, 2020. 3 +[41] Hossein Rahmani and Ajmal Mian. Learning a non-linear knowledge transfer model for cross-view action recognition. In CVPR, 2015. 2 +[42] Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. In CVPR, 2018. 1, 7 +[43] Kuniaki Saito1, Yoshitaka Ushiku, Tatsuya Harada, and Kate Saenko. Strong-weak distribution alignment for adaptive object detection. In CVPR, 2019. 1 +[44] Ruslan Salakhutdinov and Geoff Hinton. Learning a nonlinear embedding by preserving class neighbourhood structure. volume 2 of Proceedings of Machine Learning Research, pages 412-419, 2007. 5 +[45] Gunnar A Sigurdsson, Abhinav Gupta, Cordelia Schmid, Ali Farhadi, and Karteek Alahari. Actor and observer: Joint modeling of first and third-person videos. In CVPR, 2018. 2 +[46] K. Simonyan and A Zisserman. Two-stream convolutional networks for action recognition in videos. In NeurIPS, 2014. 1, 2 +[47] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv:1212.0402, 2012. 2, 6 +[48] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In ICML, 2015. 3 +[49] Waqas Sultani and Imran Saleemi. Human action recognition across datasets by foreground-weighted histogram decomposition. In CVPR, 2014. 2 +[50] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, 2020. 2, 4 +[51] D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri. Learning spatiotemporal features with 3d convolutional networks. In ICCV, 2015. 2 +[52] D. Tran, H. Wang, L. Torresani, J. Ray, Y. LeCun, and M. Paluri. A closer look at spatiotemporal convolutions for action recognition. In CVPR, 2017. 2 + +[53] Yi-Hsuan Tsai, Kihyuk Sohn, Samuel Schulter, and Manmohan Chandraker. Domain adaptation for structured output via discriminative patch representations. In ICCV, 2019. 1 +[54] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In CVPR, 2017. 1, 3 +[55] Laurens van der Maaten and Geoffrey Hinton. Visualizing high-dimensional data using t-sne. Journal of Machine Learning Research, 9:2579-2605, 2008. 8 +[56] Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Matthieu Cord, and Patrick Pérez. Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. In CVPR, 2019. 1 +[57] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In ECCV, 2016, 2 +[58] X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neural networks. In CVPR, 2018. 2 +[59] Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In ICCV, 2015. 3 +[60] Donglai Wei, Joseph Lim, Andrew Zisserman, and William T. Freeman. Learning and using the arrow of time. In CVPR, 2018. 3 +[61] Zhirong Wu, Alexei A Efros, and Stella Yu. Improving generalization via scalable neighborhood component analysis. In ECCV, 2018. 5 +[62] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, pages 3733-3742, 2018. 6 +[63] S. Xie, C. Sun, J. Huang, Z. Tu, and K. Murphy. Rethinking spatiotemporal feature learning for video understanding. In ECCV, 2018. 2 +[64] Tiantian Xu, Fan Zhu, Edward K. Wong, and Yi Fang. Dual many-to-one-encoder-based transfer learning for cross-dataset human action recognition. Image and Vision Computing, 55:127 - 137, 2016. 2 +[65] Xiao-Yu Zhang, Haichao Shi, Changsheng Li, Kai Zheng, Xiaobin Zhu, and Lixin Duan. Learning transferable self-attentive representations for action recognition in untrimmed videos with weak supervision. In AAAI, 2019. 2 +[66] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In ECCV, 2018. 2 +[67] Fan Zhu and Ling Shao. Enhancing action recognition by cross-domain dictionary learning. In BMVC, 2013. 3 +[68] Yang Zou, Zhiding Yu, B. V. K. Vijaya Kumar, and Jinsong Wang. Domain adaptation for semantic segmentation via class-balanced self-training. In ECCV, 2018. 5 +[69] Yang Zou, Zhiding Yu, Xiaofeng Liu, B.V.K. Vijaya Kumar, and Jinsong Wang. Confidence regularized self-training. In ICCV, 2019. 5 \ No newline at end of file diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/images.zip b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bfbae701577b998c751feb1480461033463fb675 --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbe04799d4dadfb05ba4e5c2defb5017248afc65ab3b99ccb3c56f5d3f1ad1ad +size 421528 diff --git a/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/layout.json b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0001ea1e2eb806d2971b634e48f2e1ca72c98731 --- /dev/null +++ b/learningcrossmodalcontrastivefeaturesforvideodomainadaptation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17630a87a11f415268327cf540bbd7ab1e4c5767a0abcace1c1f3540c8724af6 +size 467334 diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_content_list.json b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..56e2a25d444d90d8d71b4abb2b921aebe2c3079f --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f22b00e629e993e9661dd2a9276250993ea3915035dc5c16622d52b03f33ee99 +size 85955 diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_model.json b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4a5b61ec69151e889340e8bd23226dd18df9b0bd --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c06cc2d80a549d66aba6afd100f6cd0252ee27e1c05217f0835b6858e4f8d87a +size 99736 diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_origin.pdf b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..da195779721cc019744cbd0e78776240b6287cd2 --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/ef444c60-4296-4e20-a6bb-eeac0c07e1ea_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38e5fb3f6d928323fa3c8d6c75cf4484a1fca84c43435706a60426ea8ea54ab8 +size 8985502 diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/full.md b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..15cf84732227a1fb10c0725bdff1b34a56bb3ea0 --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/full.md @@ -0,0 +1,330 @@ +# Learning Deep Local Features with Multiple Dynamic Attentions for Large-Scale Image Retrieval + +Hui Wu1 Min Wang2* Wengang Zhou1,2* Houqiang Li1,2 + +$^{1}$ CAS Key Laboratory of Technology in GIPAS, EEIS Department, University of Science and Technology of China $^{2}$ Institute of Artificial Intelligence, Hefei Comprehensive National Science Center wh241300@mail.ustc.edu.cn, wangmin@iai.ustc.edu.cn, {zhwg, lihq}@ustc.edu.cn + +# Abstract + +In image retrieval, learning local features with deep convolutional networks has been demonstrated effective to improve the performance. To discriminate deep local features, some research efforts turn to attention learning. However, existing attention-based methods only generate a single attention map for each image, which limits the exploration of diverse visual patterns. To this end, we propose a novel deep local feature learning architecture to simultaneously focus on multiple discriminative local patterns in an image. In our framework, we first adaptively reorganize the channels of activation maps for multiple heads. For each head, a new dynamic attention module is designed to learn the potential attentions. The whole architecture is trained as metric learning of weighted-sum-pooled global image features, with only image-level relevance label. After the architecture training, for each database image, we select local features based on their multi-head dynamic attentions, which are further indexed for efficient retrieval. Extensive experiments show the proposed method outperforms the state-of-the-art methods on the Revisited Oxford and Paris datasets. Besides, it typically achieves competitive results even using local features with lower dimensions. Code will be released at https://github.com/CHANWH/MDA. + +# 1. Introduction + +Given a large image corpus, instance image retrieval [32, 27, 17, 38, 18, 9, 10, 19] aims to effectively identify images containing the same object or describing the same scene as the query image. This task is challenging due to the various conditions observed in large-scale datasets, such as lighting variation, occlusion, viewpoint changes, etc. To this end, many research efforts are devoted to image representation with descriptive and discriminative local features. + +Given an image, the extraction of local feature usually + +![](images/7baee7c39e46e34a942c397e134d35f52dcb1e6e8e766d3b471415259440f4f4.jpg) +(a) DELF + +![](images/11f6f0402bbc6f508bf15f26049a283761311e959dbdc83c658ab6b6af5355e4.jpg) +(b)HOW + +![](images/11bf9d0a67bc4eff4b004865f282957e008880b5a859ef81b8185139cce25ba4.jpg) + +![](images/f680f115744a0b743c3f5df7bf6c59d9aec3170189140e0c8549a0b8365bd04f.jpg) + +![](images/e7d3817710d579a432d7d16a17a37cba5b203a0735fb3ab279d7e17d5d2f48fa.jpg) + +![](images/8014560227a81175a6d3686a7a697d5d12dbe96b17555f451a8e8be5b87b0334.jpg) + +![](images/91b68e3f2f02a32150a0f8d39024e925e983fbcf84e8c4b8a50f84346c6d6978.jpg) +(c) Ours + +![](images/afd0d9842ae9abb351abe8eb4b2436da66dc9023a7876d5b0b011c9cd452d2ee.jpg) + +Figure 1. Attention maps of three methods. (a) and (b): attention maps generated by DELF [23] and HOW [37]. (c): attention maps generated by our method. HOW and DELF only generate a single attention map focusing on limited patterns, while our method focuses on diverse patterns by generating multiple attention maps. involves local region detection and image patch description, where the former identifies salient regions of interest in the image which is further described into a vector of predefined dimension by the latter. Before the advent of deep learning, local visual features are designed in a hand-crafted way [20, 2], which is also regarded as a kind of shallow feature. With the introduction of deep learning to computer vision, tremendous progress [35, 21, 7, 6, 37, 23] has been made on local feature learning in a data-driven paradigm. + +Early works on deep local feature ignores the local region detection. Some works [35, 21, 7] assume the im + +age patch is ready from hand-crafted detectors and focus on learning a vector from an image patch with CNNs in a supervised learning way. Some other works [32, 38, 1, 19, 9, 27] directly take the activation map from a convolution layer and regard the channel features in each spatial position of the map as a local feature. Such local feature essentially corresponds to a relatively fixed receptive field in the input image. Recently, more and more research efforts [37, 23, 4, 34] resort to attention learning to discriminate deep local features with only image-level annotation. In those methods, a single attention map is typically extracted to measure the significance of each deep local feature, as illustrated in Fig. 1. Generally, an attention map corresponds to some semantic-aware visual pattern. Considering the diverse content in an image, a single attention map is unlikely to comprehensively capture all potential semantic patterns in an image. + +To address the above issue, we propose a new framework with multiple dynamic attentions to detect diverse local features corresponding to different semantic patterns. In our method, we make use of intermediate feature maps from CNNs to generate attention maps. To decouple different semantic patterns, we introduce a channel mapping layer to adaptively reorganize the channels of input feature maps into multiple groups, each of which is fed to an attention head. In the attention head, we design a new dynamic attention module. Specially, we introduce a diversity regularization to ensure different heads focus on different patterns within the image. In the training stage, we perform attention pooling with the feature map and the multiple attention maps to generate a set of global representations and the whole network is optimized with image-level label. In the testing stage, we make use of those dynamic attention maps to select deep local features to represent each image. To achieve efficient retrieval on large image database, we quantize those deep local features with a codebook and match images with binarized aggregated match kernel [37]. + +Compared with previous attention-based local feature leaning methods, our approach is able to discover more diverse and distinctive local patterns, which favorably benefit the semantic content matching between images. We evaluate our approach on the Revisited Oxford and Paris datasets, which are further mixed with a million distractors. Ablation studies justify the effectiveness of the channel mapping layer, dynamic attention module, and diversity regularization loss. Our approach achieves superior performance over the existing state-of-the-art methods under similar setting. + +# 2. Related Work + +# 2.1. Local feature learning + +Traditional local features [20, 2] are extracted with handcrafted detectors and descriptors based on low-level visual + +information, which limits the discriminative power of local features. More recently, many methods have been proposed to learn the descriptors or detectors with deep neural networks. Savinov et al. [30] train a Quad-network for keypoint detection. Tian et al. [35] introduce second-order similarity to improve patch descriptors for image matching. Mishchuk et al. [21] propose a loss which maximizes the distance between the closest positive and closest negative example in the batch to learn powerful descriptors. Recently, D2-Net [8] and SuperPoint [6] propose an end-to-end framework to detect keypoints and compute descriptors. Although convincing results have been reported, these methods are not designed for the image retrieval task. They focus on image matching or image registration while our work focuses on large-scale image retrieval where memory requirements matter. + +The most relevant works to ours come from [23, 34, 37]. Noh et al. [23] first explore learning local features for image retrieval with visual attention and image-level annotation. The locations with the strongest values on the attention map are selected, while the descriptors are slices of the feature map at selected locations. Based on DELF, Teichmann et al. [34] introduce region proposal network [28] (RPN) to detect objects presented in the image. They only consider local features in the region of interest and filter out irrelevant features. Tolias et al. [37] propose a non-parametric attention module and integrate dimensionality reduction into the network, which is trained by contrastive loss. Compared with the above methods, our work generates multiple disentangled attention maps independently for a single image. This prevents the model from focusing only on limited patterns of the image, thereby ignoring some patterns that may be helpful for image retrieval. + +# 2.2. Local Feature Aggregation + +Due to a large amount of memory required to store local features, many methods have been proposed to aggregate local features into a compact descriptor, such as BOW [33], Hamming Embedding [13], VLAD [14], FV [15] Triangulation [16] and ASMK [36]. Recently, some novel deep local feature aggregation methods are proposed to reorganize deep local features into a compact descriptor. Tolias et al. [38] use sliding windows to extract regional information, and then max-pooling is applied to the activation of each region. Babenko and Lempitsky [1] first propose to use sum-pooling, which performs well due to the subsequent descriptor whitening. Kalantidis et al. [19] apply channel and spatial attention on the activation before sum pooling. After that, GeM-pooling has been shown to give excellent results when trained with ArcFace loss [5]. It allows more than one position in the activation contributing to the aggregated representation, while still being more selective than the sum-pooling. The main advantage of these + +![](images/63529cd5e67913f4a7173253aa23ea811ef80619d16f6d1c399255dc745d0fbe.jpg) + +![](images/3a56b112baa1938ffb62de422ef577d0bd234d0742d5b806dc25e5f8b104e400.jpg) +Figure 2. Framework of our method. The components highlighted in gray are used during testing and training. The whole framework is trained with contrastive loss and diversity regularization to generate multiple discriminative deep local features. Gradient back-propagation is stopped from the multiple dynamic attention into the CNN backbone. During testing, the top $n$ strongest local features, according to the multiple attention maps, are kept to represent the image. Local features are aggregated with binarized ASMK [36] for efficient retrieval. + +aggregation methods is that they provide high-performance image retrieval with a small memory footprint. In this work, we adopt the binarized ASMK as the aggregation method for local features. + +# 2.3. Dimensionality Reduction and Whitening + +Dimensionality reduction is widely used on image features in image retrieval since the memory footprint is critical for retrieval systems. Features with high dimensionality cost a large amount of memory, further slowing down online retrieval. On the other hand, as shown in [12], whitening reduces the co-occurrence of local features, which is beneficial for retrieval. Recently, Gordo et al. [9] propose to replace PCA/whitening with a fully-connected layer, which is learned during training. Tolias et al. [37] follow [9] in using a fully-connected layer to perform dimensionality reduction and whitening, but the parameters of their fully connected layer are learned using PCA and remain constant during training. Cao et al. [4] use an autoencoder to reduce the dimensionality of the extracted local features, and their autoencoder can also be trained end-to-end. In this work, we use the $1 \times 1$ convolutional layer to realize dimensionality + +reduction on the local features, with parameters initialized by the results of PCA and further updated during training. + +# 3. Method + +# 3.1. Framework + +The training and testing pipelines of our approach are illustrated in Fig. 2. Given an image, we apply a CNN backbone to obtain a feature map $S \in \mathcal{R}^{H_S \times W_S \times C_S}$ , where $H_S, W_S, C_S$ correspond to the height, width and number of channels. This feature map can be seen as a set of local descriptors. To select relevant patterns for image retrieval, we develop a new multiple dynamic attention (MDA) module $M$ with $N$ heads to predict which local features are discriminative for the objects of interest. Each head in MDA detects a certain pattern, while different heads focus on different patterns. $M$ first adaptively reorganizes $S$ with a channel mapping layer and then divides it into different groups uniformly. Each group is fed into the attention generation module to learn the attention maps independently. Since thousands of local features will be detected from an image, they must be compact to save memory cost. To this + +![](images/e2e879159bf121087ee06b3357ed29cb5f947295c49f47259a12ab61f96b4ca3.jpg) +Figure 3. An overview of our dynamic attention module. The indicator vector varies with different instances. + +end, we use a convolutional layer for dimension reduction. The local descriptors are obtained as $\mathcal{L} = T(S)$ , where $\mathcal{L}\in \mathcal{R}^{H_S\times W_S\times C_T}$ , and $T$ is a $1\times 1$ convolutional layer with $C_T$ filters. + +During training, we obtain a set of global descriptors by pooling the local descriptors with each attention map. These global descriptors will be used to train the whole network only with image-level annotations. Specifically, we use a diversity regularization term to force different heads to focus on different patterns within the image. During testing, the top $n$ strongest descriptors $l$ from $\mathcal{L}$ are kept according to the importance in multiple attention maps. These local descriptors are used for large-scale image retrieval combined with binarized ASMK [36]. + +# 3.2. Multiple Dynamic Attention Module + +To obtain attention maps that capture different patterns, we devise a multiple dynamic attention module. The feature maps of a convolutional neural network can be interpreted as a collection of 2D response maps of pattern detectors. However, feature channels corresponding to the same visual pattern are often not arranged in order. Given a feature map $S$ generated by backbone, we first use a $1 \times 1$ convolutional channel mapping layer to reorganize the channels: + +$$ +\hat {\mathcal {S}} = \operatorname {C o n v} _ {1 \times 1} (\mathcal {S}), \tag {1} +$$ + +where $\hat{S} \in \mathcal{R}^{H_S \times W_S \times C_S}$ . Then, we divide the feature map $\hat{S}$ into $N$ different groups to represent multiple independent patterns. The collection of the groups is represented by $\mathcal{F} = \left\{F^1, F^2, \dots, F^N\right\}$ , where $F^i$ corresponds to channel $\left[(i - 1) \times \left\lfloor \frac{C_S}{N} \right\rfloor + 1, i \times \left\lfloor \frac{C_S}{N} \right\rfloor\right)$ of $\hat{S}$ . Finally, by feeding each $F^i \in \mathcal{F}$ into the attention generation module, $N$ pieces of attention maps are generated. We denote the set $\mathcal{A} = \left\{A^{(1)}, A^{(2)}, \dots, A^{(N)}\right\}$ as the generated collection of attention maps, where $A^{(i)} \in \mathcal{R}^{H_S \times W_S}$ . + +Fig. 3 illustrates the attention generation module, termed as Dynamic Attention Head (DA). Given an intermediate feature map $F^i \in \mathcal{R}^{H_S \times W_S \times \lfloor \frac{C_S}{N} \rfloor}$ as input, DA first aggregates spatial information of the feature map using average pooling, generating a spatial context descriptors $F_{avg}^i$ . This descriptor is then fed to a $1 \times 1$ convolutional layer to produce our indicator vector $F_g^i \in \mathcal{R}^{1 \times 1 \times \lfloor \frac{C_S}{N} \rfloor}$ . In short, the + +indicator vector is computed as: + +$$ +\begin{array}{l} F _ {g} ^ {i} = \sigma \left(\operatorname {C o n v} _ {1 \times 1} \left(\operatorname {A v g P o o l} \left(F ^ {i}\right)\right)\right) \\ = \sigma \left(\mathbf {W} _ {\mathbf {g}} * F _ {a v g} ^ {i}\right), \\ \end{array} +$$ + +(2) + +where $\sigma$ denotes ReLU function, and $\mathbf{W}_g\in \mathcal{R}^{\lfloor \frac{C_S}{N}\rfloor \times \lfloor \frac{C_S}{N}\rfloor}$ is learned during training. Then, the attention map can be generated as: + +$$ +A ^ {(i)} = \operatorname {S o f t p l u s} \left(F _ {g} ^ {i} \otimes F ^ {i}\right), \tag {3} +$$ + +where $A^{(i)}\in \mathcal{R}^{H_S\times W_S}$ and $\otimes$ denotes element-wise dot product. During multiplication, the indicator vector is broadcasted along the spatial dimension. Softplus is a smooth approximation to the ReLU function and can be used to constrain the output to always be positive. + +In all, our MDA module produces multiple attention maps, each of them focuses on one specific pattern. Multiple attention maps capture different patterns. As shown in Fig. 1, our model focuses on many important and distinguishable patterns within the image, some of which are ignored by other methods. + +# 3.3. Training Stage + +To extract multiple discriminative and repeatable deep local feature regions for each image, we formulate two optimization objectives, i.e., contrastive loss and diversity regularization, to optimize the whole network. + +Given image pairs $(i,j)$ and labels $Y(i,j)\in \{0,1\}$ in which label 1 denotes the image pair is matched, 0 otherwise. We obtain a set of global descriptors $\mathcal{G} = \left\{G^{(1)},G^{(2)},\dots ,G^{(N)}\right\}$ for each image by pooling the local descriptors $\mathcal{L}$ with each attention map in $\mathcal{A}$ : + +$$ +G ^ {(i)} = \sum_ {h \in H _ {S}, w \in W _ {S}} A _ {h, w} ^ {(i)} \mathcal {L} _ {h, w}, \text {f o r} i = 1, 2, \dots , N, \tag {4} +$$ + +each corresponding to a certain head. Contrastive loss is applied to the global descriptor of each head separately. The loss summation for all heads can be defined as follows: + +$$ +\begin{array}{l} L _ {C} = \left(1 - Y (i, j)\right) \sum_ {n = 1} ^ {N} \max \left(m - \left\| \hat {G} _ {i} ^ {(n)} - \hat {G} _ {j} ^ {(n)} \right\| _ {2}\right) ^ {2} \\ + Y (i, j) \sum_ {n = 1} ^ {N} \left\| \hat {G} _ {i} ^ {(n)} - \hat {G} _ {j} ^ {(n)} \right\| _ {2} ^ {2}, \tag {5} \\ \end{array} +$$ + +where $m$ is the margin, $N$ is the head number and $\hat{G}_i^{(n)}$ is the $l_{2}$ -normalized global descriptor $G_i^{(n)}$ . It enforces the corresponding global descriptor of each head to be highly distinguishable to discriminate whether the given image pair is matched or not. + +For a given image, there is no guarantee that the attention map generated by one attention head is different from that of another head. Therefore, multiple attention heads may focus on the same pattern within image. We need to ensure + +that different heads focus on different patterns of the given image to maximize the pattern information contained in the final descriptors. In other words, we should maximize the distance between any two attention maps. + +For each attention map $A_{i}\in \mathcal{A}$ , we first flatten it into a vector $a_{i}\in \mathcal{R}^{HSWs}$ and apply the softmax function on it to make sure that the attention scores at all positions are positive and add up to one, as follows: + +$$ +\hat {a} _ {i} = \operatorname {s o f t m a x} \left(a _ {i}\right), \text {f o r} i = 1, 2, \dots , N. \tag {6} +$$ + +Then, the Hellinger distance [3] between $\hat{a}_i\in \mathcal{R}^{H_S W_S}$ and $\hat{a}_j\in \mathcal{R}^{H_S W_S}$ is defined as: + +$$ +H \left(\hat {a} _ {i}, \hat {a} _ {j}\right) = \frac {1}{\sqrt {2}} \left\| \sqrt {\hat {a} _ {i}} - \sqrt {\hat {a} _ {j}} \right\| _ {2}. \tag {7} +$$ + +Since $\sum_{l=1}^{H_S W_S} \hat{a}_{i,l} = 1$ : + +$$ +H \left(\hat {a} _ {i}, \hat {a} _ {j}\right) ^ {2} = 1 - \left\langle \sqrt {\hat {a} _ {i}}, \sqrt {\hat {a} _ {j}} \right\rangle , \tag {8} +$$ + +where $\langle \sqrt{\hat{a}_i},\sqrt{\hat{a}_j}\rangle$ represents the dot product between vector $\sqrt{\hat{a}_i}$ and $\sqrt{\hat{a}_j}$ . + +To increase the diversity of the attention maps, we should maximize the distance between each $\hat{a}_i$ and $\hat{a}_j$ . Thus, the regularization term to measure the similarities between attention maps is defined as: + +$$ +L _ {r e g} = \frac {1}{N (N - 1)} \sum_ {i = 1} ^ {N} \sum_ {j \neq i} ^ {N} \left(\left\langle \sqrt {\hat {a} _ {i}}, \sqrt {\hat {a} _ {j}} \right\rangle - 1\right). \tag {9} +$$ + +The final objective function is a combination of contrastive loss and diversity regularization balanced by $\lambda$ , as follows: + +$$ +L = L _ {C} + \lambda L _ {\text {r e g}}. \tag {10} +$$ + +# 3.4. Testing Stage + +During testing, local features are selected according to the importance given by $\mathcal{A}$ . Attention values from all heads are ranked jointly, and the local features corresponding to the top $n$ largest attention values are returned. Fig. 4 shows some examples of local features detected by different attention heads, which are well aligned in two views of a sample landmark. Furthermore, multi-scale extraction is performed during testing. We combine local features from all scales as the local descriptor set $\mathcal{X} = \{x_1, x_2, \ldots, x_n\}$ . Binarized aggregated match kernel framework [36] (ASMK*) is adopted to aggregate local features and compute similarities between images. The aggregated vectors are further indexed for efficient retrieval. + +In $\mathrm{ASMK}^*$ framework, an image $X$ is described by a set of $nC_T$ -dimensional local descriptors $\mathcal{X}$ . These descriptors are quantized by a codebook $\mathcal{C}$ with $C$ visual words, learned using k-means. Denote $\mathcal{X}_c = \{x\in \mathcal{X}:q(x) = c\}$ as the subset of descriptors in $X$ which are assigned to visual + +![](images/dac7b5eb7082902be04207df82b10d29beedf5a7007ca11a21764da5152d4474.jpg) + +![](images/955cf8a550fde0f0d906e7be553b93c2da43b92d93a3f42e4fa5e6208884295f.jpg) + +![](images/10fb19a80f432e5490b27351a34004c05165fba8c21756d2fadd8058b76ee1d2.jpg) + +![](images/b4d45101a3662c0c5daebe87833ad6811809840a4fba4aa4e4bc5490019eaee1.jpg) + +![](images/4ebd557dfdb2e8981fac2689640258ba3098c814415ceef51c9deb6806752984.jpg) +Figure 4. Qualitative examples of local features detected by four different attention heads on four pairs of matched images in ROxf dataset [26]. Features detected by same head are shown in the same color; only top 25 local features of each head are plotted. + +![](images/240872810e0308a9889442258a026c4b9a4cbcbe0fa7ec11a11593d553b9ea4f.jpg) + +![](images/1dc66c1d41ebe75497e960ddf5199573deac3e8b5f8e23f3bf624c9e3e820c01.jpg) + +![](images/75de6b879f37c6fc82e88319239aa69f7accbc6950a9c69609d595de86d4f50f.jpg) + +word $c$ . The similarity between two images $X$ and $Y$ can be computed as: + +$$ +K (X, Y) = \gamma (\mathcal {X}) \gamma (\mathcal {Y}) \sum_ {c \in \mathcal {C}} \sigma_ {\alpha} \left(\Phi \left(\mathcal {X} _ {c}\right) ^ {T} \Phi \left(\mathcal {Y} _ {c}\right)\right), \tag {11} +$$ + +where $\mathcal{X}$ and $\mathcal{Y}$ denote local features sets of $X$ and $Y$ respectively. $\Phi (\mathcal{X})$ is an aggregated vector representation, $\sigma_{\alpha}(\cdot)$ denotes a scalar selectivity function and $\gamma (\mathcal{X})$ is the normalization factor. See [36] for the detailed definitions of above formulations. + +# 4. Experiment + +# 4.1. Experimental Setup + +Training dataset. The training dataset $SfM120k$ [27] is used. It is obtained by 3D reconstruction of large collections of unlabelled images [31]. Given a large unannotated image collection, images are clustered and a 3D model is constructed per cluster. Matching pairs (anchor-positive) are formed by images with a sufficient number of co-observed 3D points (same 3D model). Non-matching pairs (anchor-negative) come from different 3D models. We use 551 3D models for training and 162 for validation. + +Evaluation datasets and metrics. $\mathcal{R}\mathrm{Oxf}$ , $\mathcal{RPa}$ , $\mathcal{ROxf} + \mathcal{R1M}$ , and $\mathcal{RPa} + \mathcal{R1M}$ are used to evaluate our method. The $\mathcal{R}\mathrm{Oxf}$ and $\mathcal{RPa}$ [26] datasets are the revisited version of the original Oxford5k [24] and Paris6k datasets [25]. Both datasets contain 70 query images, and additionally include 4,993 and 6,322 database images respectively. Mean Average Precision (mAP) is used to evaluate the performance. There are three evaluation setups for these two datasets: Easy, Medium, and Hard. We report the Medium and Hard performance of $\mathcal{R}\mathrm{Oxf}$ and $\mathcal{RPa}$ . Large-scale results are further reported with the $\mathcal{R1M}$ distractors [26], which contains 1M images. + +Implementation details. We use ResNet50 as backbone network, initialized by pre-training on ImageNet [11]. We obtain the feature map $S$ from the Conv4 output. Following + +Tolias et al. [37], we also perform $3 \times 3$ average pooling before dimensionality reduction. + +For training, each mini-batch contains 5 tuples, where a tuple consists of 7 images (1 query, 1 positive, and 5 negative images). Before each epoch, we randomly choose 2000 anchor-positive pairs and 20,000 candidate negative images. Hard-negative mining is performed to select 5 most difficult negative samples for each anchor-positive pair. We resize training images with the larger dimension equal to 921 pixels, preserving the aspect ratio. The model is optimized using Adam with weight decay equal to $10^{-6}$ , and an exponentially decaying learning rate with a decay rate of 0.99. The initial learning rate is set as $10^{-5}$ and $5 * 10^{-5}$ for the backbone and attention module, respectively. We set the margin $m = 0.9$ , the weight for $L_{reg}$ to $\lambda = 0.3$ and local feature dimension $C_T = 128$ . We conduct experiments with head numbers within $\{1,2,4,6,8,10,12\}$ and report results for the best performing one. + +For testing, the default ASMK* configuration from Tolias et al. [36] is adopted. We use a codebook of size $C = 65,536$ . The codebook is learned on the local descriptors of the 5000 training image extracted at the original scale. Images are resized to the same size as training. We use 7 different scales, ranging from 0.25 to 2.0 and increasing by a factor of $\sqrt{2}$ , to construct the image pyramids. These pyramids are fed to the network, and the resulting local features from all the scales are combined. The top 2000 strongest local descriptors are selected for each image. When searching online, each local feature of the query image is assigned to 5 nearest visual words. We use the inverted index to speed up the online search. Specifically, using $k$ -means for codebook creation may lead to the randomness of results. We run each experiment 5 times and report the mean and standard deviation. In large-scale experiments, multiple visual word assignments are not performed to reduce the computational cost of online retrieval. Unless otherwise stated, the default configuration is used. + +# 4.2. Ablation Experiments + +Head numbers. Fig. 5 shows the mAP of our method on the Hard and Medium protocols of $\mathcal{R}\mathrm{Oxf - }\mathcal{RPa}$ for $N$ within $\{1,2,4,6,8,10,12\}$ . The mAP increases as $N$ is raised from 1 to 8, then drops when $N\geq 10$ . When $N = 1$ , our method achieves average performance equal to 57.8 and 64.2 in terms of mAP on Hard protocol for $\mathcal{R}\mathrm{Oxf - }\mathcal{RPa}$ , which outperforms HOW by 0.9 and 1.4 respectively. It proves that our DA can learn better local features. + +Attention generation module. As shown in Fig. 6, the attention module of DELF [23] and HOW [37] can be regarded as the dot product of the indicator vector and the current feature map. In DELF, the attention map is simply generated by two $1 \times 1$ convolutional layers. The first convolutional layer is used for dimensionality reduction, and the + +![](images/85b12ae7cabdc4d304afdf1977cb93ef9df23e3d49a7de443c1f80d1201239c5.jpg) +Figure 5. Comparison of mAP against head num on $\mathcal{R}\mathrm{Oxf - }\mathcal{RP}$ + +![](images/e1a0580fc7252e06d0cedc5fc198f2978d3e40ee048a54ea43f76fdffc1548f9.jpg) + +![](images/422ab0d8f9f8642c8bf7129c20f0b851fb0a071d374e0508593822d470c6664e.jpg) +Figure 6. Comparisons of different attention modules. DELF [23] uses a 2-layer CNN as the attention module, and the indicator vector is the weight of the second convolutional layer, which is learned during training. HOW [37] uses $l_{2}$ norm of the feature descriptor as the attention score, thus the indicator vectors are the current feature descriptors. + +
Attention ModuleStop GradientMediumHard
ROfxRParROfxRPar
1 × 1 conv [23]✓80.5 ± 0.282.7 ± 0.160.6 ± 0.365.4 ± 0.3
l2 norm [37]✓80.9 ± 0.281.5 ± 0.160.5 ± 0.364.0 ± 0.2
1 × 1 conv + l2 norm✓80.4 ± 0.182.3 ± 0.260.5 ± 0.264.8 ± 0.3
DA (ours)✗80.5 ± 0.382.1 ± 0.260.3 ± 0.664.0 ± 0.1
DA (ours)✓81.8 ± 0.383.3 ± 0.262.2 ± 0.566.2 ± 0.2
+ +Table 1. Impact of the attention generation module on mAP on ROxf and RPar [26]. Results with head num $N = 8$ , feature num $n = 2000$ and local dimension $C_T = 128$ . + +indicator vector is the weight of the second convolutional layer, which can be interpreted as a generalized feature of the foreground. It outputs similarly for various foreground features. However, foreground objects are diverse in different images. Only using a fixed indicator vector limits the discriminative power of local features. For HOW, the indicator vectors are equal to the current feature map. The $l_{2}$ norm of the corresponding local feature is directly used as attention value, which is also sub-optimal for extracting discriminative local features. + +In Tab. 1, we compare the attention generation module of different methods. $1 \times 1$ conv and $l_{2}$ norm denote the attention generation methods of DELF and HOW, as shown in Fig. 6. Besides, we simply combine the attention maps generated by these two approaches ( $1 \times 1$ conv + $l_{2}$ norm). DA is the proposed attention generation module that dynamically generates different indicator vectors for each image, as discussed in Section 3.2. It can be seen that our DA head outperforms $1 \times 1$ conv and $l_{2}$ norm. + +Stop gradient. The last two rows of Tab. 1 shows that + +naively optimizing the whole network leads to suboptimal results because the attention module is trained from scratch, which may produce wrong gradients in the early stages of training. We address this issue by stopping gradient backpropagation from the attention branch to the network backbone. This means that the network backbone is optimized solely based on $L_{C}$ , and produces the desired distinctive feature representation. As shown in Tab. 1, controlling the gradient allows for better training of the network. + +
Channel MappingDiversity RegularizationMediumHard
\( \mathcal{R}\mathrm{Oxf} \)\( \mathcal{RPa} \)\( \mathcal{R}\mathrm{Oxf} \)\( \mathcal{RPa} \)
✓79.7 ± 0.380.1 ± 0.259.4 ± 0.661.2 ± 0.2
✓80.3 ± 0.182.2 ± 0.160.2 ± 0.264.7 ± 0.2
✓✓81.8 ± 0.383.3 ± 0.262.2 ± 0.566.2 ± 0.2
+ +Table 2. Ablation studies on each component corresponding to the diversity of attention maps. We gradually remove the channel mapping layer and diversity regularization in MDA. All models are trained with head num $N = 8$ , local dim $C_T = 128$ and we extract $n = 2000$ local features for each image. + +![](images/f93ad17dc0cbdd6f81a568e1f5e7eb048e4feb0ab8834f24f2f90b4b9d3caafa.jpg) +Figure 7. Comparison of local features, trained separately or jointly, with different methods for dimensionality reduction. + +![](images/25ea802e8e21d2259818eb681e560a9efa760c1a962aaa822174dd8f0386d50a.jpg) + +Diversity of attention maps. To differentiate the distributions of attention maps, we introduce a channel mapping layer and diversity regularization. As shown in Tab. 2, without the channel mapping layer, diversity regularization alone yields unsatisfactory results. We attribute the loss to feature channels that respond to certain types of visual patterns are usually not arranged in order. If we simply divide the channel into several parts, each head will fail to learn different attention maps. Without diversity regularization, each head may generate similar attention maps and our MDA module may degrade to a single attention module. By jointly employing both of these two components, our method obtains obvious performance improvements. + +Some qualitative results of the attention maps are shown in Fig. 8, where each row is the attention maps generated by the same attention head. It can be seen that different heads focus on different patterns in the image and each head focuses on a specific pattern, which implicitly enables pattern-alignment. For example, the first head focuses on the upper edge of the window, while the third head focuses on the sharp bumps and contours. + +Dimensionality reduction. We compare the influence of feature dimension when local features are trained with dif- + +
MethodLocal DimMediumHard
\( \mathcal{R}\mathbf{O}\mathbf{x}\mathbf{f} \)\( \mathcal{R}\mathbf{P}\mathbf{a}\mathbf{r} \)\( \mathcal{R}\mathbf{O}\mathbf{x}\mathbf{f} \)\( \mathcal{R}\mathbf{P}\mathbf{a}\mathbf{r} \)
\( \mathrm{DELF}\left[23\right]^{\dagger } \)3272.2±0.375.2±0.148.2±0.551.3±0.2
6476.6±0.380.1±0.254.8±0.460.7±0.3
9678.5±0.181.2±0.256.6±0.362.4±0.3
HOW [37]3272.5±0.372.7±0.449.6±0.450.1±0.3
6476.4±0.379.1±0.254.1±0.359.6±0.3
9678.5±0.280.2±0.356.4±0.261.4±0.2
Ours3274.6±0.376.9±0.351.9±0.655.0±0.4
6479.5±0.281.1±0.259.2±0.362.7±0.2
9681.0±0.382.1±0.360.2±0.465.0±0.2
+ +Table 3. The effect of local feature dimension. DELF marked by $\dagger$ is an improvement of the original method: dimensionality reduction is no longer used as post-processing but is integrated into the network for end-to-end training and contrastive loss is used. + +![](images/be7980a858b28ab9b2b70c81c1bf1db7d2471c693111bdb32411a1cec1e11e23.jpg) +Figure 8. Qualitative examples of multiple dynamic attention maps on the ROxf datasets [26]. Each column depicts the source image and four corresponding attention maps obtained for four randomly selected heads. + +ferent attention modules. The performance for varying descriptor dimensions is shown in Tab. 3. Our method works better in all dimensions than DELF and HOW. + +In Fig. 7, we present ablation experiments on different types of dimensionality reduction. First, we use a $1 \times 1$ convolutional layer to reduce the dimensionality, with parameters learned during training (CONV). Second, dimensionality reduction is used as a post-processing, which is denoted as PCA. High-dimensional features are used during training and PCA is used to reduce the dimensionality of the features at the end of training. Third, we jointly train an autoencoder (AE) for dimensionality reduction. It consists of two convolutional layers, with the first layer reducing the dimension of + +
MethodLossTrain SetMemory(GB)MediumHard
\( \mathcal{R}\mathcal{O}\mathcal{X}\mathcal{f} \)\( \mathcal{R}\mathcal{O}\mathcal{X}\mathcal{f}+\mathcal{R}\mathcal{I}\mathcal{M} \)\( \mathcal{R}\mathcal{P}\mathcal{A}\mathcal{r} \)\( \mathcal{R}\mathcal{P}\mathcal{A}\mathcal{r}+\mathcal{R}\mathcal{I}\mathcal{M} \)\( \mathcal{R}\mathcal{O}\mathcal{X}\mathcal{f} \)\( \mathcal{R}\mathcal{O}\mathcal{X}\mathcal{f}+\mathcal{R}\mathcal{I}\mathcal{M} \)\( \mathcal{R}\mathcal{P}\mathcal{A}\mathcal{r} \)\( \mathcal{R}\text{Par}+\mathcal{R}\mathbf{1}\mathbf{M} \)
Compact global descriptors
R101-R-MAC [9]TripletNC-clean7.660.939.378.954.832.412.559.428.0
R101-GeM [27]TripletSfM-120k7.664.745.277.252.338.519.956.324.7
R101-GeM↑[32]TripletSfM-120k7.665.346.177.352.639.622.256.624.8
R101-GeM-AP [29]APNC-clean7.667.547.580.152.542.823.260.525.1
R101-GeM-AP [29]APGLDv1-noisy7.666.3-80.2-42.5-60.8-
R101-GeM+SOLAR [22]Triplet/SOSGLDv1-noisy7.669.653.581.659.247.929.964.533.4
R50-DELG [4]ArcFaceGLDv1-noisy7.669.755.081.659.745.127.863.434.1
R101-DELG [4]ArcFaceGLDv1-noisy7.673.254.882.461.851.230.364.735.5
R50-DELG [4]ArcFaceGLDv2-clean7.673.660.685.768.651.032.771.544.4
R101-DELG [4]ArcFaceGLDv2-clean7.676.363.786.670.655.637.572.446.9
Local features aggregation with binarized ASMK
HesAff-rSIFT-ASMK* [26], \( C_T = 128 \)--62.060.445.061.242.036.425.734.516.5
\( ^{-}\mathrm {R}50\text{-}\mathrm {D}\mathrm {E}\mathrm {L}\mathrm {F}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*}+\mathrm {S}\mathrm {P} \left[26\right], n = 1000, C_T = 128 \)CEGLDv1-noisy9.267.853.876.957.343.131.255.426.4
\( ^{-}\mathrm {R}50\text{-}\mathrm {D}\mathrm {E}\mathrm {L}\mathrm {F}\text{-}\mathrm {D}\mathrm {2}\mathrm {R}\text{-}\mathrm {R}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left[34\right], n = 1000, C_T = 128 \)CEGLDv1-noisy27.673.361.080.760.247.633.661.329.9
\( ^{-}\mathrm {R}50\text{-}\mathrm {D}\mathrm {E}\mathrm {L}\mathrm {F}\text{-}\mathrm {D}\mathrm {2}\mathrm {R}\text{-}\mathrm {R}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*}+\mathrm {S}\mathrm {P} \left[34\right], n = 1000, C_T = 128 \)CEGLDv1-noisy27.676.064.080.259.752.438.158.629.4
\( ^{-}\mathrm {R}50\text{-}\mathrm {H}\mathrm {OW}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left[37\right], n = 1000, C_T = 128 \)ContrastiveSfM-120k7.678.363.680.158.455.836.860.130.7
\( ^{-}\mathrm {R}50\text{-}\mathrm {H}\mathrm {OW}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left[37\right], n = 1200, C_T = 128 \)ContrastiveSfM-120k9.278.864.580.659.656.737.761.031.7
\( ^{-}\mathrm {R}50\text{-}\mathrm {H}\mathrm {OW}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left[37\right], n = 1400, C_T = 128 \)ContrastiveSfM-120k10.679.164.981.060.456.838.261.532.6
\( ^{-}\mathrm {R}50\text{-}\mathrm {H}\mathrm {OW}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left[37\right], n = 2000, C_T = 128 \)ContrastiveSfM-120k14.379.465.881.661.856.938.962.433.7
\( ^{-}\mathrm {R}50\text{-}\mathrm {M}\mathrm {DA}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left(\mathrm {Ours}\right), n = 2000, C_T = 64 \)ContrastiveSfM-120k7.479.565.681.161.359.242.662.735.0
\( ^{-}\mathrm {R}50\text{-}\mathrm {M}\mathrm {DA}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left(\mathrm {Ours}\right), n = 1000, C_T = 128 \)ContrastiveSfM-120k7.681.566.581.861.861.943.163.736.1
\( ^{-}\mathrm {R}50\text{-}\mathrm {M}\mathrm {DA}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left(\mathrm {Ours}\right), n = 1200, C_T = 128 \)ContrastiveSfM-120k8.981.967.582.362.962.343.764.637.1
\( ^{-}\mathrm {R}50\text{-}\mathrm {M}\mathrm {DA}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left(\mathrm {Ours}\right), n = 1400, C_T = 128 \)ContrastiveSfM-120k10.182.067.982.763.662.644.665.237.8
\( ^{-}\mathrm {R}50\text{-}\mathrm {M}\mathrm {DA}\text{-}\mathrm {A}\mathrm {S}\mathrm {M}\mathrm {K}^{*} \left(\mathrm {Ours}\right), n = 2000, C_T = 128 \)ContrastiveSfM-120k13.481.868.783.364.762.245.366.238.9
+ +Table 4. mAP comparison against retrieval state-of-the-art methods on the ROxford (ROxf) and RParis (RPar) datasets (and their large-scale extensions ROxf+R1M and RPar+R1M), with Medium and Hard evaluation protocols. Memory is reported for R1M distractor set. The datasets used for training are shown in brackets. ↑:upsampling; SP:spatial matching [24]. We denote ResNet101 and ResNet50 by R101 and R50. ~R50 refers to a version of ResNet50 with the last block skipped. + +features and the second layer restoring the original features. Mean-squared error loss that measures how well the autoencoder can reconstruct features is used to guide its learning. From Fig. 7, our method (CONV) achieves the best results compared to other methods for both datasets and different evaluation protocols. + +# 4.3. Comparison with the State-of-the-Art + +mAP comparison. We conduct an extensive comparison of our method with state-of-the-art methods. All methods are tested on ROxf, ROxf+R1M, RPar and RPar+R1M. The results are shown in Tab. 4. Our MDA achieves the best mAP performance in most cases. We outperform previous state-of-the-art local aggregation methods in terms of mAP in the most challenging Hard protocol for ROxf and RPar by significant $5.7\%$ and $3.8\%$ gains respectively. For R1M, MDA also achieves the highest performance across local aggregation methods, outperforming in mAP the SOTA by $2.9\%$ on ROxf-Medium, $6.4\%$ on ROxf-Hard; and by $2.9\%$ on RPar-Medium, $5.2\%$ on RPar-Hard. The bottom fifth row of Tab. 4 shows that when we use 64-dimensional local features, we can still achieve comparable performance to the previous state-of-the-art method. The improvements are even higher when compared to global descriptors. + +Speed and memory costs. In Tab. 4, we list the memory footprint required by different methods for $\mathcal{R}1\mathrm{M}$ . It should be noted that the memory requirement for local aggregation methods is higher than for global features e.g. 14.3GB as reported in HOW [37] vs. 7.6GB for GeM [27] descriptors in the $\mathcal{R}1\mathrm{M}$ -distractors set. Our method and HOW have almost the same memory footprint. For images with $n = 1000$ and $n = 2000$ local features, our method re + +quires 7.6GB and 13.4GB of memory, respectively. We can further reduce the memory requirement by reducing the dimension of local features e.g. 7.4GB when $n = 2000$ and $C_T = 64$ , which is less than GeM descriptors. It takes an average of 140ms for our method to extract 2000 local features from an image, which is a bit slower than HOW [37] (e.g. 127ms), on an RTX 2080Ti GPU. When 1000 local features are extracted from an image, it takes on average 0.71 seconds to search on $\mathcal{R}\mathrm{Oxf} + \mathcal{R}\mathrm{1M}$ with the help of inverted index implemented by Python, which proves the potential of our method on real-time image retrieval. + +# 5. Conclusions + +In this paper, we propose a novel local feature learning framework for image retrieval. It contains a multi-dynamic attention module to simultaneously detect multiple discriminative local patterns in images, which allows for a more comprehensive capture of various semantic information of the image. The proposed network only needs image-level annotations and can be trained end-to-end. Extensive experiments demonstrate superior performance on image retrieval benchmark datasets. In the future, we will expand the research in two directions. First, how to integrate the large visual codebook and quantization process into a framework for end-to-end training. Second, how to introduce multiscale structures into the network, without resizing images to multi-scales during testing. + +Acknowledgements. This work was supported in part by the National Key R&D Program of China under contract 2018YFB1402605, in part by the National Natural Science Foundation of China under Contract 61822208 and 62021001, and in part by the Youth Innovation Promotion Association CAS under Grant 2018497. It was also supported by the GPU cluster built by MCC Lab of Information Science and Technology Institution, USTC. + +# References + +[1] Artem Babenko and Victor Lempitsky. Aggregating deep convolutional features for image retrieval. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1269-1277, 2015. 2 +[2] Herbert Bay, Tinne Tuytelaars, and Luc Van Gool. SURF: Speeded up robust features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 404-417, 2006. 1, 2 +[3] Rudolf Beran et al. Minimum hellinger distance estimates for parametric models. The annals of Statistics, pages 445-463, 1977. 5 +[4] Bingyi Cao, André Araujo, and Jack Sim. Unifying deep local and global features for image search. In Proceedings of the European Conference on Computer Vision (ECCV), pages 726-743, 2020. 2, 3, 8 +[5] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. ArcFace: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2 +[6] Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops (CVPRW), pages 224-236, 2018. 1, 2 +[7] Jiri Matas Dmytro Mishkin, Filip Radenovic. Repeatability is not enough: Learning discriminative affine regions via discriminability. In Proceedings of the European Conference on Computer Vision (ECCV), 2018. 1 +[8] Mihai Dusmanu, Ignacio Rocco, Tomas Pajdla, Marc Pollefeys, Josef Sivic, Akihiko Torii, and Torsten Sattler. D2-net: A trainable cnn for joint description and detection of local features. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8092-8101, 2019. 2 +[9] Albert Gordo, Jon Almazan, Jerome Revaud, and Diane Larlus. End-to-end learning of deep visual representations for image retrieval. International Journal of Computer Vision (IJCV), pages 237-254, 2017. 1, 2, 3, 8 +[10] Zhang Hanwang, Zha Zheng-Jun, Yan Shuicheng, Bian Jingwen, and Chua Tat-Seng. Attribute feedback. Proceedings of the ACM international conference on Multimedia (MM), pages 79-88, 2012. 1 +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 5 +[12] Hervé Jégou and Ondrej Chum. Negative evidences and co-occurrences in image retrieval: the benefit of pca and whiten-ing. In Proceedings of the European Conference on Computer Vision (ECCV), 2012. 3 +[13] Herve Jegou, Matthijs Douze, and Cordelia Schmid. Hamming embedding and weak geometric consistency for large scale image search. In Proceedings of the European Conference on Computer Vision (ECCV), pages 304-317, 2008. 2 + +[14] Hervé Jégou, Matthijs Douze, Cordelia Schmid, and Patrick Pérez. Aggregating local descriptors into a compact image representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3304-3311, 2010. 2 +[15] Hervé Jégou, Florent Perronnin, Matthijs Douze, Jorge Sánchez, Patrick Pérez, and Cordelia Schmid. Aggregating local image descriptors into compact codes. IEEE transactions on pattern analysis and machine intelligence (TPAMI), pages 1704-1716, 2011. 2 +[16] Hervé Jégou and Andrew Zisserman. Triangulation embedding and democratic aggregation for image search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3310-3317, 2014. 2 +[17] Cai Junjie, Zha Zheng-Jun, Wang Meng, Zhang Shiliang, and Tian Qi. An attribute-assisted reranking model for web image search. IEEE transactions on image processing (TIP), pages 261-272, 2014. 1 +[18] Cai Junjie, Zha Zheng-Jun, Zhou Wengang, and Tian Qi. Attribute-assisted reranking for web image retrieval. Proceedings of the ACM international conference on Multimedia (MM), pages 873-876, 2012. 1 +[19] Yannis Kalantidis, Clayton Mellina, and Simon Osindero. Cross-dimensional weighting for aggregated deep convolutional features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 685-701, 2016. 1, 2 +[20] David G Lowe. Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision (IJCV), pages 91-110, 2004. 1, 2 +[21] Anastasiya Mishchuk, Dmytro Mishkin, Filip Radenovic, and Jiri Matas. Working hard to know your neighbor's margins: Local descriptor learning loss. In Conference and Workshop on Neural Information Processing Systems (NeurIPS), 2017. 1, 2 +[22] Tony Ng, Vassileios Balntas, Yurun Tian, and Krystian Mikolajczyk. SOLAR: second-order loss and attention for image retrieval. In Proceedings of the European Conference on Computer Vision (ECCV), pages 253-270, 2020. 8 +[23] Hyeonwoo Noh, Andre Araujo, Jack Sim, Tobias Weyand, and Bohyung Han. Large-scale image retrieval with attentive deep local features. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 3456-3465, 2017. 1, 2, 6, 7 +[24] James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1-8, 2007. 5, 8 +[25] James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Lost in quantization: Improving particular object retrieval in large scale image databases. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1-8, 2008. 5 +[26] Filip Radenović, Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Revisiting oxford and paris: Large-scale image retrieval benchmarking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5706-5715, 2018. 5, 6, 7, 8 + +[27] Filip Radenović, Giorgos Tolias, and Ondrej Chum. Finetuning cnn image retrieval with no human annotation. IEEE transactions on pattern analysis and machine intelligence (TPAMI), pages 1655-1668, 2018. 1, 2, 5, 8 +[28] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Conference and Workshop on Neural Information Processing Systems (NeurIPS), pages 91-99, 2015. 2 +[29] Jerome Revaud, Jon Almazán, Rafael S Rezende, and Cesar Roberto de Souza. Learning with average precision: Training image retrieval with a listwise loss. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5107-5116, 2019. 8 +[30] Nikolay Savinov, Akihito Seki, Lubor Ladicky, Torsten Sattler, and Marc Pollefeys. Quad-networks: Unsupervised learning to rank for interest point detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 2 +[31] Johannes L. Schonberger, Filip Radenovic, Ondrej Chum, and Jan-Michael Frahm. From single image query to detailed 3d reconstruction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 5 +[32] Oriane Simeoni, Yannis Avrithis, and Ondrej Chum. Local features and visual words emerge in activations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2, 8 +[33] Josef Sivic and Andrew Zisserman. Video google: A text retrieval approach to object matching in videos. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1470-1470, 2003. 2 +[34] Marvin Teichmann, Andre Araujo, Menglong Zhu, and Jack Sim. Detect-to-retrieve: Efficient regional aggregation for image search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5109-5118, 2019. 2, 8 +[35] Yurun Tian, Xin Yu, Bin Fan, Fuchao Wu, Huub Heijnen, and Vassileios Balntas. SOSNet: Second order similarity regularization for local descriptor learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 +[36] Giorgos Tolias, Yannis Avrithis, and Hervé Jégou. To aggregate or not to aggregate: Selective match kernels for image search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1401-1408, 2013. 2, 3, 4, 5, 6 +[37] Giorgos Tolias, Tomas Jenicek, and Ondrej Chum. Learning and aggregating deep local descriptors for instance-level recognition. In Proceedings of the European Conference on Computer Vision (ECCV), pages 460-477, 2020. 1, 2, 3, 6, 7, 8 +[38] Giorgos Tolias, Ronan Sicre, and Hervé Jégou. Particular Object Retrieval With Integral Max-Pooling of CNN Activations. In International Conference on Learning Representations (ICLR), pages 1-12, 2016. 1, 2 \ No newline at end of file diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/images.zip b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f86373d2bc34d74ecd6e148e869a9819833bcc2b --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10418b4bd6d675388b0558b92a72b72b10322b63b33df4312b4ea2b1915acb1a +size 745729 diff --git a/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/layout.json b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0b696fc9bd4a7c3b6f06a2e4b7d3ef222a762444 --- /dev/null +++ b/learningdeeplocalfeatureswithmultipledynamicattentionsforlargescaleimageretrieval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f80f773bd91c1dce6ebd8c8bc83afa980828c4039d2febd8eb63c71dc7e27164 +size 433167 diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_content_list.json b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..be7c31020aa61524d4c7bfa3c15ad5c1ee2a9694 --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d3b54beb01df1135d83387917d40a69d533c34eb1e409f89fb3c8122db45e8 +size 99200 diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_model.json b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9b5348b223bbee505ab005d5bf1116e61b2d8ddf --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04006853c96da4a865375061813389c0f026b2a13a848dcb0ef4604e568f2e1b +size 124677 diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_origin.pdf b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e53c2cb07268ce7a7984742c44c9bc7810c61c8a --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/78bfc63f-2b16-4841-988e-4f6f74b54c32_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc5a36ffb794af3366595eea4d7068ef4e13c0fc29009145830eb959a8c59aea +size 7660575 diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/full.md b/learningdualpriorsforjpegcompressionartifactsremoval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5d0db8cd827388c1e5cf764b0023ce0309608eb5 --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/full.md @@ -0,0 +1,484 @@ +# Learning Dual Priors for JPEG Compression Artifacts Removal + +Xueyang Fu $^{1}$ , Xi Wang $^{1}$ , Aiping Liu $^{1}$ , Junwei Han $^{2}$ , Zheng-Jun Zha $^{1*}$ $^{1}$ University of Science and Technology of China, China + $^{2}$ Northwestern Polytechnical University, China + +$\{xyfu, aipingl, zhazj\} @ustc.edu.cn, wangxxi@mail.ustc.edu.cn, jhan@nwpu.edu.cn$ + +# Abstract + +Deep learning (DL)-based methods have achieved great success in solving the ill-posed JPEG compression artifacts removal problem. However, as most DL architectures are designed to directly learn pixel-level mapping relationships, they largely ignore semantic-level information and lack sufficient interpretability. To address the above issues, in this work, we propose an interpretable deep network to learn both pixel-level regressive prior and semantic-level discriminative prior. Specifically, we design a variational model to formulate the image de-blocking problem and propose two prior terms for the image content and gradient, respectively. The content-relevant prior is formulated as a DL-based image-to-image regressor to perform as a de-blocker from the pixel-level. The gradient-relevant prior serves as a DL-based classifier to distinguish whether the image is compressed from the semantic-level. To effectively solve the variational model, we design an alternating minimization algorithm and unfold it into a deep network architecture. In this way, not only the interpretability of the deep network is increased, but also the dual priors can be well estimated from training samples. By integrating the two priors into a single framework, the image de-blocking problem can be well-constrained, leading to a better performance. Experiments on benchmarks and real-world use cases demonstrate the superiority of our method to the existing state-of-the-art approaches. + +# 1. Introduction + +With the rapid development of consumer devices (e.g., digital cameras and smartphones) and wireless network, the number of images and videos has achieved explosive + +*Corresponding author: Zheng-Jun Zha. This work was supported in part by the National Key Research and Development Program of China under Grant 2020AAA0105702; in part by the National Natural Science Foundation of China (NSFC) under Grants U19B2038 and 61901433; in part by the University Synergy Innovation Program of Anhui Province under Grant GXXT-2019-025; and in part by the USTC Research Funds of the Double First-Class Initiative under Grant YD2100002003. + +growth, which has brought more pressure and challenges to storage and transmission systems. To save the storage capacity and transmission bandwidth, captured images and videos are usually compressed to reduce information redundancy. Lossy compression algorithms, e.g., Joint Photographic Experts Group (JPEG) [43] and High Efficiency Video Coding (HEVC) [41], have been widely explored to achieve this goal. However, due to the inevitable signal loss during compression, these compression algorithms usually generate visually unpleasing compression artifacts. These artifacts not only decrease the visual quality, but also degrade the performance of downstream computer vision systems, especially at high compression ratios. Therefore, removing compression artifacts is an important post-processing task and has attracted more attention in recent years [20, 30]. We refer the reader to review articles [28, 30] for more details. In this paper, we focus on alleviating still image degradation caused by JPEG compression, which is one of the most prevalent compression standards. + +JPEG compression first applies the discrete cosine transformation (DCT) on $8 \times 8$ pixel blocks. Then, these DCT coefficients are coarsely quantized to remove high-frequency details to save space. Due to the independent processing on each pixel block and the removal of high-frequency details, compressed images usually suffer from blocking and blurring artifacts. In addition, using a large quantization step, banding artifacts will appear in smooth areas. Some recent studies have proposed methods to remove undesirable JPEG compression artifacts. According to the design mechanism, these methods can be roughly classified into two categories: model-based methods and deep learning (DL)-based methods. Early model-based works perform filtering to remove compression artifacts. For instance, Foi et al. [12] propose a shape-adaptive DCT filtering method for compression artifacts reduction. On the other hand, since multiple latent clear versions can be estimated from a single compressed image, this task is essentially an ill-posed inverse problem, which requires prior knowledge to constrain it. Along this research direction, many researchers formulate this problem as a minimization of a variational model with favor + +able prior terms. Based on the maximum a posteriori (MAP) framework, many prior models, e.g., quantization step [55], sparse representation [3] and low rank [59], have been developed. Although these model-driven methods have shown good performance, the representation abilities of handcrafted priors are limited, which leads to unstable results when processing compressed images with complex structures. + +In the past few years, DL-based methods have achieved significant progress of JEPG artifacts removal [8, 57, 63]. Due to the powerful nonlinear capacity [16, 21, 22, 29, 53] and huge amounts of training data, these methods can learn the inverse mapping of compression degradations, and thus produce better results than model-driven methods. However, most of current DL-based methods adopt feed-forward networks to directly predict clear images, making them like black boxes and lack interpretability. In addition, since these DL-based methods only learn pixel-level mappings, semantic-level information is not fully explored and exploited, which further limits their performance improvement. + +Different from these methods, we propose an interpretable deep network by combining advantages of both the model-based methods and data-driven DL models. Specifically, we introduce an effective algorithm with DL to learn a pixel-level regressive prior for image content and a semantic-level discriminative prior for image gradient, respectively. First, we model the content-relevant prior as an image-to-image regressor to perform de-blocking, and design the gradient-relevant prior as binary classifier to distinguish whether the image is compressed. Then, the image de-blocking problem is formulated as a minimization of a variational model with the two proposed priors. To effectively solve the model, we design an alternating minimization scheme based on the gradient descent technique and half-quadratic splitting method. Finally, the iterative algorithm is unfolded into a deep network architecture, in which the two priors can be automatically learned through an effective network training strategy. We show that our method is able to predict visually pleasing de-blocked images while removing undesirable JPEG artifacts sufficiently. The contributions of this work are as follows: + +- We propose two effective priors to describe the image content and image gradient from the pixel-level and semantic-level, respectively. By using the two priors as the regularizer, we introduce a new variational model for the JPEG compression artifacts removal. +- We propose an alternating minimization algorithm, which is based on the gradient descent technique and half-quadratic splitting method, to solve the variational model. By unfolding the algorithm, we design a new deep network architecture for the image de-blocking problem. In this way, the two proposed priors can be automatically estimated from training samples. In ad + +dition, since the feed-forward process mimics the processing flow of the alternating minimization algorithm, the interpretability of the deep model is increased. + +- We collect a new dataset containing compressed/clear image pairs based on the popular online social software WeChat. This dataset aims to complement the existing Twitter dataset [8] to serve the relevant research communities. Extensive experiments show that our proposed network performs favorably against state-of-the-arts on both benchmarks and real-world use cases. + +# 2. Related work + +# 2.1. Model-based methods + +In early studies, image filtering technologies are widely explored to explicitly remove compression artifacts. For instance, a quadratic programming technology with an adaptive is proposed in [36] to remove blocking artifacts and preserve image details. An adaptive neighborhood for smoothing and conducting post-filtering in shifted windows is introduced in method [54]. Yoo et al. [49] utilize group-based filtering to improve the correlation between image blocks and reduce blocking artifacts. Foi et al. [12] achieve both the image de-noising and de-blocking by conducting filtering in the shape-adaptive DCT domain. + +On the other hand, prior knowledge also plays a vital role in this task since it is an ill-posed inverse problem. Many researchers make great effort to explore effective priors to constrain the solution space. As one of the most important priors, the quantization step can be utilized to estimate the range of the DCT coefficients of the clear image to constrain the de-blocked result [35, 55]. Other image priors, e.g., sparse representation [3, 4, 40, 52], low rank [59], non-local self-similarity [60] and graph [34], are also explored and exploited. Li et al. [27] combine image decomposition algorithm and sparse prior to achieve both JPEG artifacts removal and image enhancement. Liu et al. [35] improve image de-blocking by exploiting the sparsity in both the image and DCT domains. In [37], a graph-based low-rank prior is introduced to reflect the manifold structures of image patches. Zhang et al. [59] reduce compression artifacts by exploring the non-local similarity in the DCT domain. Liu et al. [34] propose a graph smoothness prior to jointly reduce compression artifacts and improve contrast based on the Retinex theory. Although these model-based methods are flexible and have good interpretability, they usually have limited representation capabilities with handcrafted filters and priors. + +# 2.2. Deep learning-based methods + +In the past few years, deep learning has made breakthrough progress in JPEG compression artifacts removal. + +Due to the powerful nonlinear representation ability, DL-based methods usually have better performance than model-based ones. Dong et al. [8] introduce the first DL-based method by designing a four-layer CNNs architecture, which makes a breakthrough progress in compression artifacts removal. Inspired by the residual learning, several deep network architectures are well designed for JPEG compression artifacts removal and relevant restoration tasks [18,32,42,57,62,63]. Fan et al. [11] construct a decouple learning framework by incorporating different parameterized image operators for various image restoration tasks. To produce visually pleasing results, the generative adversarial networks (GANs) are utilized to capture the underlying data distribution to generate vivid image textures [14, 15, 20]. Yoo et al. [48] achieve image de-blocking by estimating frequency distribution of local patches. Kim et al. [23] propose a pseudo-blind de-blocking method, in which the quality factor is estimated for both blind and non-blind de-blocking. Many dual domain learning-based methods [5,10,19,61] are also introduced by considering the DCT-relevant prior. + +Recently, many researchers attempt to combine both the domain knowledge and deep learning for various image restoration tasks. Wang et al. [45] build a dual domain network by using the DCT-pixel domain sparse coding and the learned iterative shrinkage thresholding algorithm. Chen et al. [6] design a deep network based on the classic iterative nonlinear reaction diffusion for effective and efficient image restoration. In [7, 13], the authors adopt the classic convolutional sparse coding to solve the image de-blocking. Yang et al. [46] use sparsely sampled measurements for image reconstruction by combining compressive sensing theory and deep learning. Under the alternative minimization framework, deep CNNs are also utilized to learn priors and perform as the regularizer [9, 31, 33, 56, 58]. Our method shares these similar spirits, but different from the above approaches that only learn pixel-level mapping relationships, we further introduce semantic-level information to better handle the JPEG compression artifacts removal. + +# 3. Methodology + +# 3.1. Motivation + +In general, JPEG artifacts removal aims to obtain the clear image $\mathbf{x}$ from its compressed observation $\mathbf{y} = \mathbf{x} + \mathbf{v}$ , where $\mathbf{v}$ contains compression artifacts and residual image content. Since this task is an ill-posed inverse problem, from a Bayesian perspective, the clear image can be obtained by solving a MAP problem: + +$$ +\underset {\mathbf {x}} {\arg \max } \log p (\mathbf {y} | \mathbf {x}) + \log p (\mathbf {x}), \tag {1} +$$ + +where $\log p(\mathbf{y}|\mathbf{x})$ and $\log p(\mathbf{x})$ denote the data likelihood and the prior terms, respectively. Formally, by performing + +a negative logarithmic transformation, Equation (1) can be reformulated as an energy minimization variational model: + +$$ +\underset {\mathbf {x}} {\arg \max } \| \mathbf {y} - \mathbf {x} \| _ {2} ^ {2} + \lambda f (\mathbf {x}), \tag {2} +$$ + +where $f(\mathbf{x})$ denotes the regularizer associated with the prior $\log p(\mathbf{x})$ , and $\lambda$ is a trade-off parameter. It is clear that the regularizer plays a vital role in obtaining high-quality solutions. In model-based optimization methods, many regularizers have been explored, e.g., low rank [59] and nonlocal self-similarity [60]. While these methods are usually time-consuming with handcrafted priors that are not powerful enough for good performance. Therefore, with the powerful nonlinear capabilities, deep unfolding networks [7, 13] have been explored to extract the priors from training samples. + +Albeit improvement in interpretability and performance, existing deep unfolding methods only design pixel-level regression networks for the regularization term, semantic-level information is not fully utilized. Affected by compression artifacts (e.g., blocking, blurring and banding), the overall quality of the JPEG compressed image will be significantly lower than its clear counterpart. In other words, it should be easy to distinguish whether the image has been compressed from the semantic-level. This observation motivates us to introduce a semantic-level discriminative prior to complement existing methods for image de-blocking. + +In addition, according to our domain knowledge, most compression artifacts have a greater impact on the high-frequency part than the low-frequency part. As shown in Figure 1, due to the inherent sparsity of gradients, the histogram on the gradient domain has stronger regularity than the image domain. Moreover, the histogram of the compressed gradients $\nabla \mathbf{y}$ is much sparser than the clear gradients $\nabla \mathbf{x}$ , as shown in Figure 1. This is because the quantization intervals are much larger in high-frequency part than those in low-frequency part, which results in significant changes in the high-frequency part before and after compression. Therefore, we argue that using the high-frequency part of the image can provide better discriminative information. Based on the above observation, we design a semantic-level prior and apply it to the image gradient, which is the most commonly used high-frequency image information [38]. By adding the semantic-level discriminative prior to Equation (2), our final variational model is: + +$$ +\underset {\mathbf {x}} {\arg \max } \| \mathbf {y} - \mathbf {x} \| _ {2} ^ {2} + \lambda_ {1} f _ {p} (\mathbf {x}) + \lambda_ {2} f _ {s} (\nabla \mathbf {x}), \tag {3} +$$ + +where $\nabla$ is the differential operator. $f_{p}(\cdot)$ and $f_{s}(\cdot)$ mean the regularizers to deliver the pixel-level regressive prior and semantic-level discriminative prior, respectively. + +# 3.2. Optimization + +To construct a step-by-step corresponding deep unfolding network architecture for Equation (3), we first design an + +![](images/97c73b35f6d23314adcc177ba52f7a9af6db07ecac1e7efe36c0fd88f8575091.jpg) +Figure 1: Statistical histogram. From left to right: $\mathbf{y}$ ; $\mathbf{x}$ ; histograms of $\mathbf{y}$ and $\mathbf{x}$ ; histograms of $\nabla \mathbf{y}$ and $\nabla \mathbf{x}$ . + +![](images/426d9fb73cf48f4cbb4afc228da3fe8eb42f7b4024f8d10a2e977515677fabcf.jpg) + +![](images/52ac901cdecbbc2ea1d43ca54e2ef53d638b41f52e2bde353b279225fc162b51.jpg) + +![](images/6976dae702bb60863f7a9b0e8ad71ec7750d98b53c724de7de0d104697f3484b.jpg) + +effective alternating minimization algorithm to obtain the unfolding inference. By introducing two auxiliary variables $\mathbf{u}$ and $\mathbf{g}$ , Equation (3) can be rewritten as a non-constrained optimization problem: + +$$ +\begin{array}{l} \underset {\mathbf {x}, \mathbf {u}, \mathbf {g}} {\arg \max} \| \mathbf {y} - \mathbf {x} \| _ {2} ^ {2} + \alpha \| \mathbf {u} - \mathbf {x} \| _ {2} ^ {2} + \beta \| \mathbf {g} - \nabla \mathbf {x} \| _ {2} ^ {2} \\ + \lambda_ {1} f _ {p} (\mathbf {u}) + \lambda_ {2} f _ {s} (\mathbf {g}), \tag {4} \\ \end{array} +$$ + +where $\alpha$ and $\beta$ are penalty parameters. Equation (4) can be addressed by alternatively solving sub-problems: + +$$ +\underset {\mathbf {u}} {\arg \max } \alpha \| \mathbf {u} - \mathbf {x} _ {k - 1} \| _ {2} ^ {2} + \lambda_ {1} f _ {p} (\mathbf {u}), \tag {5} +$$ + +$$ +\underset {\mathbf {g}} {\arg \max } \beta \| \mathbf {g} - \nabla \mathbf {x} _ {k - 1} \| _ {2} ^ {2} + \lambda_ {2} f _ {s} (\mathbf {g}), \tag {6} +$$ + +$$ +\underset {\mathbf {x}} {\arg \max } \| \mathbf {y} - \mathbf {x} \| _ {2} ^ {2} + \alpha \| \mathbf {u} _ {k} - \mathbf {x} \| _ {2} ^ {2} + \beta \| \mathbf {g} _ {k} - \nabla \mathbf {x} \| _ {2} ^ {2}, \tag {7} +$$ + +where $k = 1,2,\ldots ,K$ is the iteration. Below, we detail the updates for each sub-problem. + +1) Solving $\mathbf{u}$ The sub-problem (5) is a proximity operator of $f_{p}(\mathbf{u})$ and corresponds to de-block the image $\mathbf{x}_{k - 1}$ . The solution can be expressed as: + +$$ +\mathbf {u} _ {k} = \operatorname {d e b l o c k e r} \left(\mathbf {x} _ {k - 1}\right), \tag {8} +$$ + +where $\text{deblocker}(\cdot)$ can be arbitrary image de-blocking algorithms. In this paper, we design a deep convolutional neural networks to perform the de-blocker. In this way, complicated image content-relevant priors can be directly learned from training data without manual design. + +2) Solving $\mathbf{g}$ Since we want to introduce semantic-level discriminative information for image de-blocking, $f_{s}(\mathbf{g})$ is designed as a binary classifier since classification is the most fundamental semantic-related analysis. Therefore, unlike solving $\mathbf{u}$ that directly deploys an image-to-image regression network, we follow Li et al. [26] and adopt the back-propagation to compute the derivative of $f_{s}(\mathbf{g})$ . The solution for solving $\mathbf{g}$ is: + +$$ +\mathbf {g} _ {d, k} ^ {(j)} = \mathbf {g} _ {d, k} ^ {(j - 1)} - \eta \left[ \beta \left(\mathbf {g} _ {d, k} ^ {(j - 1)} - \nabla_ {d} \mathbf {x} _ {k - 1}\right) + \lambda_ {2} \frac {\partial f _ {s} \left(\mathbf {g} _ {d , k} ^ {(j - 1)}\right)}{\partial \mathbf {g} _ {d , k} ^ {(j - 1)}} \right], \tag {9} +$$ + +where $d \in \{h, v\}$ are the horizontal and vertical directions, respectively. $\eta$ is the step size, and $j$ is the inner iteration. To fit with the overall energy minimization, we intentionally + +label clear images as 0 (negative) and compressed images as 1 (positive). In this way, during the optimization, Equation (9) provides semantic determining for $\mathbf{g}$ whether increasing or decreasing its value will improve the clarity, which complements the pixel-level constraints in Equation (8). + +3) Solving $\mathbf{x}$ Since Equation (7) is a least squares problem, it has a closed form solution. To speed up the process, we adopt Fast Fourier Transformation (FFT) to diagonalize the differential operator so that large-matrix inversion can be avoided. By setting the first-order derivative to zero, the solution of Equation (7) is: + +$$ +\mathbf {x} _ {k} = \mathcal {F} ^ {- 1} \left(\frac {\mathcal {F} (\mathbf {y}) + \alpha \mathcal {F} \left(\mathbf {u} _ {k}\right) + \beta \left(\sum_ {d \in \{h , v \}} \mathcal {F} ^ {*} \left(\nabla_ {d}\right) \mathcal {F} \left(\mathbf {g} _ {k}\right)\right)}{\mathcal {F} (\mathbf {I}) + \alpha \mathcal {F} (\mathbf {I}) + \beta \left(\sum_ {d \in \{h , v \}} \mathcal {F} ^ {*} \left(\nabla_ {d}\right) \mathcal {F} \left(\nabla_ {d}\right)\right)}\right), \tag {10} +$$ + +where $\mathbf{I}$ is the identity matrix, $\mathcal{F}$ is the FFT operator, $\mathcal{F}^*$ is the complex conjugate operator, $\mathcal{F}^{-1}$ is the inverse FFT operator, $\nabla_h$ and $\nabla_v$ are the horizontal and vertical differential operators, respectively. Since all calculations are performed pixel-wise, the update of $\mathbf{x}$ can be efficiently computed. However, if complex handcrafted de-blocker and classifier are used, the entire optimization process will be computationally expensive. Therefore, we unfold the above algorithm into a deep network to gain advantages from both model-based optimization and data-driven deep learning. + +# 3.3. Deep unfolding network + +As shown in Figure 2, our deep unfolding network contains $K$ stages, which are intentionally designed to correspond to $K$ iterations in the optimization algorithm. In each network stage, two auxiliary variables are first updated, and then the de-blocked image is calculated. Therefore, the question left to us now is how to design the pixel-level regularizer $f_{p}(\cdot)$ and the semantic-level regularizer $f_{s}(\cdot)$ . + +De-blocker $f_{p}(\cdot)$ To achieve an image-to-image regression for exploring pixel-level content-relevant prior, we first design a basic unit and then adopt it to construct the de-blocker. Due to different quantization steps, compression artifacts at different spatial scales will appear. Therefore, to capture both global and multi-scale local spatial information, we utilize the non-local operation [62] and dilated convolutions [50] to form the basic unit. Specifically, in each basic unit, we first deploy the non-local operation to capture global spatial information. Similar with [62], the non-local operation is performed as: + +$$ +\mathbf {M} _ {\text {o u t}} = \mathbf {M} _ {\text {i n}} + \theta (\mathbf {M} _ {\text {i n}}) \nu (\mathbf {M} _ {\text {i n}}) ^ {\dagger} \xi (\mathbf {M} _ {\text {i n}}) \mathbf {W}, \tag {11} +$$ + +where $\mathbf{M}_{in}$ and $\mathbf{M}_{out}$ are the input and output features; $\theta (\cdot)$ , $\nu (\cdot)$ and $\xi (\cdot)$ are $1\times 1$ convolutions to reduce the channel number; $\dagger$ is the transpose operation; $\mathbf{W}$ is a $1\times 1$ convolution to perform a hidden-to-output operation. We re-ordered $(\theta \nu^{\dagger})\xi$ to $\theta (\nu^{\dagger}\xi)$ according to the associative rule, which can greatly reduce computation complexity by + +![](images/af7fcf8cc36d7f9c07005bf19db1d75090a8542f9766e32c148b239fdbb121aa.jpg) +Figure 2: The framework of our network with $K$ stages. Each stage consists of three operations to accomplish the update of $\mathbf{u}$ , $\mathbf{g}$ and $\mathbf{x}$ . The overall optimization process and illustration are shown on the top row and bottom row, respectively. + +avoiding large matrix calculation. Then, these global spatial information is sent into three cascaded dilated convolutional layers with different dilation factors. In this way, the basic unit can capture wide-range spatial information and enable a single network to handle multiple quantization steps. Finally, we utilize the basic unit to construct the de-blocker. Note that we adopt dense structures [22] and skip-connections to avoid gradient vanishing and propagate image detail to improve the de-blocking performance. + +Classifier $f_{s}(\cdot)$ To further utilize semantic information for image de-blocking, we build a DL-based binary classifier, which receives the image gradients as the input and outputs a single scalar, to represent the probability of being compressed. Specifically, we adopt six standard convolutional layers (with non-linear activations), one global average pooling layer, and two fully-connected layers to construct the classifier. The output scalar is processed by a sigmoid non-linear function to facilitate the binary prediction. Note that the global average pooling operation can convert a feature map into a single scalar, which allows our classifier to handle input gradients of arbitrary sizes. Moreover, since the entire classifier is differentiable, it can participate in the calculation of Equation (9) to update $\mathbf{g}$ . + +As shown in Figure 2, by plugging the de-blocker and classifier into the optimization, the deep unfolding network can be constructed. It should be indicated that our network has a good interpretability, i.e., each network module corresponds to each step in the optimization. The de-blocker accomplishes the exploration of image content-relevant prior to achieve the function of Equation (8), which is to remove JPEG artifacts. The classifier accomplishes the exploration of image gradient-relevant prior and participates in the cal + +culation of Equation (9) so that the gradients can be updated along the direction of 'clarity'. By taking both pixel-level and semantic-level information into consideration, the de-blocked image can be obtained by Equation (10). + +# 3.4. Implementation details + +Since our deep unfolding network contains a large number of parameters, it is impractical to manually determine these parameters. Therefore, we make all the learnable parameters be automatically learned from the training samples. We enforce the de-blocker and the classifier to share their own parameters to reduce the number of parameters and thus avoid over-fitting. For the weights in Equations (8) to (10), we let them be discriminatively learned. + +In this paper, we adopt a two-stage training strategy to train our deep unfolding network. In the first stage, we only train the classifier via the binary cross entropy loss function: + +$$ +\mathcal {L} _ {\mathrm {C E}} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \hat {z _ {i}} \log \left(z _ {i}\right) + \left(1 - \hat {z _ {i}}\right) \log \left(1 - z _ {i}\right), \tag {12} +$$ + +where $N$ is the number of training samples, $z_{i}$ is the output scalar of the classifier, and $\hat{z}_i$ is the label. We set $\hat{z_i} = 1$ for compressed images and $\hat{z_i} = 0$ for clear images. In the second stage, the parameters of the trained classifier are frozen, and the remaining parameters in the network are trained by using mean absolute error (MAE). + +In our deep unfolding network, all convolutional kernel sizes are set as $3 \times 3$ . The number of feature maps of deblocker and classifier are 112 and 32, respectively. We set $K = 5$ and $J = 3$ , and use the classic ReLU [25] as the nonlinear activation. The dilation factors are set as 1, 3 and + +Table 1: PSNR | SSIM | PSNR-B values and parameter numbers comparisons. The best and the second best results are boldfaced and underlined. Our network achieves the best overall results with tolerable parameter numbers. + +
DatasetQualitySADCT [12]LD [27]PCA [40]ARCNN [8]TNRD [6]DnCNN [57]
Classc51028.880.807128.1628.390.799727.5929.320.800229.0829.030.792928.76
2030.920.866329.7530.300.858429.3731.560.858431.1231.150.851730.59
3032.140.891430.8331.470.883030.1732.860.883832.3132.510.880631.98
LIVE11028.650.809328.0128.260.805227.6829.010.809028.8328.960.807628.77
2030.810.878129.8230.190.871529.6431.280.874630.7231.290.873330.79
3032.080.907830.9229.410.896029.3632.620.903432.1832.670.904332.22
BSD5001028.230.778027.3828.030.782427.2928.640.779328.0128.560.790727.87
2030.090.851028.6129.820.851428.4330.730.851029.4230.430.859429.10
3031.210.883829.3430.870.871929.1531.990.884030.8431.520.890429.92
Twitter27.610.728127.5327.580.727427.4927.710.730227.6627.540.729527.49
WeChat29.600.799529.5929.480.795629.4729.630.799429.6029.300.798729.29
# Params (×105)1.060.21
DatasetQualityLPIO [11]M-Net [42]DCSC [13]RNAN [62]RDN [63]Proposed
Classc51029.350.801529.0429.690.810729.3129.620.827029.3029.870.827829.42
2031.580.856731.1231.900.865831.2931.810.880431.3432.110.869331.26
3032.860.883532.2832.970.888132.4933.060.903032.4933.380.892432.35
LIVE11029.170.811928.8929.450.819329.0429.340.831729.0129.630.823929.13
2031.520.876631.0731.830.884631.1431.700.896031.1832.030.887731.12
3032.990.907432.3133.070.910832.4733.070.921832.4333.450.914932.22
BSD5001028.810.781528.3928.960.803928.5628.950.805028.5529.080.805428.48
2030.920.855130.0731.050.874230.3631.130.875830.4131.250.875130.27
3032.310.886631.2732.610.907231.1532.420.905731.5232.700.906831.33
Twitter27.470.733327.4127.980.744127.8727.630.731327.4327.430.718327.42
WeChat28.900.800028.9029.820.806729.8229.580.800429.5829.560.799629.56
# Params (×105)13.946.673.2174.09220.0388.21
+ +5. To train the network, we use the Matlab JPEG encoder to generate JPEG compressed images. The JPEG quality factors (QF) are set to 10, 20 and 30. We use both the training and testing sets from BSD500 [2] as our training set. The training process is conducted on the Y channel image of Y-CrCb space. We randomly generate $64 \times 64$ training patch pairs with a batch size of 10. We adopt the Adam solver [24] as the optimizer, and the learning rate is fixed to $10^{-4}$ . We use TensorFlow [1] to implement our network. Note that we only train one single model to handle all the JPEG compression factors. We initialize $\mathbf{x}_0 = \mathbf{y}$ and $\mathbf{g}_{d,k}^{(0)} = \nabla_d\mathbf{x}_{k-1}$ , and all weights in Equations (8) to (10) are initialized as 0.01. + +# 4. Experimental results + +We compare our network with three model-driven methods: Shape-Adaptive DCT (SADCT) [12], Layer Decomposition (LD) [27] and PCA basis Learning (PCA) [40], and several deep learning-based methods: Artifacts Reduction Convolutional Neural Network (ARCNN) [8], Trainable Nonlinear Reaction Diffusion (TNRD) [6], Denoising Convolutional Neural Network (DnCNN) [57], Learning Parameterized Image Operators (LPIO) [11], Memory Network (M-Net) [42], Deep Convolutional Sparse Coding (DCSC) [13], Residual Non-local Attention Networks (R-NAN) [62] and Residual Dense Network (RDN) [63]. + +# 4.1. Comparisons on synthetic datasets + +We first report the comparison results on the three widely used synthetic datasets, i.e., 5 images in Classics [51], 29 images in LIVE [39] and 100 images in the validation set of BSD500 [2]. We adipot the PSNR, SSIM [44], and PSNR-B [47] for quantitative evaluations. Since PSNR-B is more sensitive to blocking artifacts than PSNR and S-SIM, it is recommended [8] for use in this de-blocking problem. Table 1 reports the quantitative results and our network achieves the best overall results on all synthetic datasets. Particularly, for the Classics5 dataset with $\mathrm{QF} = 10$ , the average gains of our method over the recently proposed RD-N [63] are respectively 0.23dB in PSNR, 0.0209 in SSIM, and 0.46dB in PSNR-B. When compared with the other approaches, our method is far ahead. Note that we only train one model to cover all three QFs, which substantiates the flexibility and effectiveness of our method, in diverse JPEG artifacts contained in these datasets. + +In Figure 3, we show two visual comparisons and it is clear that other compared methods can effectively remove most compression artifacts but fail to recover image details. While our network can finely recover the image textures with a better visual quality. This is because our method learns the dual priors, which enables the network to simultaneously utilize the low-level pixel information and high-level semantic information. In this way, not only the image + +![](images/51101403a191873dfc767772b28be93fc559a6597ce65a22ac3af2f2241fd1a1.jpg) +Example in 'Classic5' + +![](images/9430b9ca471a88d85ead981e53fe2432ff8a90d837f1c2450a136ffdaa8e1fe6.jpg) + +![](images/1134461bf803df1508465b33af121055a1c4b9bb8a8f618cc6b712ca2ac5d2c2.jpg) + +![](images/392bd529772f0f48b6d1307cad9125aaa85ea341ce14fe8ed9a3c401ab25d201.jpg) + +![](images/74886091716a15e4e0d1731d62ded491e711e11635399b39c4a3daa2725f472a.jpg) + +![](images/e6c18b111375c26904644841f931cbab04430e3b5e722ed92b16f4da721984fc.jpg) + +![](images/874a95c41594da4ed9ef8b9c18f0da7c9cd79a6c0d5a900617075eeb710f3a01.jpg) + +![](images/a4de7f07a525a5ab335948432f69f783a26c3e3990b591a04a5e83d7456cab9b.jpg) + +![](images/3435da01d7e7105cf8177999d5c202b5ee41bc3934460cae9173dc33d6c221cf.jpg) +$\mathrm{QF} = 10$ + +![](images/099c8db19b449ad6aa3405a44016584cae0dcb35ae4740efe41cc8f6c086f7a5.jpg) +M-Net [42] + +![](images/57869ba0b05915b6105cdf649aeb75a211bfe62cef3c2fc7fab01c4d15e8518a.jpg) +DCSC [13] + +![](images/5e0baa920f52ee029afd0944fdc2057355ac8cca5d3874f3b7cdd26c68af213b.jpg) +RNAN [62] + +![](images/3913453ce30dd9339848185db86c58a1e90ae864f21c7d9f351739fd388b43a4.jpg) +RDN [63] + +![](images/db90ad21c67985d41656210b38a103a09237aea664eb11d4cbd794bb25e4461c.jpg) +Proposed +Clear + +![](images/00c373a0fedc01dcfa53e48586e70a639a121ad108c744dbfc12a555d72529b7.jpg) + +![](images/71c545d071e50647ccc81b3b1ddbba735fff57c9bedd5d9fe50efcb5c96f0a34.jpg) +Example in 'LIVEJ' + +![](images/609f431ca950fb45bacbc45f208313aca091552ba6f70af8ec25e9a8c0a237be.jpg) +LPIO [11] + +![](images/8041cced048a9c72242e8d6f310ea11b50ba5c394ad75b4f82645a4ed51dbbad.jpg) + +![](images/8d0a02bcceda51ecfff01d145f20f594e97ed074910a119d04cb8b07ffc6cbb3.jpg) + +![](images/649af09ea9eb83ab9273c7ec6fe4bf043207e7825ee379759d94a39b674d91aa.jpg) + +![](images/433e664ea7ba42e76d610aa8b77e1b3fb9e38cd2b734e111b9e1671c0a31e788.jpg) + +![](images/2e311b45c3b6e0484b1632f7fb46af3d8730613710d672a24cf6beb01e93b9e5.jpg) + +![](images/ec1b0c65da3c8be38a80986695ff444a8a6893bb06943c4d4f60cbf96cce5fc9.jpg) + +![](images/107fc46ccb1c4d4812b9bb8669e239fef8be8434cd07273e12c7c9f5a5cabfb9.jpg) +$\mathrm{QF} = 20$ +LPIO [11] + +![](images/df6abdd6a83ec2e0d4628f1a59b43a90f86e1419e9474e4d12bfd1dad55abb05.jpg) +SADCT [12] +M-Net [42] + +![](images/a1bc728a3cce43e524b28133df8d4676b704ac461dd5e05ab45241ca129378ae.jpg) +LD [27] +DCSC [13] +Figure 3: Visual comparisons on different synthetic datasets with different JPEG quality factors. + +![](images/6acf3e97d4a156a35d03a0942dd43a4042dc5352967d37e767654e66c709fd13.jpg) +PCA [40] +RNAN [62] + +![](images/da86ba41430eda5977f8ee4c9caf3c6c89ca6620832223d10d5979bc68446d97.jpg) +ARCNN [8] +RDN [63] + +![](images/450efd245f9ed334ee8abe204ca078983037f33a686964ec940e62248d4d20f6.jpg) +TNRD [6] +Proposed + +![](images/b871ec967a6c08093bf270ada4dd0fdd850f55905f7d84886724a34fa221d938.jpg) +DnCNN [57] +Clear + +content-related compression artifacts are removed, but also the image gradient-related clarity is recovered. + +# 4.2. Comparisons on real-world use cases + +Online social media softwares have been widely used for message publishing and sharing. To reduce transmission and storage consumption, these platforms usually compresses and re-scales the original images on the server-side. This leads to undesired and unavoidable compression artifacts appearance when users view the posted images. To complement the existing Twitter dataset [8] and serve the relevant research communities on this issue in real scenarios, we manually construct a new dataset based on the popular social media WeChat. The dataset contains 300 images and their WeChat-compressed versions1. To avoid out-of-memory caused by excessive image resolution, we first randomly crop the images and then perform the de-blocking operation and measurement calculation. We show quantitative results in Table 1, in which our model consistently generates the best overall performance due to the effective dual priors. Figure 4 shows two visual comparisons. Due to different compression strategies, it is clear that the two compressed images contain different appearances of artifacts, and our method still achieves a superior performance than other compared methods. It is observed that our method can generate clearer results than other competing ones. + +# 4.3. Analysis + +Analysis on classifier $f_{s}(\cdot)$ We first visualize the derivative of the classifier at different stages in Figure 5. By referring to $\nabla \mathbf{x}_0$ , the areas of large derivative values, which are normalized for visualization, of $\mathbf{g}$ are basically the same + +![](images/6e8dbd34ba30a8ed5623c5ad3ea1aa54fb5af26524205930cf498c1947d1610d.jpg) +(a) $\nabla \mathbf{x}_0$ +Figure 5: Visualizations of the derivative of the classifier. + +![](images/98f0d7792519e4205b2ed6cb8f185b8b591b6a67a0213611f214e3ff83795d83.jpg) +(b) $\frac{\partial f_s(\mathbf{g}_1)}{\partial\mathbf{g}_1}$ + +![](images/897860d5d60c82196bfa5ec77595557d3d7bacbf7ea5eae67bd2fce78d774459.jpg) +(c) $\frac{\partial f_{\mathrm{a}}(\mathbf{g}_3)}{\partial\mathbf{g}_3}$ + +![](images/f4133f3cd45c5649d660de4b1ec68829678f7b222156cb3ef6b0affe54fa2d12.jpg) +(d) $\frac{\partial f_s(\mathbf{g}_5)}{\partial\mathbf{g}_5}$ + +as the areas of compression artifacts. Since the gradient represents the increasing direction of the function, using Equation (9) can update $\mathbf{g}$ along the direction of less artifacts. + +In Figure 6, we visualize the activations of the last convolutional layer in the classifier. It is clear that our classifier can effectively distinguish clear images and their compressed versions generated from different platforms. Since we use the classifier to explore gradient-relevant priors, the differences between compressed and clear activations are mainly concentrated in areas such as image texture and structure, and edges of compression artifacts. This proves that using our gradient-relevant prior can provide the network with constraints related to 'clarity'. + +We also show one visual result in Figure 7 to demonstrate the effect of $f_{s}(\cdot)$ . It is clear that using only pixel-level $f_{p}(\cdot)$ can obtain a de-blocked result with blurred edges. By adding the semantic-level $f_{s}(\cdot)$ , the edges become more clear with a better visual quality. + +Analysis on de-blocker $f_{p}(\cdot)$ For the pixel-level de-blocker, we compare with the scenarios by using three operators. Specifically, we test the handcrafted $\ell_{1}$ sparsity [17], the DL-based DnCNN [57], and our default $f_{p}(\cdot)$ . Table 2 shows the quantitative comparisons on BSD500 (QF = 10), and using our $f_{p}(\cdot)$ achieves the best results. Compared + +![](images/4759b18421ad1a9e03cd38f084d6230f52a9740fd006a3d1162dde5bde7a969c.jpg) +Compressed + +![](images/d09e583227b25d733ac85c3af6bb9fef7c2b94f1467332d48c938d60cb4ee81e.jpg) +SADCT [12] + +![](images/57d3d5c1b43333682bbdde60009c8ed3cbf14519c6716e1174272c2cd6197e1e.jpg) +LD [27] + +![](images/fa87ff04b4de50568c66dc183b72565c155da7b1316cd316255635567ae5e3b3.jpg) + +![](images/bf1ce621609c40eca4310fb6ab721c3c22c3eaa0f0d35d79bc1e2450f6beddf2.jpg) +PCA [40] + +![](images/dce664ae966de4a348428b9b63f2b3a1be181a1a82141f5663624efef878afec.jpg) +ARCNN [8] + +![](images/7235d0207b638722d5ff58d71b610030c1cf9df500e5bbb4c4dd7dc01b263f08.jpg) +TNRD [6] +DnCNN [57] + +![](images/4b10665a1a800e90a2a1a5d2ac67f11dfe8495614123d82c8b138ba0c2cfebde.jpg) + +![](images/1c980442cf03c9e8b35525bdb618bfab7d0075eb8847f1f68947f902453c4a5b.jpg) +Example in 'Twitter' +Example in 'WeChat' + +![](images/2bd6e901c9fbd3c42221f714ef916396cd94c9c2103b39145221239df8b82622.jpg) +Compressed + +![](images/9d9ea22d45ef7cf5753ded82c97e6ab0d1803f0dbb456f7a786273b9a8b04280.jpg) +SADCT [12] + +![](images/55cb807e4e5ccbdebb31daa96083f81416485c7f9469f446c32fd18ebc54dd69.jpg) +LD [27] + +![](images/c110e5b18d97e9da5b3bcc1aacca0bb6bd6c9e42c249ea7dc676c7fa0b3a4720.jpg) +PCA [40] + +![](images/db08a70ff67aa905c4326b6fbbb41c7d3fedd70f366ed9cccc564dd410746796.jpg) +ARCNN [8] + +![](images/3c9895add1286c8e387ad7b3485c8b7e61b32b1847f37ab99775dc4406e280cc.jpg) +TNRD [6] +DnCNN [57] + +![](images/c82ebe4f4615400afb3034786aa46e6e07b7464771e5b45292e5462d6d765e1e.jpg) + +![](images/89b84b24a06007f8a88252053a6e519a7338509472c03f46f1834f63d3b536f3.jpg) + +![](images/cec11d511137024a890ac58660323844ccc015a0868c9b35579648fbfaa6a9a5.jpg) + +![](images/99c62917f176f45be15bbba801bd6570236ce9e927e9f0527977e60411fe5b2e.jpg) + +![](images/98af432e239d1cbb65c2e323d48ce54776f91b416fc67e86102104833936789c.jpg) + +![](images/3f99e367222b11923758fe3f1695439b28642bace8fc8a76f06a7276291f0527.jpg) +(a) Compressed + +![](images/69f2484bee52e6fad26196227bf32972d2b753a6d22b8fa3a8ced319725df708.jpg) +(b) Activ. of (a) + +![](images/44afcf9115cd984f46496c29934e01bd01012ed831fc445aa50f7b29df9f7823.jpg) + +![](images/9da3122d9d65bd90415927c03611d463ef1d6d2c033ddcbc930179054e995ad9.jpg) + +![](images/1cfd193cfe39e528627185de9b8917b6d3d2c19753ae8c9587b7718d264be70d.jpg) +(c) Clear + +![](images/b838fa4f38379b5feb594b0ce928ba2b3b51e423e16b6396d958a966b0b104e1.jpg) + +![](images/7962ba077c0b5045f26e91dac1346be75d0c73987d2efb542ea94fb7a5247b11.jpg) + +![](images/aa1b06be265568abfb7d48d44399f5ec907f0c6ad950ac54506e1d03f880674f.jpg) +(d) Activ. of (c) + +![](images/52fddefa2bea9c32546411be465eb0124e0bf2a792da0523aa6d3fe66c92b891.jpg) +Figure 6: Activations of a feature map in the classifier. From top to bottom: BSD500, Twitter and WeChat. +(a) Compressed +Figure 7: Effectiveness of $f_{s}(\cdot)$ . + +![](images/a55c93d1f41a49fee2f68ba60e9c8355dacf3125a658bc245432ce2e5a8bcb44.jpg) +(b) Without $f_{s}(\cdot)$ + +![](images/e7a1b7c0fc9e5e31b95b1f236ac8f8f2cfa9de2cf6aa6ef587a2d11bcd9f6db6.jpg) +(c) With $f_{s}(\cdot)$ + +with the other two de-blockers, our $f_{p}(\cdot)$ can extract both global and multi-scale local features. This is particularly suitable for image de-blocking since compression artifacts usually have the appearance of different spatial scales. + +Analysis on stage $K$ We also analyze the effect of stage number $K$ and show the quantitative results on BSD500 (QF = 10) in Figure 8. Using $K = 1$ as a baseline, it is clear that the performance has an obvious improvement with 3 stages. When $K = 7$ , the quantitative results show a slight decreasing trend, which may be caused by the difficulty of + +Table 2: Comparisons on using different de-blockers. + +
Proximal operatorsPSNRSSIMPNSR-B
l1 sparsity [17]28.180.798527.28
DnCNN [57]28.970.809427.95
Our fp(·)29.480.814629.13
+ +![](images/6a22673163b3a15366562aab143d1d5a9f5ccc56f3467cf41192ae27169268e5.jpg) +Figure 8: Quantitative results on different stage numbers $K$ . + +![](images/c0b6127626d8f342f570b6cdaed1bfc866b86bc02aa763087b3562cac81bd0a4.jpg) + +gradient propagation due to the increased stage. Therefore, we set $K = 5$ as the default stage number. + +# 5. Conclusion + +In this paper, we propose two data-driven priors for JPEG compression artifacts removal. Specifically, we design one pixel-level prior and one semantic-level prior to provide regressive and discriminative information, respectively. We then embed these two priors into a variational model and develop an alternative optimization algorithm to solve it. This optimization algorithm is further unfolded into a deep network, in which the dual priors can be effectively explored from training samples. Experiments on benchmarks and real-world use cases show that our method performs favorably against state-of-the-art methods. + +# References + +[1] Martin Abadi, Paul Barham, et al. Tensorflow: A system for large-scale machine learning. In USENIX symposium on operating systems design and implementation, 2016. 6 +[2] Pablo Arbelaez, Michael Maire, Charless Fowlkes, and Jitendra Malik. Contour detection and hierarchical image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(5):898-916, 2010. 6 +[3] Kristian Bredies and Martin Holler. A total variation-based jpeg decompression model. SIAM Journal on Imaging Sciences, 5(1):366-393, 2012. 2 +[4] Huibin Chang, Michael K Ng, and Tieyong Zeng. Reducing artifacts in JPEG decompression via a learned dictionary. IEEE Transactions on Signal Processing, 62(3):718-728, 2013. 2 +[5] Honggang Chen, Xiaohai He, Linbo Qing, Shuhua Xiong, and Truong Q Nguyen. DPW-SDNet: Dual pixel-wavelet domain deep cnns for soft decoding of JPEG-compressed images. In CVPR Workshops, 2018. 3 +[6] Yunjin Chen and Thomas Pock. Trainable nonlinear reaction diffusion: A flexible framework for fast and effective image restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1256-1272, 2016. 3, 6, 7, 8 +[7] Nathaniel Chodosh and Simon Lucey. When to use convolutional neural networks for inverse problems. In CVPR, 2020. 3 +[8] Chao Dong, Yubin Deng, Chen Change Loy, and Xiaou Tang. Compression artifacts reduction by a deep convolutional network. In ICCV, 2015. 2, 3, 6, 7, 8 +[9] Weisheng Dong, Peiyao Wang, Wotao Yin, Guangming Shi, Fangfang Wu, and Xiaotong Lu. Denoising prior driven deep neural network for image restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(10):2305-2318, 2018. 3 +[10] Max Ehrlich, Larry Davis, Ser-Nam Lim, and Abhinav Shrivastava. Quantization guidedjpeg artifact correction. In EC-CV, 2020. 3 +[11] Qingnan Fan, Dongdong Chen, Lu Yuan, Gang Hua, Nenghai Yu, and Baoquan Chen. A general decoupled learning framework for parameterized image operators. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. doi:10.1109/TPAMI.2019.2925793.3,6,7,8 +[12] Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Pointwise shape-adaptive dct for high-quality denoising and deblocking of grayscale and color images. IEEE Transactions on Image Processing, 16(5):1395-1411, 2007. 1, 2, 6, 7, 8 +[13] Xueyang Fu, Zheng-Jun Zha, Feng Wu, Xinghao Ding, and John Paisley. JPEG artifacts reduction via deep convolutional sparse coding. In ICCV, 2019. 3, 6, 7, 8 +[14] Leonardo Galteri, Lorenzo Seidenari, Marco Bertini, and Alberto Del Bimbo. Deep generative adversarial compression artifact removal. In ICCV, 2017. 3 +[15] Leonardo Galteri, Lorenzo Seidenari, Marco Bertini, and Alberto Del Bimbo. Deep universal generative adversarial compression artifact removal. IEEE Transactions on Multimedia, 21(8):2131-2145, 2019. 3 + +[16] Shanghua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip HS Torr. Res2net: A new multi-scale backbone architecture. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(2):652-662, 2021. 2 +[17] Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In ICML, 2010. 7, 8 +[18] Shuhang Gu, Wen Li, Luc Van Gool, and Radu Timofte. Fast image restoration with multi-bin trainable linear units. In ICCV, 2019. 3 +[19] Jun Guo and Hongyang Chao. Building dual-domain representations for compression artifacts reduction. In ECCV, 2016.3 +[20] Jun Guo and Hongyang Chao. One-to-many network for visually pleasing compression artifacts reduction. In CVPR, 2017. 1, 3 +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 2 +[22] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017. 2, 5 +[23] Yoonsik Kim, Jae Woong Soh, Jaewoo Park, Byeongyong Ahn, Hyun-Seung Lee, Young-Su Moon, and Nam Ik Cho. A pseudo-blind convolutional neural network for the reduction of compression artifacts. IEEE Transactions on Circuits and Systems for Video Technology, 30(4):1121-1135, 2019. 3 +[24] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014. 6 +[25] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012. 5 +[26] Lerenhan Li, Jinshan Pan, Wei-Sheng Lai, Changxin Gao, Nong Sang, and Ming-Hsuan Yang. Learning a discriminative prior for blind image deblurring. In CVPR, 2018. 4 +[27] Yu Li, Fangfang Guo, Robby T Tan, and Michael S Brown. A contrast enhancement framework withJPEG artifacts suppression. In ECCV, 2014. 2, 6, 7, 8 +[28] Dong Liu, Zhenzhong Chen, Shan Liu, and Feng Wu. Deep learning-based technology in responses to the joint call for proposals on video compression with capability beyond hevc. IEEE Transactions on Circuits and Systems for Video Technology, 30(5):1267-1280, 2019. 1 +[29] Daqing Liu, Hanwang Zhang, Feng Wu, and Zheng-Jun Zha. Learning to assemble neural module tree networks for visual grounding. In ICCV, 2019. 2 +[30] Jiaying Liu, Dong Liu, Wenhan Yang, Sifeng Xia, Xiaoshuai Zhang, and Yuanying Dai. A comprehensive benchmark for single image compression artifact reduction. IEEE Transactions on Image Processing, 29:7845-7860, 2020. 1 +[31] Risheng Liu, Zhiying Jiang, Xin Fan, and Zhongxuan Luo. Knowledge-driven deep unrolling for robust image layer separation. IEEE Transactions on Neural Networks and Learning Systems, 31(5):1653-1666, 2019. 3 +[32] Risheng Liu, Long Ma, Jiaao Zhang, Xin Fan, and Zhongxuan Luo. Retinex-inspired unrolling with cooperative prior architecture search for low-light image enhancement. In CVPR, 2021. 3 + +[33] Risheng Liu, Long Ma, Yuxi Zhang, Xin Fan, and Zhongxuan Luo. Underexposed image correction via hybrid priors navigated deep propagation. IEEE Transactions on Neural Networks and Learning Systems, 2021. 3 +[34] Xianming Liu, Gene Cheung, Xiangyang Ji, Debin Zhao, and Wen Gao. Graph-based joint dequantization and contrast enhancement of poorly lit JPEG images. IEEE Transactions on Image Processing, 28(3):1205-1219, 2018. 2 +[35] Xianming Liu, Xiaolin Wu, Jiantao Zhou, and Debin Zhao. Data-driven soft decoding of compressed images in dual transform-pixel domain. IEEE Transactions on Image Processing, 25(4):1649-1659, 2016. 2 +[36] Shigenobu Minami and Avideh Zakhor. An optimization approach for removing blocking effects in transform coding. IEEE Transactions on Circuits and Systems for Video Technology, 5(2):74-82, 1995. 2 +[37] Jing Mu, Ruiqin Xiong, Xiaopeng Fan, Dong Liu, Feng Wu, and Wen Gao. Graph-based non-convex low-rank regularization for image compression artifact reduction. IEEE Transactions on Image Processing, 29:5374–5385, 2020. 2 +[38] Leonid I. Rudin, Stanley Osher, and Emad Fatemi. Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena, 60(1-4):259-268, 1992. 3 +[39] HR Sheikh. LIVE image quality assessment database release 2. http://live.ece.utexas.edu/research/quality, 2005.6 +[40] Qiang Song, Ruiqin Xiong, Xiaopeng Fan, Dong Liu, Feng Wu, Tiejun Huang, and Wen Gao. Compressed image restoration via artifacts-free PCA basis learning and adaptive sparse modeling. IEEE Transactions on Image Processing, 29:7399-7413, 2020. 2, 6, 7, 8 +[41] Gary J Sullivan, Jens-Rainer Ohm, Woo-Jin Han, and Thomas Wiegand. Overview of the high efficiency video coding (HEVC) standard. IEEE Transactions on Circuits and Systems for Video Technology, 22(12):1649-1668, 2012. 1 +[42] Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. Memnet: A persistent memory network for image restoration. In ICCV, 2017. 3, 6, 7, 8 +[43] Gregory K. Wallace. Thejpeg still picture compression standard. IEEE Transactions on Consumer Electronics, 38(1):xviii-xxxiv, 1992. 1 +[44] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600-612, 2004. 6 +[45] Zhangyang Wang, Ding Liu, Shiyu Chang, Qing Ling, Yingzhen Yang, and Thomas S Huang. $\mathrm{D}^3$ : Deep dual-domain based fast restoration of JPEG-compressed images. In CVPR, 2016. 3 +[46] Yan Yang, Jian Sun, Huibin Li, and Zongben Xu. ADMM-CSNet: A deep learning approach for image compressive sensing. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(3):521-538, 2018. 3 +[47] Changhoon Yim and Alan Conrad Bovik. Quality assessment of deblocked images. IEEE Transactions on Image Processing, 20(1):88-98, 2010. 6 +[48] Jaeyoung Yoo, Sang-ho Lee, and Nojun Kwak. Image restoration by estimating frequency distribution of local patches. In CVPR, 2018. 3 + +[49] Seok Bong Yoo, Kyuha Choi, and Jong Beom Ra. Post-processing for blocking artifact reduction based on interblock correlation. IEEE Transactions on Multimedia, 16(6):1536-1548, 2014. 2 +[50] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. In ICLR, 2016. 4 +[51] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In International Conference on Curves and Surfaces, 2010. 6 +[52] Zhiyuan Zha, Xin Yuan, Bihan Wen, Jiachao Zhang, Jiantao Zhou, and Ce Zhu. Image restoration using joint patch-group-based sparse representation. IEEE Transactions on Image Processing, 29:7735-7750, 2020. 2 +[53] Zheng-Jun Zha, Daqing Liu, Hanwang Zhang, Yongdong Zhang, and Feng Wu. Context-aware visual policy network for fine-grained image captioning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. doi: 10.1109/TPAMI.2019.2909864.2 +[54] Guangtao Zhai, Wenjun Zhang, Xiaokang Yang, Weisi Lin, and Yi Xu. Efficient image deblocking based on postfiltering in shifted windows. IEEE Transactions on Circuits and Systems for Video Technology, 18(1):122-126, 2008. 2 +[55] Jian Zhang, Ruiqin Xiong, Chen Zhao, Yongbing Zhang, Siwei Ma, and Wen Gao. CONCOLOR: Constrained nonconvex low-rank model for image deblocking. IEEE Transactions on Image Processing, 25(3):1246-1259, 2016. 2 +[56] Kai Zhang, Luc Van Gool, and Radu Timofte. Deep unfolding network for image super-resolution. In CVPR, 2020. 3 +[57] Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Transactions on Image Processing, 26(7):3142-3155, 2017. 2, 3, 6, 7, 8 +[58] Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In CVPR, 2017. 3 +[59] Xinfeng Zhang, Weisi Lin, Ruiqin Xiong, Xianming Liu, Siwei Ma, and Wen Gao. Low-rank decomposition-based restoration of compressed images via adaptive noise estimation. IEEE Transactions on Image Processing, 25(9):4158-4171, 2016. 2, 3 +[60] Xinfeng Zhang, Ruiqin Xiong, Xiaopeng Fan, Siwei Ma, and Wen Gao. Compression artifact reduction by overlapped-block transform coefficient estimation with block similarity. IEEE Transactions on Image Processing, 22(12):4613-4626, 2013. 2, 3 +[61] Xiaoshuai Zhang, Wenhan Yang, Yueyu Hu, and Jiaying Liu. DMCNN: Dual-domain multi-scale convolutional neural network for compression artifacts removal. In ICIP, 2018. 3 +[62] Yulun Zhang, Kunpeng Li, Kai Li, Bineng Zhong, and Yun Fu. Residual non-local attention networks for image restoration. In ICLR, 2019. 3, 4, 6, 7, 8 +[63] Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. doi:10.1109/TPAMI.2020.2968521. 2, 3, 6, 7, 8 \ No newline at end of file diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/images.zip b/learningdualpriorsforjpegcompressionartifactsremoval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7503f381320ab79291af40566c33583fcad042aa --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5947b28073d24e0eb6ae8d68911fd52655ea237e505f824f0719a7e6f68b59b +size 684336 diff --git a/learningdualpriorsforjpegcompressionartifactsremoval/layout.json b/learningdualpriorsforjpegcompressionartifactsremoval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..02759e727d013772380a3097f3cf01bf016baa8e --- /dev/null +++ b/learningdualpriorsforjpegcompressionartifactsremoval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d55b088e7f6f8ff25374c754955ce76a0dbcf1a2e20c9c9bcdef8520174a0c3 +size 583227 diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_content_list.json b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0549379e4059e8cb8e756372db20b1a53e071e72 --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9534fc85c13b0ff4c6b5f79f54115a78a34e4d05189991c2fa329647d3d11957 +size 77497 diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_model.json b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_model.json new file mode 100644 index 0000000000000000000000000000000000000000..de2286a3d88988ba6208583c539765cfccf7d710 --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97036a3079f00d378d54069e4195b78b365ed146fd227a7641c5e81c96eab13b +size 95832 diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_origin.pdf b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4c3bef5a34982bf12663abda78f9e6bc3a010631 --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/96ddb3d6-7727-4c31-85b5-4d2522543031_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6bccce2e255138b597166630e7ccf8422199fd6b28a8ae3d245cfe058fe8308 +size 6154023 diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/full.md b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e1105ad4d14a24b79ed669e8864d13e0674d940a --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/full.md @@ -0,0 +1,335 @@ +# Learning Dynamic Interpolation for Extremely Sparse Light Fields with Wide Baselines + +Mantang Guo * + +Jing Jin * + +Hui Liu + +Junhui Hou + +Department of Computer Science, City University of Hong Kong, Hong Kong SAR + +{mantanguo2-c, jingjin25-c, hliu99-c}@my.cityu.edu.hk, jh.hou@cityu.edu.hk + +# Abstract + +In this paper, we tackle the problem of dense light field (LF) reconstruction from sparsely-sampled ones with wide baselines and propose a learnable model, namely dynamic interpolation, to replace the commonly-used geometry warping operation. Specifically, with the estimated geometric relation between input views, we first construct a lightweight neural network to dynamically learn weights for interpolating neighbouring pixels from input views to synthesize each pixel of novel views independently. In contrast to the fixed and content-independent weights employed in the geometry warping operation, the learned interpolation weights implicitly incorporate the correspondences between the source and novel views and adapt to different image content information. Then, we recover the spatial correlation between the independently synthesized pixels of each novel view by referring to that of input views using a geometry-based spatial refinement module. We also constrain the angular correlation between the novel views through a disparity-oriented LF structure loss. Experimental results on LF datasets with wide baselines show that the reconstructed LFs achieve much higher PSNR/SSIM and preserve the LF parallax structure better than state-of-the-art methods. The source code is publicly available at https://github.com/MantangGuo/DI4SLF. + +# 1. Introduction + +Densely-sampled light field (LF) images record not only appearance but also geometry information of 3D scenes, which enable wide applications, such as 3D reconstruction [30, 24, 3], image post-refocusing [20], and virtual reality [7, 38]. However, densely-sampled LFs raise great challenges for the acquisition. For example, camera array [33] or computer-controlled gantry [29] are either bulky and ex + +![](images/96a9e0614f1192e38a6c54b991f6694b6b229341088c4e243247c2efdab654f8.jpg) + +![](images/9a720fbdd302eb43e756cbb0d8add07d393e6f7d3c6183147126f1366beefb5b.jpg) +(b) Dynamic interpolation +Figure 1. Comparison of the commonly-used warping operation and the proposed dynamic interpolation. In contrast to the fixed and content-independent weights employed in the warping operation (taking bilinear interpolation weights as an example), we propose to dynamically learn geometry-aware and content-adaptive interpolation weights from carefully constructed embeddings. + +pensive or limited in capturing static scenes, while cost-effective commercial LF cameras [17, 21] suffer from a trade-off between the spatial and angular resolution due to the limited sensor resolution [8, 9]. + +Although many computational methods have been proposed to reconstruct densely-sampled LFs from sparsely-sampled ones, the wide baseline between input views remains a great challenge. To be more specific, non-depth-based methods [23, 37, 35, 31, 36, 4, 5] investigate the implicit signal distribution of LF data to learn the mapping from sparse to dense LFs. These methods inevitably suffer from the aliasing problem and lead to artifacts when the LF is extremely under-sampled. In comparison, depth-based methods [32, 12, 34, 11, 10] perform much better by employing the explicit geometry information. These methods follow the general pipeline of warping-based view synthe + +sis, and mainly focus on improving the disparity estimation and post-processing refinement. However, the reconstruction quality is still limited. + +In this paper, we tackle the challenging problem of LF reconstruction from extremely sparse and wide-baseline inputs, based on an insight that commonly-used warping operation confronts with natural limitations. Specifically, the warping operation synthesizes pixels of the novel view by performing interpolation using their neighboring pixels from input views. The employed interpolation weights are determined by fitting a simple and smooth curve using a small set of neighbors, which inevitably impacts the reconstruction quality as the content information is not considered. To this end, we propose a learnable module, namely dynamic interpolation, to replace the commonly-used warping operation. As shown in Fig. 1, dynamic interpolation uses a lightweight neural network to dynamically predict geometry-aware and content-adaptive interpolation weights for novel view synthesis. As the pixels of the novel views are independently synthesized, we subsequently recover the spatial correlation between them by referring to that of input views using a geometry-based refinement module. We also constrain the angular correlation between the novel views through a disparity-oriented LF structure loss. Extensive experimental results demonstrate the significant superiority of the proposed model on LF datasets with wide baselines over warping-based methods as well as other state-of-the-art ones. + +In summary, the main contributions of this paper are as follows: + +- we deeply analyze the geometry warping operation for handling the challenge of LF reconstruction from wide-baseline inputs, and figure out the essential limitation lies in the weakness of the interpolation weights; and +- we reformulate the LF reconstruction from a new perspective and propose dynamic interpolation, which is capable of overcoming the limitation of the geometry warping operation. + +# 2. Related Work + +The existing LF reconstruction methods could be roughly divided into two categories: non-learning-based methods and learning-based methods. + +Non-learning-based methods usually adopt various prior assumptions to regularize the LF data, i.e., Gaussian-based priors [16, 15, 19], sparse priors [18, 23, 28], and low-rank [13]. These methods either require many sparse samplings, or have high computational complexity. Explicitly estimating the scene depth information, and then using it to warp input sub-aperture images (SAIs) to novel ones is another kind of methods for LF reconstruction. Wanner and Goldluecke [32] estimated disparity maps at input view by calcu + +lating the structure tensor of epipolar plane images (EPIs), and then used the estimated disparity maps to warp input SAIs to the novel viewpoints. This method makes the reconstruction quality rely heavily on the accuracy of the depth estimation. Zhang et al. [39] proposed a disparity-assisted phase-based method that can iteratively refine the disparity map to minimize the phase difference between the warped novel SAI and the input SAI. However, the angular positions of synthesized SAIs are restricted to the neighbor of input views, which cannot reconstruct LFs with large baselines. + +Recently, many deep learning-based methods have been proposed to reconstruct dense LFs from sparse samplings. Yoon et al. [37] reconstructed novel SAIs from spatially up-sampled horizontal, vertical and surrounding SAI-pairs by using three separate networks. This method can only regress novel SAIs from adjacent ones, and could not process sparse LFs with large disparities. Wu et al. [35] used a 2-D image super-resolution network to recover high-frequency details along the angular dimension of the interpolated EPI. Analogously, Wang et al. [31] restored the high-frequency details of EPI stacks by using 3-D convolutional neural networks (CNNs). These methods process 2-D or 3-D slices of a 4-D sparse LF, which cannot fully explore the spatial-angular correlations implied in the LF. Yeung et al. [36] proposed the computational efficient spatial-angular separable convolution for reconstructing a dense LF from a sparse one in a single forward pass. + +The pipeline of warping-based non-learning LF reconstruction methods is also employed by several deep learning-based ones. Kalantari et al. [12] used two sequential networks to separately estimate the disparity map at the novel view, and predicted the color of novel SAI from warped images, respectively. Wu et al. [34] extracted depth information from the sheared EPI volume, and then used it to reconstruct high angular-resolution EPIs. These methods either ignore the angular relations between synthesized SAIs, or underuse the spatial information of the input SAIs during the reconstruction. Srinivasan et al. [25] reconstructed an LF from a single 2-D image with predicting 4-D ray depths. This method only works on dataset with small disparities, and is restricted by its generalization ability. Jin et al. [10] explicitly learned the disparity map at the novel viewpoint from input SAIs. They synthesized the coarse novel SAIs individually by fusing the warped input SAIs with confidence maps. Then they used a refinement network to recover the parallax structure by exploring the complementary information from the coarse LF. Zhou et al. [40] predicted the multiplane image at a reference view by using a CNN to represent the scene's content. Then the novel view can be synthesized from the multiplane image representation with homography and alpha compositing. + +![](images/4917fd8ec12d8f9abe2caadc252e863df5db85d376a63b3fff60ad3bdae158ae.jpg) +Figure 2. The flowchart of the proposed dynamic interpolation model for LF reconstruction from extremely sparse (taking $M = 2$ as an example) and wide-baseline inputs. Our proposed model consists of three components: dynamic weight learning, confidence-based blending, and geometry-based spatial refinement. + +# 3. Problem Analysis + +Denote by $\mathcal{L}(u,x,y)\in \mathbb{R}^{U\times H\times W}$ a 3-D LF containing $U$ sub-aperture images (SAIs) of each spatial resolution $H\times W$ , which are sampled along a 1-D straight line. The SAI at the angular position of $u$ is denoted as $\mathbf{I}_u$ . Given an extremely sparse LF with $M$ SAIs, denoted by $\mathcal{S} = \{\mathbf{I}_{s_1},\dots ,\mathbf{I}_{s_M}\}$ , where $M\ll U$ , our goal is to synthesize the unsampled SAIs, denoted by $\mathcal{T} = \{\mathbf{I}_{t_1},\dots ,\mathbf{I}_{t_N}\}$ , where $N = U - M$ , so that the densely-sampled LF denoted by $\widetilde{\mathcal{L}}$ can be reconstructed as close to $\mathcal{L}$ as possible. This problem can be implicitly formulated as: + +$$ +\widetilde {\mathcal {L}} = \mathcal {S} \bigcup \widetilde {\mathcal {T}} = f (\mathcal {S}), \tag {1} +$$ + +where $\widetilde{\mathcal{T}}$ is the set of synthesized novel SAIs, and $f$ denotes the mapping function to be learned. Not that we also denote the input and target SAI as $\mathbf{I}_s$ and $\mathbf{I}_t$ , respectively, in the rest of the paper for simplification. + +The SAIs of a 3-D LF image are the observations of the same scene from different viewpoints. Under the assumption of Lambertian and non-occlusion, projections of the same scene point will have the same intensity at different SAIs. This relation can be described as: + +$$ +\mathbf {I} _ {t} \left(\mathbf {x} _ {t}\right) = \mathbf {I} _ {s} \left(\mathbf {x} _ {t} ^ {\prime}\right), \tag {2} +$$ + +where $\mathbf{x}_t = (x_t, y_t)$ is the spatial coordinate, and $\mathbf{x}_t'$ is the location of the corresponding pixel of $\mathbf{I}_t(\mathbf{x}_t)$ at $\mathbf{I}_s$ . Given the disparity value of $\mathbf{I}_t(\mathbf{x}_t)$ , denoted by $d$ , $\mathbf{x}_t'$ can be easily computed as $\mathbf{x}_t' = (x_t', y_t') = (x_t + d(s - t), y_t)$ . Based on this relation, the pixels of $\mathbf{I}_t$ can be estimated by collecting their corresponding pixels on $\mathbf{I}_s$ . However, as the values of $\mathbf{x}_t'$ are always fractional, interpolation is required to compute the intensity of the corresponding pixel by the weighted sum of the neighboring pixels. The interpolation process can be formulated as: + +$$ +\mathbf {I} _ {t} \left(\mathbf {x} _ {t}\right) = \sum_ {\mathbf {x} _ {s} \in \mathcal {P} _ {\mathbf {x} _ {t} ^ {\prime}}} w \left(\mathbf {x} _ {s} - \mathbf {x} _ {t} ^ {\prime}; \phi_ {w}\right) \mathbf {I} _ {s} \left(\mathbf {x} _ {s}\right), \tag {3} +$$ + +where $\mathcal{P}_{\mathbf{x}_t'}$ is the set of neighbors of $\mathbf{x}_t'$ , and $w$ is the function with the parameter $\phi_w$ which defines the interpolation weights for the pixels of $\mathbf{I}_s$ . + +The above mentioned procedure is adopted by the commonly-used warping operation. However, we provide an insight that this procedure has natural limitations from two aspects: + +(1) It requires to estimate $d$ to locate $\mathbf{x}_t^\prime$ . However, estimating the disparities of unsampled SAIs from the input SAIs is challenging. Moreover, as $\mathcal{P}_{\mathbf{x}_t^\prime}$ is always a small set of pixels surrounding $\mathbf{x}_t^\prime$ , e.g., 2 (or $2 \times 2$ ) neighbors for linear (or bilinear) interpolation [25] and 4 (or $4 \times 4$ ) neighbors for cubic (or bicubic) interpolation [12], the reconstruction results greatly rely on the accuracy of the disparity estimation. +(2) The weight function $w(\cdot ;\phi_w)$ is defined by fitting a simple and smooth curve using the small set $\mathcal{P}_{\mathbf{x}_i'}$ , which neglects the content information. Thus, even with an accurate estimation of $d$ , it is difficult to produce high-quality results, especially on areas with texture edges, occlusion boundaries, and non-Lambertian objects. + +Base on these observations, we propose a novel model, namely dynamic interpolation, to synthesize $\widetilde{\mathcal{T}}$ from $S$ , which overcomes the limitations of the commonly-used warping operation by learning geometry-aware and content-adaptive interpolation weights. + +# 4. Proposed Method + +Overview. As shown in Fig. 2, the proposed model, namely dynamic interpolation, mainly consists of three components, i.e., dynamic weight learning, confidence- + +based blending, and geometry-based spatial refinement. Specifically, we first independently synthesize each pixel of $\widetilde{\mathbf{I}}_t$ by applying interpolation over its neighboring pixels from $\mathbf{I}_s$ . In contrast to commonly-used warping operation, the interpolation weights used in our model are dynamically learned. We also estimate confidence maps to blend the pixels interpolated from different input SAIs, which further handles the occlusion problems. Then, we recover the spatial correlation between the independently synthesized pixels by referring to that of $\mathbf{I}_s$ . + +In this paper, we set $M = 2$ . It is worth noting that our framework could be straightforwardly extended to 4-D LFs with larger $M$ . In what follows, we will introduce the technical details of the proposed method. + +# 4.1. Dynamic Weight Learning + +This module aims at learning the interpolation weights to independently synthesize each pixel of a novel SAI, denoted by $\mathbf{I}_t(\mathbf{x}_t)$ , from $\mathbf{I}_s$ . The interpolation weight for each pixel $\mathbf{I}_s(\mathbf{x}_s)$ is predicted by a multilayer perceptron (MLP), and the following information is embedded in the MLP: + +(1) The correspondence relation between $\mathbf{I}_t$ and $\mathbf{I}_s$ , which helps to implicitly locate the corresponding pixel of $\mathbf{I}_t(\mathbf{x_t})$ in $\mathbf{I}_s$ . The correspondence embedding consists of three components, i.e., a geometric code $E_{\mathbf{x}_t,\mathbf{x}_s}^{geo}$ , a spatial code $\mathbf{E}_{\mathbf{x}_t,\mathbf{x}_s}^{spa}$ , and an angular code $E_{\mathbf{x}_t,\mathbf{x}_s}^{ang}$ . Specifically, $E_{\mathbf{x}_t,\mathbf{x}_s}^{geo}$ is the disparity value of $\mathbf{I}_s(\mathbf{x}_s)$ , i.e., + +$$ +E _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {\text {g e o}} = \mathbf {D} _ {s} (\mathbf {x} _ {s}), \tag {4} +$$ + +where $\mathbf{D}_s$ is the disparity map of $\mathbf{I}_s$ , which is estimated from $\mathcal{S}$ using a pre-trained optical-flow model. $E_{\mathbf{x}_t,\mathbf{x}_s}^{spa}$ and $E_{\mathbf{x}_t,\mathbf{x}_s}^{ang}$ describe the spatial and angular distance between $\mathbf{I}_t(\mathbf{x}_t)$ and $\mathbf{I}_s(\mathbf{x}_s)$ , i.e., + +$$ +\mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {s p a} = \mathbf {x} _ {s} - \mathbf {x} _ {t}, E _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {a n g} = s - t. \tag {5} +$$ + +These information can directly determine whether $\mathbf{I}_s(\mathbf{x}_s)$ corresponds to $\mathbf{I}_t(\mathbf{x}_t)$ under the estimated geometric relation, and thus, greatly helps the MLP to locate informative pixels in $\mathbf{I}_s$ and allocate larger weights to them. + +(2) The content information around $\mathbf{I}_s(\mathbf{x}_s)$ , which helps to understand complicated scenarios, such as texture edges, occlusion boundaries, and non-Lambertian objects. To construct the content embedding, denoted by $\mathbf{E}_{\mathbf{x}_t,\mathbf{x}_s}^{ctt}$ , we first backward warp the other SAI in $S$ to $\mathbf{I}_s$ based on $\mathbf{D}_s$ , and the resulting image is denoted by $\widehat{\mathbf{I}}_{s'\rightarrow s}$ . Then, we employ a sub-CNN $f_c(\cdot)$ to learn the content information, i.e., + +$$ +\mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {c t t} = f _ {c} \left(\mathbf {x} _ {s}, \mathbf {x} _ {t}, \mathbf {I} _ {s}, \widehat {\mathbf {I}} _ {s ^ {\prime} \rightarrow s}, \mathbf {D} _ {s}\right). \tag {6} +$$ + +It is expected that $f_{c}$ is able to detect the texture edges of $\mathbf{I}_s$ and understand the occlusion and non-Lambertian relations by comparing $\mathbf{I}_s$ and $\widehat{\mathbf{I}}_{s' \to s}$ with the assistance of $\mathbf{D}_s$ . + +Finally, the geometry and content embedding, denoted by $\mathbf{E}_{\mathbf{x}_t,\mathbf{x}_s}$ , is constructed as: + +$$ +\mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} = \mathsf {C A T} \left(E _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {g e o}, \mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {s p a}, E _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {a n g}, \mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} ^ {c t t}\right), \tag {7} +$$ + +where $\mathsf{CAT}(\cdot)$ is the concatenation operation, and the interpolation weights for $\mathbf{I}_s(\mathbf{x}_s)$ to synthesize $\mathbf{I}_t(\mathbf{x}_t)$ , denoted by $W_{\mathbf{x}_t,\mathbf{x}_s}$ , is predicted as: + +$$ +W _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} = f _ {w} \left(\mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}}\right), \tag {8} +$$ + +where $f_{w}(\cdot)$ is the learnable MLP. + +To reduce the computational cost, the interpolation is performed over the neighborhood of $\mathbf{I}_t(\mathbf{x}_t)$ in $\mathbf{I}_s$ , instead of the whole range of $\mathbf{I}_s$ . Suppose the disparity range of $\mathbf{I}_t$ is $[-d_{max}, d_{max}]$ , the neighborhood of $\mathbf{I}_t(\mathbf{x}_t)$ in $\mathbf{I}_s$ is defined as: $\mathcal{P}_{\mathbf{x}_t} = \{\mathbf{x} = (x,y)|x_t - d_{max}(s - t) \leq x \leq x_t + d_{max}(s - t), y = y_t\}$ . Then, we predict the intensity of $\mathbf{I}_t(\mathbf{x}_t)$ by applying interpolation on $\mathcal{P}_{\mathbf{x}_t}$ based on the learned weights, and the predicted result is denoted by $\widetilde{\mathbf{I}}_{s \to t}(\mathbf{x}_t)$ , i.e., + +$$ +\widetilde {\mathbf {I}} _ {s \rightarrow t} (\mathbf {x} _ {t}) = \sum_ {\mathbf {x} _ {s} \in \mathcal {P} _ {\mathbf {x} _ {t}}} W _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} \mathbf {I} _ {s} (\mathbf {x} _ {s}). \tag {9} +$$ + +Remark: Compared with the commonly-used warping operation, our dynamic interpolation has the following advantages: + +(1) Instead of relying on the disparity estimation accuracy of the novel SAI, we utilize the disparity map directly estimated between input SAIs, which is much more reliable. Moreover, the geometry information is implicitly incorporated by learning the weights for each pixel in the possibly maximum neighborhood, which might improve the tolerance of the disparity estimation error. +(2) Instead of fitting a simple curve using a small set of pixels for interpolation, we learn the weights using an MLP and provide content information over a relatively large field to make the weights adaptive to various and complicated neighboring correlations. + +# 4.2. Confidence-based Blending + +Although the weight learning module has the ability of handling the problem of occlusion boundaries by embedding the content information, it is still difficult to synthesize the pixels whose correspondences are completely occluded in $\mathbf{I}_s$ by interpolation on only one of the input SAIs. Fortunately, the object occluded from one viewpoint might be visible from another one. Therefore, we blend the images synthesized from different input SAIs under the guidance of their confidence maps, which indicate the non-occlusion pixels with higher values. + +To predict the confidence value for each pixel position $\mathbf{x}_t$ in the synthesized SAI, we first aggregate the geometry and content embeddings for each neighbors of $\mathbf{x}_t$ in $\mathbf{I}_s$ by concatenation, and then apply another MLP, denoted by $f_{b}(\cdot)$ on the aggregated feature, i.e., + +$$ +\widetilde {\mathbf {C}} _ {s \rightarrow t} (\mathbf {x} _ {\mathbf {t}}) = f _ {b} \left(\mathsf {C A T} \left\{\mathbf {E} _ {\mathbf {x} _ {t}, \mathbf {x} _ {s}} \mid \mathbf {x} _ {s} \in \mathcal {P} _ {\mathbf {x} _ {t}} \right\}\right), \tag {10} +$$ + +where $\widetilde{\mathbf{C}}_{s\rightarrow t}$ is the confidence map for $\widetilde{\mathbf{I}}_{s\rightarrow t}$ . Based on the learned confidence map, the SAIs synthesized from different input SAIs are combined to produce the intermediate + +result of the novel SAI, denoted by $\widetilde{\mathbf{I}}_t^b$ , i.e., + +$$ +\widetilde {\mathbf {I}} _ {t} ^ {b} = \sum_ {s \in \left\{s _ {1}, \dots , s _ {M} \right\}} \widetilde {\mathbf {C}} _ {s \rightarrow t} \odot \widetilde {\mathbf {I}} _ {s \rightarrow t}, \tag {11} +$$ + +where $\odot$ is the element-wise multiplication operator. + +# 4.3. Geometry-based Spatial Refinement + +As pixels in $\widetilde{\mathbf{I}}_t^b$ are independently synthesized, the spatial correlations among them are not considered. To further enhance the quality of $\widetilde{\mathbf{I}}_t^b$ , we propose a refinement module to recover its spatial correlation by inferring that from the input SAIs using a sub-CNN. Considering the wide baseline between $\widetilde{\mathbf{I}}_t^b$ and $\mathbf{I}_s$ , directly applying a network will have difficulties to perceive the corresponding information from $\mathbf{I}_s$ . Therefore, we adopt a geometry-based spatial refinement, which first explicitly locates the correspondences in $\mathbf{I}_s$ at the patch level, and then learn the spatial correlations from $\mathbf{I}_s$ to refine $\widetilde{\mathbf{I}}_t^b$ . + +Let $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ denote a patch of $\widetilde{\mathbf{I}}_t^b$ centered at $\mathbf{x}_t^o = (x_t^o,y_t^o)$ . To locate its similar patch in $\mathbf{I}_s$ , we first estimate the disparity map of $\widetilde{\mathbf{I}}_t^b$ by forward warping $\mathbf{D}_s$ , resulting in $\widetilde{\mathbf{D}}_t$ , and then calculate the patch-level disparity of $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ by averaging the disparity over all of its contained pixels, leading to $\widetilde{d_h}$ . Then, the central position of the corresponding patch of $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ at $\mathbf{I}_s$ , denoted by $\mathbf{x}_s^o = (x_s^o,y_s^o)$ , can be estimated as: + +$$ +x _ {s} ^ {o} = x _ {t} ^ {o} + \widetilde {d} _ {h} (s - t). \tag {12} +$$ + +Based on $\mathbf{x}_s^o$ , we can collect the corresponding patch of $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ at $\mathbf{I}_s$ , which is denoted by $\mathbf{H}_s^{\mathbf{x}_s^o}$ . + +To recover the spatial correlation among pixels in $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ , we feed the concatenation of $\widetilde{\mathbf{H}}_t^{\mathbf{x}_t^o}$ and its corresponding patches in all the input SAIs, i.e., $\{\mathbf{H}_{s^s}^{\mathbf{x}_s^o}|s\in$ $\{s_1,\dots ,s_M\} \}$ , into a sub-CNN to predict a residual map for refinement. We then merge the refined patches to produce the final prediction of the novel SAI, i.e., + +$$ +\widetilde {\mathbf {I}} _ {t} = f _ {r} \left(\widetilde {\mathbf {I}} _ {t} ^ {b}\right), \tag {13} +$$ + +where $f_{r}(\cdot)$ denotes the geometry-based spatial refinement module. + +# 4.4. Disparity-oriented Loss + +The final and intermediate predictions of the novel SAIs are supervised by the ground-truth one, i.e., the loss function for the reconstruction of $\mathbf{I}_t$ is defined as: + +$$ +\ell_ {t} ^ {r} = \left\| \widetilde {\mathbf {I}} _ {t} - \mathbf {I} _ {t} \right\| _ {1} + \left\| \widetilde {\mathbf {I}} _ {t} ^ {b} - \mathbf {I} _ {t} \right\| _ {1} + \sum_ {s \in \{s _ {1}, \dots , s _ {M} \}} \left\| \widetilde {\mathbf {I}} _ {s \rightarrow t} - \mathbf {I} _ {t} \right\| _ {1}. \tag {14} +$$ + +Moreover, as each novel SAI is reconstructed individually, we propose a disparity-oriented LF structure loss to constrain the angular correlation between them. The relation described in Eq. (2) can be constrained by minimizing the gradients along the directions of the straight lines + +in EPIs of the LF. Considering the existence of occlusions and non-Lambertian, we instead minimizing the distance between the gradients of predicted EPIs and the ground-truth ones. Note that the directions of EPI lines are located under the guidance of the ground-truth disparity of the LFs, which are easily available in the training datasets. Such a disparity-oriented LF structure loss can be formulated as + +$$ +\ell^ {d} = \left\| \nabla_ {d} \widetilde {\mathcal {E}} - \nabla_ {d} \mathcal {E} \right\| _ {1}, \tag {15} +$$ + +where $\nabla_d$ is the gradient operator along the direction defined by the ground-truth disparity $d$ of each pixel, and $\mathcal{E}$ and $\mathcal{E}$ are the EPIs of $\widetilde{\mathcal{L}}$ and $\mathcal{L}$ , respectively. + +Our framework is end-to-end trained using the final objective function defined as: $\ell = \sum_{t\in \{t_1,\dots ,t_N\}}\ell_t^r +\lambda \ell^d$ where $\lambda \geq 0$ is the weight factor for the disparity-oriented loss. + +# 5. Experimental Results + +# 5.1. Training Details and Datasets + +Both the content embedding network $f_{c}(\cdot)$ and the spatial refinement network $f_{r}(\cdot)$ are 2-D CNNs that consist of 4 residual blocks [6] with the kernel of size $3 \times 3$ . Zerospadding was applied to keep the spatial size unchanged. We refer readers to the Supplementary Material for the detailed network architecture. At each iteration of the training phase, a $32 \times 32$ patch randomly cropped from the LF image was synthesized. We used the unfold function in PyTorch to efficiently locate the neighborhood of each synthesized pixel. + +The batch size was empirically set to 1. The learning rate was initially set to $1e^{-4}$ and reduced to $1e^{-5}$ after 8000 epochs. We used Adam [14] with $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ as the optimizer. + +We trained our framework using 29 LF images from the Inria Sparse LF dataset [22]. Each LF image contains $9 \times 9$ SAIs with a disparity range of $[-20, 20]$ between adjacent SAIs. We took the $3^{rd}$ and $7^{th}$ SAIs at the same row as inputs, which have a wide baseline up to 80 pixels, to train the framework. The test dataset consists of 7 LF images from the Inria Sparse LF dataset [22] and 14 LF images from the MPI LF archive [1]. Note that MPI [1] is a high angular-resolution LF dataset where each LF image contains 101 SAIs distributed on a scanline. Thus, we can construct testing LFs with different baselines by sampling SAIs with different intervals (see details in Section 5.2). + +# 5.2. Comparison with State-of-the-art Methods + +We compared the proposed method with three state-of-the-art deep learning-based methods for LF reconstruction, including Kalantari et al. [12], Wu et al. [34], and Jin et al. [10]. All the methods were retrained on the same dataset + +Table 1. Quantitative comparisons (PSNR/SSIM) of different methods over the Inria Sparse LF dataset [22]. + +
Light FieldDisparity rangeBaselineKalantari et al. [12]Wu et al. [34]Jin et al. [10]Ours (PWCNet)Ours (RAFT)
Electro/devices[-19.6, 32.8]28.49/0.87124.66/0.69128.51/0.86632.77/0.93633.04/0.94135.43/0.960
Flying_furniture[-34.0, 62.4]28.39/0.83828.83/0.78427.38/0.78331.69/0.89630.06/0.88133.93/0.935
Coffee_beans_vases[10.8, 58.4]27.17/0.88621.54/0.57923.04/0.83628.08/0.92729.63/0.93629.55/0.943
Dinosaur[-57.6, 72.8]23.00/0.77322.21/0.73123.07/0.78826.61/0.89724.94/0.86127.50/0.904
Flowers[-40.4, 66.0]23.05/0.75721.96/0.66723.52/0.76724.36/0.84225.24/0.86024.86/0.849
Rooster_clock[-34.4, 21.2]31.43/0.90422.71/0.71029.05/0.88727.69/0.92935.90/0.94638.16/0.966
Smilingcrowd[-40.4, 64.8]18.87/0.72217.01/0.59619.52/0.72921.01/0.82220.90/0.82422.87/0.877
Average25.77/0.82122.70/0.68025.05/0.80227.46/0.89328.53/0.89330.33/0.919
+ +![](images/dabdc1ff460336a5a3915a3f977c1eceda59cf8bf8e4a9b0d74e6004d08f7956.jpg) +(a) + +![](images/68552dcfe7a847f0854178ee7ad4c7676a163e823613ecb19615d34bd5b3bc06.jpg) +(b) +Figure 3. Quantitative comparisons (PSNR/SSIM) of different methods under different disparity ranges (pixels) between input SAIs on the MPI LF dataset [1]. All subfigures share the same legend shown in the first one. + +with the officially released codes and suggested configurations. Note that the 2-D angular convolutional layers used by Jin et al. [10] were degenerated to 1-D convolutional layers to adapt to the 3-D LF. + +To verify the advantage of the proposed dynamic interpolation in comparison to the commonly-used warping operation, we developed a baseline model by replacing the dynamic weight learning module with a disparity-based warping operation while leaving the confidence-based blending and the geometry-based refinement unchanged. Note that to ensure fair comparisons, the disparity maps of the novel views used for warping were estimated from the same inputs as Ours, i.e., the disparity maps of the input views from a pre-trained optical-flow model. + +Moreover, to demonstrate the effects of the input disparity estimation accuracy on the performance of our model, we adopted two different optical-flow methods, namely RAFT [27] and PwCNet [26], and used them to separately train two models, denoted as Ours (RAFT) and Ours (PwCNet), respectively. + +Quantitative comparisons on the Inria Sparse LF dataset. We reconstructed $5 \times 5$ LF images in the Inria dataset [22] in a row-by-row manner, and calculated the PSNR and SSIM values between the reconstructed LFs and ground-truth ones in Y channel to quantitatively evaluate different methods. Table 1 lists the results, where it can be observed that: + +- Ours (RAFT) achieves significantly higher PSNR and SSIM than Baseline. Although the disparity maps between input SAIs are also provided to Baseline, its performance is still limited by the fixed and content-independent weights employed in the commonly-used warping operation, which demonstrates the advantage of learned dynamic weights in our method; +- Ours (PWCNet) is worse than Ours (RAFT) but still much better than all the compared methods. Although the estimated disparity maps with different levels of quality are involved, our method may adaptively aggregate content features to provide gains for learning dynamic weights, which can demonstrate the advantages of learning dynamic weights over commonly-used ones. Besides, it is highly expected that our framework will be further improved with more powerful and advanced optical flow estimation proposed in future; +- our method achieves higher performance than Wu et al. [34]. The reason maybe that Wu et al. [34] reconstructed LFs in the perspective of reconstructing 2-D EPIs, and neglected modeling the correlations between two spatial dimensions, which limits the performance. On the contrary, our method employs a geometry-based refinement module to refine the correlations among pixels of novel SAIs, and further improves the reconstruction quality; and +- both Kalantari et al. [12] and Jin et al. [10] achieve worse performances than our method. In addition to that they cannot estimate disparities well from extremely sparse LFs with a limited receptive field of CNNs, they also cannot handle severe artifacts brought by the warping operation. By contrast, our method can effectively mitigate the warping errors in reconstructing extremely sparse LFs by dynamically learning content-adaptive weights for each pixel of the novel SAI. Besides, the geometry-based refinement module can further refine novel SAIs to improve the quality. + +Quantitative comparisons on the MPI LF dataset. Furthermore, we also evaluated the robustness of different methods under different disparity ranges on the MPI dataset + +![](images/7e5578529018afa993d93437cd0f22e4b0f5ff747be065bdacd68f70879042c2.jpg) +Figure 4. Visual comparisons of reconstructed LFs from different methods over the Inria Sparse LF dataset [22]. The disparity range between input SAIs of each LF is shown on the left. + +![](images/6b015aca1f7e2309edb7f1752bb2739383b00c6f5425e2f641bec81818d225cd.jpg) +Figure 5. Visual comparisons of reconstructed LFs from different methods over the MPI LF dataset [1]. The disparity range between input SAIs reaches 80 pixels for each reconstructed LF. + +Table 2. Comparisons of running time (in seconds per view) and model parameter size (M) of different methods on the Inria Sparse LF dataset [22]. + +
BaselineKalantari et al. [12]Wu et al. [34]Jin et al. [10]Ours
Time0.656.3227.770.692.78
# Params0.952.550.242.220.69
+ +[1]. Each scene contains a high-angular densely-sampled LF image composed of 101 SAIs distributed on a scanline with spatial resolution $720 \times 960$ . The disparity between adjacent SAI is around 1 pixel. We can sample SAIs with different intervals along the angular dimension to construct LFs with different disparity ranges. Specifically, we separately set 10 disparity ranges from 8 to 80 pixels between two input SAIs. For each disparity range, we evenly sampled 3 SAIs between two input SAIs as ground truth. The PSNR/SSIM shown in Fig. 3 indicates that although the reconstruction quality of all methods decreases along with the increase of the disparity range, Ours consistently achieves better reconstruction quality than the other methods under all disparity ranges, demonstrating the robustness of our method towards different disparity ranges. + +Qualitative comparisons. We visually compared reconstructed wide-baseline LFs by different methods. One of the challenges for the wide-baseline LF reconstruction is fairly reconstructing a large number of occlusion regions while are not so many in narrow-baseline ones. From reconstructed SAIs and zoomed-in regions shown in Fig. 4 + +and Fig. 5, it can be observed that our method can produce sharp edges at the occlusion boundaries, while other methods produce either severe distortions or heavy blurry effects at these regions. Moreover, our method can produce better high-frequency details at texture regions than other methods, which demonstrate that our method can still achieve high-quality LF reconstructions even under such large input disparity range. Please refer to the Supplementary Material for more visual results. + +Comparisons of the LF parallax structure. Moreover, as the parallax structure is one of the most important values of LF data, we thus managed to compare the parallax structures of LFs reconstructed by different methods. On the one hand, comparisons of EPIs in Figs. 4 and 5 indicate that our method can preserve clearer linear structures than other methods, even for lines corresponding to large-disparity regions, validating the strong ability of our method in preserving parallax structure on extremely sparse LFs. On the other hand, it is expected that depth/disparity maps estimated from high-quality LFs shall be close to those are estimated from ground-truth ones. Thus, we compared the depth maps estimated from reconstructed LFs of different methods by a identical LF-based depth estimation method [2]. As shown in Fig. 6, our method can produce sharper edges at occlusion boundaries and preserve smoothness at regions with uniform depth, which are closest to the ground truth. Such observations also demonstrate the advantage of our method on preserving the LF parallax structure. + +![](images/f8282ed67167537f72ca2c8dfbb6f354a1299df0733b4c944c16911f043462f6.jpg) +Figure 6. Visual comparisons of estimated depth maps from different methods over the Inria Sparse LF dataset [22]. The disparity range between input SAIs of each LF is shown on the left. + +Efficiency comparisons. We compared the efficiency and model size of different methods. All the methods were implemented on a Linux server with Intel CPU E5-2699 @ 2.20GHz, 128GB RAM and Tesla V100. As listed in Table 2, we can see that Ours is much faster than Kalantari et al. [12] and Wu et al. [34] but slower than Baseline and Jin et al. [10]. Besides, our model size is smaller than Baseline, Kalantari et al. [12], and Jin et al. [10], but larger than Wu et al. [34]. Taking the reconstruction accuracy, efficiency, and model size together, we believe our method is the best. + +# 5.3. Ablation Study + +We carried out comprehensive ablation studies to validate the effectiveness of three key components involved in our framework, i.e., content embedding, the geometry-based refinement module, and the disparity-oriented loss term. Specifically, each component was sequentially added to the base model until all the three components were included to form the complete model. As shown in Table 3 and Fig. 7, it can be seen that there is a significant increase of performance when adding the content embedding to the base model, which verifies the advantage brought by detecting the texture edges of input views, and understanding the occlusion and non-Lambertian relations between input views. The visual comparisons shown in Fig. 7 (examples 1-3) also verify the advantage. Moreover, the geometry-based refinement module can also bring around $0.3\mathrm{dB}$ increase of PSNR based on model with the content embedding. The examples 4-5 in Fig. 7 also shown that some fine structures such as delicate objects and textures are obviously broken without this module. It verifies the effectiveness of our refining pixel correlations in novel SAI through being guided by the correct ones from input SAIs. By comparing results in the last two rows in Table 3 and the EPIs in examples 6-7 in Fig. 7, we can see that supervising the parallax structure by the ground-truth disparity during training is helpful to reconstruct high-quality LFs. We also provide the intermediate visual results before and after confidence-based blending in Fig. 8, where it can be observed that the confidence-based blending handles the occlusion regions by leveraging the advantages of the left and right results under + +Table 3. Ablation study. “×” denotes that the corresponding component is not included, while “√” denotes being included. + +
Content embeddingGeometry-based refinementDisparity-oriented lossPSNRSSIM
×××29.050.901
✓××29.830.915
✓✓×30.140.920
✓✓✓30.330.919
+ +the guidance of their confidence maps. + +![](images/086319cbd8917e38bd425d2af1b781883096939e132afcfd06c8178b4fa658ce.jpg) +Figure 7. Effectiveness of the three key modules. + +![](images/650af99954f5f87edf61531d18b66fd44b22010a39c9570c1e3c59d874aec72a.jpg) +Figure 8. Effectiveness of confidence-based blending. + +# 6. Conclusion + +We have presented a learning-based method for densely-sampled LF reconstruction from extremely sparse ones. More precisely, we focused on addressing the challenging problem of wide-baseline inputs and proposed a novel dynamic interpolation model. By learning geometry-aware and content-adaptive interpolation weights via a lightweight neural network, our method overcomes the limitations of commonly-used warping operation, and efficiently reconstructs LFs with much higher quality, compared with state-of-the-art methods. + +# References + +[1] Vamsi Kiran Adhikarla, Marek Vinkler, Denis Sumin, Rafat Mantiuk, Karol Myszkowski, Hans-Peter Seidel, and Piotr Didyk. Towards a quality metric for dense light fields. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 58-67, 2017. +[2] Jie Chen, Junhui Hou, Yun Ni, and Lap-Pui Chau. Accurate light field depth estimation with superpixel regularization over partially occluded regions. IEEE Transactions on Image Processing, 27(10):4889-4900, 2018. +[3] Chunle Guo, Jing Jin, Junhui Hou, and Jie Chen. Accurate light field depth estimation via an occlusion-aware network. In IEEE International Conference on Multimedia and Expo (ICME), pages 1-6, 2020. +[4] Mantang Guo, Junhui Hou, Jing Jin, Jie Chen, and Lap-Pui Chau. Deep spatial-angular regularization for compressive light field reconstruction over coded apertures. In European Conference on Computer Vision (ECCV), pages 278-294. Springer, 2020. +[5] Mantang Guo, Junhui Hou, Jing Jin, Jie Chen, and Lappui Chau. Deep spatial-angular regularization for light field imaging, denoising, and super-resolution. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. +[6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. +[7] Fu-Chung Huang, Kevin Chen, and Gordon Wetzstein. The light field stereoscope: immersive computer graphics via factored near-eye light field displays with focus cues. ACM Transactions on Graphics, 34(4):60, 2015. +[8] Jing Jin, Junhui Hou, Jie Chen, and Sam Kwong. Light field spatial super-resolution via deep combinatorial geometry embedding and structural consistency regularization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2260-2269, 2020. +[9] Jing Jin, Junhui Hou, Jie Chen, Sam Kwong, and Jingyi Yu. Light field super-resolution via attention-guided fusion of hybrid lenses. In ACM International Conference on Multimedia (ACMM), pages 193-201, 2020. +[10] Jing Jin, Junhui Hou, Jie Chen, Huanqiang Zeng, Sam Kwong, and Jingyi Yu. Deep coarse-to-fine dense light field reconstruction with flexible sampling and geometry-aware fusion. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. +[11] Jing Jin, Junhui Hou, Hui Yuan, and Sam Kwong. Learning light field angular super-resolution via a geometry-aware network. In AAAI Conference on Artificial Intelligence (AAAI), volume 34, pages 11141-11148, 2020. +[12] Nima Khademi Kalantari, Ting-Chun Wang, and Ravi Ramamoorthi. Learning-based view synthesis for light field cameras. ACM Transactions on Graphics, 35(6):1-10, 2016. +[13] Mahdad Hosseini Kamal, Barmak Heshmat, Ramesh Raskar, Pierre Vandergheynst, and Gordon Wetzstein. Tensor low-rank and sparse light field photography. Computer Vision and Image Understanding, 145:172-181, 2016. + +[14] Diederik P Kingma and Jimmy Lei Ba. Adam: A method for stochastic gradient descent. In International Conference on Learning Representations (ICLR), pages 1-15, 2015. +[15] Anat Levin and Fredo Durand. Linear view synthesis using a dimensionality gap light field prior. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), pages 1831-1838. IEEE, 2010. +[16] Anat Levin, William T Freeman, and Frédo Durand. Understanding camera trade-offs through a bayesian analysis of light field projections. In European Conference on Computer Vision (ECCV), pages 88-101. Springer, 2008. +[17] Lytro. http://lytro.com, 2016. +[18] Kshitij Marwah, Gordon Wetzstein, Yosuke Bando, and Ramesh Raskar. Compressive light field photography using overcomplete dictionaries and optimized projections. ACM Transactions on Graphics, 32(4):1-12, 2013. +[19] Kaushik Mitra and Ashok Veeraraghavan. Light field denoising, light field superresolution and stereo camera based refocussing using a gmm light field patch prior. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 22-28. IEEE, 2012. +[20] Ren Ng et al. Digital light field photography. Stanford University, 2006. +[21] RayTrix. 3d light field camera technology. https://raytrix.de/. +[22] Jinglei Shi, Xiaoran Jiang, and Christine Guillemot. A framework for learning depth from a flexible subset of dense and sparse light field views. IEEE Transactions on Image Processing, 28(12):5867-5880, 2019. +[23] Lixin Shi, Haitham Hassanieh, Abe Davis, Dina Katabi, and Fredo Durand. Light field reconstruction using sparsity in the continuous fourier domain. ACM Transactions on Graphics, 34(1):1-13, 2014. +[24] Changha Shin, Hae-Gon Jeon, Youngjin Yoon, In So Kweon, and Seon Joo Kim. Epinet: A fully-convolutional neural network using epipolar geometry for depth from light field images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4748-4757, 2018. +[25] Pratul P Srinivasan, Tongzhou Wang, Ashwin Sreelal, Ravi Ramamoorthi, and Ren Ng. Learning to synthesize a 4d rgbd light field from a single image. In IEEE International Conference on Computer Vision (ICCV), pages 2243-2251, 2017. +[26] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8934-8943, 2018. +[27] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In European Conference on Computer Vision (ECCV), pages 402-419. Springer, 2020. +[28] Suren Vagharshakyan, Robert Bregovic, and Atanas Gotchev. Light field reconstruction using shearlet transform. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(1):133-147, 2017. +[29] Vaish Vaibhav and Adams Andrew. The (new) stanford light field archive. http://lightfield.stanford.edu/acq.html. + +[30] Tingchun Wang, Alexei A. Efros, and Ravi Ramamoorthi. Depth estimation with occlusion modeling using light-field cameras. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(11):2170-2181, 2016. +[31] Yunlong Wang, Fei Liu, Zilei Wang, Guangqi Hou, Zhenan Sun, and Tieniu Tan. End-to-end view synthesis for light field imaging with pseudo 4dcnn. In European Conference on Computer Vision (ECCV), pages 333-348, 2018. +[32] Sven Wanner and Bastian Goldluecke. Variational light field analysis for disparity estimation and super-resolution. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(3):606-619, 2013. +[33] Bennett Wilburn, Neel Joshi, Vaibhav Vaish, Eino-Ville Talvala, Emilio Antunez, Adam Barth, Andrew Adams, Mark Horowitz, and Marc Levoy. High performance imaging using large camera arrays. In ACM Transactions on Graphics, pages 765-776. 2005. +[34] Gaochang Wu, Yebin Liu, Qionghai Dai, and Tianyou Chai. Learning sheared epi structure for light field reconstruction. IEEE Transactions on Image Processing, 28(7):3261-3273, 2019. +[35] Gaochang Wu, Mandan Zhao, Liangyong Wang, Qionghai Dai, Tianyou Chai, and Yebin Liu. Light field reconstruction using deep convolutional network on epi. In IEEE Confer- + +ence on Computer Vision and Pattern Recognition (CVPR), pages 6319-6327. IEEE, 2017. +[36] Henry Wing Fung Yeung, Junhui Hou, Jie Chen, Yuk Ying Chung, and Xiaoming Chen. Fast light field reconstruction with deep coarse-to-fine modeling of spatial-angular clues. In European Conference on Computer Vision (ECCV), pages 137-152, 2018. +[37] Youngjin Yoon, Hae-Gon Jeon, Donggeun Yoo, Joon-Young Lee, and In So Kweon. Learning a deep convolutional network for light-field image super-resolution. In IEEE International Conference on Computer Vision Workshops (ICCVW), pages 24-32. IEEE, 2015. +[38] Jingyi Yu. A light-field journey to virtual reality. IEEE MultiMedia, 24(2):104-112, 2017. +[39] Zhoutong Zhang, Yebin Liu, and Qionghai Dai. Light field from micro-baseline image pair. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3800-3809. IEEE, 2015. +[40] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: learning view synthesis using multiplane images. ACM Transactions on Graphics, 37(4):1-12, 2018. \ No newline at end of file diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/images.zip b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7c19567b7fdf3eeba62848a1e6722344f52cbc64 --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec818a4e6c5ed918f7829175c1c5b68816380a11b4a5b49c286f438f1a4411f7 +size 711768 diff --git a/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/layout.json b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d9add172baedc0ec7cb7bff8a3dfba5c03dbd883 --- /dev/null +++ b/learningdynamicinterpolationforextremelysparselightfieldswithwidebaselines/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22edf660aab695c5ff6588fe41259e74d330a017b20bd8517f2bf0c52e5b77ec +size 443998 diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_content_list.json b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2001db2417bf1b51817202dced57ffc92833ac1c --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6082ed1393b1cb56d0fe1f867985b34d71eacd3a5b6073d766b46607030114b7 +size 75750 diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_model.json b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8551abc468c1eae1c3dcaec387c0c2555dfcf6e8 --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:517a3c5d8c890a36cacf5e6a5e811c70dbf139bc75a4d1ddf05ad86a601caebb +size 90804 diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_origin.pdf b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3cb790f73250501bb62a703a0b65d0d34f5f6abf --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/c8042fc6-9433-4b0d-a002-f0e14b338f0f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb4c00daeef64a1d99213d830acff6453c0f131893a8786a408bca0503769182 +size 5246082 diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/full.md b/learningefficientphotometricfeaturetransformformultiviewstereo/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f6f4033fd3c11a0e102173976cd52279c16d7f4e --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/full.md @@ -0,0 +1,349 @@ +# Learning Efficient Photometric Feature Transform for Multi-view Stereo + +Kaizhang Kang $^{1}$ , Cihui Xie $^{1}$ , Ruisheng Zhu $^{1}$ , Xiaohe Ma $^{1}$ , Ping Tan $^{3}$ , Hongzhi Wu $^{1*}$ and Kun Zhou $^{1,2}$ $^{1}$ Zhejiang University $^{2}$ ZJU-FaceUnity Joint Lab of Intelligent Graphics $^{3}$ Simon Fraser University + +# Abstract + +We present a novel framework to learn to convert the per-pixel photometric information at each view into spatially distinctive and view-invariant low-level features, which can be plugged into existing multi-view stereo pipeline for enhanced 3D reconstruction. Both the illumination conditions during acquisition and the subsequent per-pixel feature transform can be jointly optimized in a differentiable fashion. Our framework automatically adapts to and makes efficient use of the geometric information available in different forms of input data. High-quality 3D reconstructions of a variety of challenging objects are demonstrated on the data captured with an illumination multiplexing device, as well as a point light. Our results compare favorably with state-of-the-art techniques. + +# 1. Introduction + +As one central problem in computer vision and graphics, shape reconstruction in the presence of complex appearance is challenging. At one hand, multi-view stereo methods [8] usually require a Lambertian-dominant reflectance for computing reliable view-invariant features. The appearance variation with view or lighting is undesirable, as it may change the native spatial features on the object, or specularly reflect the projected pattern from active illumination [16, 23], leading to difficulties in correspondence computation for shape reconstruction. + +On the other hand, single-view photometric stereo [34, 5] exploits the lighting variations on each pixel and transforms the image measurements into a normal map. While high-quality details can be recovered, it suffers from low-frequency shape distortions [20]. Recently, multi-view photometric stereo [12, 32, 17] accurately integrates the photometric cues from different viewpoints, subject to the geometric constraints across multiple views. + +However, photometric stereo techniques are not scalable + +to the amount of geometric information in the input data for 3D reconstruction, leading to suboptimal results. When additional physical cues such as rapid albedo variations are present, they cannot be exploited to improve the reconstruction quality. On the other hand, when the measured photometric information is insufficient to determine a normal field, the quality of results from existing approaches will significantly degrade. Furthermore, related techniques heavily exploit reflectance properties [17, 18], which hinders the extension to handle more general appearance such as anisotropic materials. + +To tackle the above challenges, we make the key observation that it is not necessary to use normal as the intermediate representation for 3D reconstruction from photometric measurements. Instead, we propose a novel differentiable framework, to efficiently transform the per-pixel photometric information measured at each view, into automatically learned low-level features, in an end-to-end fashion. The learned per-pixel features essentially exploit the available geometric information in photometric measurements, and can be plugged in existing multi-view stereo pipelines for further processing tasks like spatial aggregation, resulting in enhanced geometric reconstruction. Furthermore, our data-driven framework is highly flexible and can adapt to various factors, including the physical acquisition capabilities / characteristics of different setups, and different types of appearance such as anisotropic reflectance, by feeding corresponding training data. + +The effectiveness of our framework is demonstrated with a high-performance illumination multiplexing device, on geometric reconstruction results of a variety of 3D objects using as few as 16 input photographs per view. Moreover, the framework is generalized to handle the input data of conventional photometric stereo with one point light on at a time (DiLiGenT-MV[17]). Our results compare favorably with state-of-the-art techniques. We make public the code and data of this project1. + +# 2. Related work + +# 2.1. Multi-view Stereo + +These methods [8] first compute low-level features in multi-view input images, which ideally should be discriminative in the spatial domain, and invariant with respect to various factors. Next, the correspondences between features at different views are established, and used to determine 3D points via triangulation. Since the raw measurements at a single pixel are usually not sufficient to accurately establish multi-view correspondences, spatial aggregation is typically performed to incorporate more information from neighboring pixels. + +Excellent results with Lambertian-dominant materials are demonstrated from photographs taken with even uncontrolled conditions [9, 24, 25]. But these methods fail on textureless objects, as the features across different locations may be almost identical. Active lighting methods, such as laser-stripe triangulation [16] or structured lighting [23], handle such cases by physically projecting spatially distinctive patterns onto the object. Additional physical dimensions like polarization can also be exploited [6]. Recently, machine learning further pushes the reconstruction quality, by replacing hand-crafted features with automatically learned ones [30, 38, 37, 31]. However, for complex appearance that changes with view / lighting conditions, it is still challenging to compute distinctive and invariant features for 3D reconstruction. + +Our work is orthogonal to the majority of work here, which focuses on processing information in the spatial domain. Instead, we focus on the angular domain, by learning to transform the per-pixel photometric information into useful features. We employ one existing pipeline for subsequent spatial-domain processing, and leave the unified treatment of both domains for future work. It is worth mentioning that the work of [36] transforms multi-view images of a homogeneous isotropic reflectance into a diffuse one, to reduce the view variance of specular reflections. + +# 2.2. Photometric Stereo + +This class of techniques compute an accurate normal field that can be subsequently integrated into a depth map, from appearance variations under typically a large number of different illumination conditions [28]. Starting from the seminal work of [34] with a Lambertian reflectance and a calibrated directional light, substantial efforts been made to extend to handle more general materials [1, 10, 27] and/or unknown lighting conditions [2, 3, 19]. + +The closest work to ours is multi-view photometric stereo. While traditional approaches consider a single view only, it combines photometric cues at multiple different views to produce a complete 3D shape. An initial coarse geometry is refined with the normal information, as + +in [12, 39, 17]. The depth maps integrated from normal fields are directly fused to obtain the final result, according to [32]. And the relationship between a signed distance field and normals is exploited in [18]. + +Our work also takes as input photometric information for 3D reconstruction. The main difference is that we do not use a fixed intermediate representation (e.g., normal), and instead compute learned low-level features that efficiently scale to the amount of geometric information available in the input data. Moreover, inspired by recent work on differentiable reflectance capture [15], our physical acquisition process can be jointly optimized with the computational transformation of features. + +# 3. Acquisition Setup + +Our main experiments are conducted with a high-performance, box-shaped lightstage, similar to [15]. Its size is $80\mathrm{cm} \times 80\mathrm{cm} \times 77\mathrm{cm}$ . The sample object is placed on a digital turntable near the center of the device, and rotated to different angles for multi-view imaging. A single FLIR BFS-U3-123S6C-C vision camera captures photographs at a resolution of $4,096 \times 3,000$ . We illuminate the sample with 24,576 LEDs on the six faces of the device with polycarbonate diffusers attached. The total LED power is about 2,000W, and the pitch of adjacent LEDs is $1\mathrm{cm}$ . We calibrate the intrinsic / extrinsic parameters of the camera, as well as the positions, orientations, angular intensity of LEDs. The rotation angle of the turntable is computed from printed markers on its surface [7]. Please refer to Fig. 1 for an illustration. + +# 4. Preliminaries + +The following derivations are based on a gray-scale channel. First, the outgoing radiance $B$ from a surface point $\mathbf{p}$ towards a camera can be modeled as [22]: + +$$ +\begin{array}{l} B (I; \mathbf {p}) = \sum_ {l} I (l) \int \frac {1}{| | \mathbf {x _ {l}} - \mathbf {x _ {p}} | | ^ {2}} \Psi (\mathbf {x _ {l}}, - \omega_ {\mathbf {i}}) V (\mathbf {x _ {l}}, \mathbf {x _ {p}}) \\ f \left(\omega_ {\mathbf {i}} ^ {\prime}; \omega_ {\mathbf {o}} ^ {\prime}, \mathbf {p}\right) \left(\omega_ {\mathbf {i}} \cdot \mathbf {n} _ {\mathbf {p}}\right) ^ {+} \left(- \omega_ {\mathbf {i}} \cdot \mathbf {n} _ {\mathbf {l}}\right) ^ {+} d \mathbf {x} _ {\mathbf {l}}. \tag {1} \\ \end{array} +$$ + +Here each light $l$ is a locally planar source. $\mathbf{x_p} / \mathbf{n_p}$ is the position / normal of $\mathbf{p}$ , while $\mathbf{x_l} / \mathbf{n_l}$ is the position / normal of a point on the light source $l$ . $\omega_{\mathrm{i}} / \omega_{\mathrm{o}}$ denotes the lighting / view direction in the world space, and $\omega_{\mathrm{i}}^{\prime} / \omega_{\mathrm{o}}^{\prime}$ is expressed in the local frame of $\mathbf{p}$ . Note that $\omega_{\mathrm{i}} = \frac{\mathbf{x}_{\mathrm{l}} - \mathbf{x}_{\mathrm{p}}}{||\mathbf{x}_{\mathrm{l}} - \mathbf{x}_{\mathrm{p}}||}$ . $I(l)$ is the intensity for the light $l$ , in the range of [0, 1]. The array $\{I(l)\}$ corresponds to a lighting pattern. $\Psi (\mathbf{x}_1,\cdot)$ represents the angular distribution of the light intensity. $V$ is a binary visibility function between $\mathbf{x_l}$ and $\mathbf{x_p}$ . The operator $(\cdot)^+$ computes the dot product between two vectors, and clamps any negative result to zero. $f(\cdot ;\omega_{\mathrm{o}}^{\prime},\mathbf{p})$ is a 2D BRDF slice, which is a function of the lighting direction. In this paper, we employ a standard anisotropic GGX + +model [33] to represent $f$ . Note that our framework is not tied to the choice of the BRDF model. + +![](images/49273099aba1c250d077938858564824c67ca0dc6dd066fbb01d28d1460ee383.jpg) +Figure 1: The lighting layout of our setup. A side view of the setup (left) and the vertical-cross parameterization of all lights with 4,096 LEDs on each face (right). + +As $B$ is linear with respect to $I$ (Eq. 1), it can be expressed as the dot product between $I$ and a lumitexel $c$ : + +$$ +B (I; \mathbf {p}) = \sum_ {l} I (l) c (l; \mathbf {p}), \tag {2} +$$ + +where $c$ is a function of the light source $l$ , defined on the surface point $\mathbf{p}$ of the sample object: + +$$ +c (l; \mathbf {p}) = B (\{I (l) = 1, \forall_ {j \neq l} I (j) = 0 \}; \mathbf {p}). \tag {3} +$$ + +Each element of $c$ records a measurement $B$ with one light on at a time. + +# 5. Overview + +We propose a mixed-domain neural network, to physically encode the photometric information into a small number of measurements by projecting learned lighting patterns, and then computationally transform spatially discriminative and view/lighting-invariant low-level features, on a per-pixel basis. The procedure is repeated for each pixel in each image taken at a particular view, resulting in multi-view, high-dimensional transformed feature maps. These maps are then post-processed and fed into an existing multi-view stereo technique to produce the final 3D geometry. Fig. 2 illustrates the process. + +While the network is originally designed to work in conjunction with our lightstage, we will describe how to generalize to handle the input of conventional photometric stereo in Sec. 7. Note that unlike related work on learning-based features [30, 37, 31], we choose not to perform spatial aggregation in the network, due to the lack of high-quality, large-scale databases of 3D objects with complex spatially-varying appearance. + +# 6. Our Network + +# 6.1. Input/Output + +The main input to the network is a physical grayscale lumitexel at a 3D surface point corresponding to a particular pixel, representing the maximum amount of information one can acquire with an illumination multiplexing setup. The parameterization of a lumitexel is the same as the lighting layout (Fig. 1). The other input is the view specification of the current image, represented as $\left[\cos (\theta),\sin (\theta)\right]$ for continuity, in which $\theta$ is the rotation angle of the turntable along its axis. The purpose of adding this extra input is to guide the network to learn global features that are view invariant. The output is a high-dimensional feature vector. The extension to handle RGB input is described in Sec. 7. + +# 6.2. Architecture + +Our network consists of two main branches that are designed to exploit different aspects of the input photometric information. Each branch produces a separate feature vector. The two vectors are then combined with a linear fully-connected (fc) layer to generate the final feature. A graphical illustration is shown in Fig. 3. + +The first branch is an intensity-sensitive one. Its first layer is a linear fc one, whose weights correspond to the lighting patterns during acquisition. This layer encodes the physical lumitexel into a small number of measurements. These measurements, along with the view specification, then go through 9 fc layers. Finally, a normalization layer produces a unit feature vector as output for training stability, as common in feature learning literature [26, 35]. + +The other branch is designed to be insensitive to the intensity of measurements. Overall its structure is similar to the first branch, with two major exceptions. First, there is an additional normalization layer right succeeding the measurements, to encourage the network to focus on photometric cues that are not related to input intensities. Second, the input view specification is added 5 layers after the first normalization one, to allow sufficient processing of the measurements. + +Our initial attempt is to use the intensity-sensitive branch only, as it is a straight-forward, end-to-end architecture. However, the resultant features hardly exhibit variations along the azimuth angle, as visualized in Fig. 4. Adding the intensity-insensitive branch helps increase the discrimination power of features (Fig. 4) and reduce the network loss at the same time (Sec. 8.2). + +Note that to physical realize the lighting patterns and to prevent degradation in the presence of training noise (Sec. 6.4), we normalize the weights in the first fc layer of each branch that correspond to a pattern, similar to [15]. During acquisition, each pattern is split into a positive and a negative one, and scaled by the inverse of the weight of the + +![](images/ce45b3fee10c71a4876b894f7b80a02950e5d173c58bed0741ac874ec156ea12.jpg) +Figure 2: Our pipeline. First, we take photographs of a 3D object under learned lighting patterns at multiple views. For each pixel at each view, our network transforms its photometric measurements to a high-dimensional feature vector. Next, dimension reduction is performed on all transformed features across different locations and views, resulting in multi-view feature maps. Finally, we send these maps as input to a multi-view stereo technique for geometric reconstruction. + +![](images/66c254b3c1b92b4a3050cf3234f3d0e40f7526751ab74688041932e3561365a5.jpg) +Figure 3: The architecture of our neural network, consisting of a measurement-intensity-sensitive branch and an insensitive one. For each branch, the input physical lumitexel is converted into a small number of measurements, with a linear fc layer that corresponds to the lighting patterns used in acquisition. The measurements, along with the view information of the current photograph, are transformed via a series of non-linear fc layers, before normalized to a unit feature vector. Finally, a linear fc layer combines the results from the two branches to output the final feature. + +maximum absolute value, to fit in the range of [0, 1]. + +# 6.3. Loss Function + +Ideally, features for multi-view stereo should have the following properties: (1) the features of the same 3D point at different views are invariant; (2) the features of two different points are sufficiently discriminative; (3) and it is efficient to compare two features for matching. + +Towards these goals, we define the following loss function to automatically learn to generate features embedded in a Euclidean latent space: + +$$ +L = L _ {\text {m a i n}} + \lambda L _ {\text {r e g}}. \tag {4} +$$ + +Here $L_{\mathrm{main}}$ is the term to enforce the distinctiveness and invariance of features. It is modified from the $E_1$ term pro + +![](images/0e6607b261e64cea4fcf46eb5b2eff02154214ebd1c4359956271a0821b59872.jpg) +Figure 4: Visualization of learned features, computed on a synthetic ball with a homogeneous BRDF. For visualization, the original high-dimensional features are first projected to 3D via PCA and then adjusted to the range of $[0,1]$ on a per-channel basis. From the left to right, the features from the intensity-sensitive / insensitive branch, and our network that combines the two. + +posed in L2-net [31] as: + +$$ +L _ {\text {m a i n}} = - \frac {1}{2} \left(\sum_ {a} \log s _ {a a} ^ {\mathrm {c o l}} + \sum_ {a} \log s _ {a a} ^ {\mathrm {r o w}}\right), \tag {5} +$$ + +where the related terms are defined as: + +$$ +s _ {i j} ^ {\mathrm {r o w}} = \frac {\exp (d _ {i j})}{\sum_ {a = 1} ^ {k} \exp (d _ {i a})}, s _ {i j} ^ {\mathrm {c o l}} = \frac {\exp (d _ {i j})}{\sum_ {a = 1} ^ {k} \exp (d _ {a j})}. \tag {6} +$$ + +Note that $d_{ij}$ is an entry in a feature distance matrix, constructed as follows. For each of $k$ training points, we randomly sample related generative parameters (Sec. 6.4), and two visible view specifications. Then we compute the corresponding lumitexels at the two sampled views for each point according to Eq. 3, resulting in $\{c_1^1, c_1^2, c_2^1, c_2^2, \ldots, c_k^1, c_k^2\}$ . Here the superscript denotes the view, while the subscript represents the point. Next, we transform these lumitexels using the current network into a set of feature vectors, as $\{h_1^1, h_1^2, h_2^1, h_2^2, \ldots, h_k^1, h_k^2\}$ . Following [31], we define $d_{ij} = ||h_i^1 - h_j^2||_2$ . This absolute Euclidean distance is converted to a relative one in Eq. 6. Note that by minimizing $L_{\mathrm{main}}$ , we are essentially maximizing $d_{ij}$ for $i \neq j$ and minimizing $d_{ii}$ , which correspond to the distinctiveness and invariance properties respectively. + +We add a regularization term $L_{\mathrm{reg}} = \sum_{w} \| w \|_2$ to the last layer to avoid overfitting, where $w$ is a weight in that layer. We use $\lambda = 3$ in all experiments. + +# 6.4. Training + +Similar to previous work on differential reflectance acquisition [14, 15], we synthesize the training lumitexels by randomly sampling parameters for evaluating Eq. 3 based on the GGX BRDF model, including the geometric parameters (the 3D position and the local frame), the material parameters (diffuse/specular albedos and anisotropic roughnesses), and a view specification $\theta$ . We use $\theta$ to transform the sampled position and local frame, which simulates the rotation of the turntable during acquisition. Also, we multiply each measurement with a Gaussian noise $(\mu = 1, \sigma = 1\%)$ during training, to increase the robustness of the network. + +# 7. Implementation Details + +To handle RGB input photographs, for each pixel we apply the network to its measurements at each channel, and concatenate the per-channel results as a long vector. For efficient subsequent processing, dimensional reduction via principal component analysis (PCA) is performed on all transformed features across different views. The reduced dimensional feature maps are then fed to our modified version of COLMAP [24, 25], which operates on multi-channel floating-point input images. + +To generalize to the input data in one state-of-the-art multi-view photometric stereo method [17], we replace the input of the network with a vector that concatenating all 96 measurements under different lighting conditions. This vector will be sent as input to both the intensity-sensitive and + +insensitive branches. As a result, the original fc layer that represents the lighting patterns (Fig. 3) is removed. + +# 8. Experiments + +Our network is implemented with PyTorch [21] on a workstation with an Intel Core i9-10940X CPU, 256GB memory and a GeForce GTX 2080 Ti graphics card. We first pre-train each branch for 100K iterations in an hour. After that, we train the complete network for 300K iterations in about 4 hours. The learning rate is set to $10^{-4}$ . For each view, we use a total number of 8 photometric measurements, with 5 for the intensity-insensitive branch and 3 for the sensitive one. This corresponds to $8 \times 2 = 16$ nonnegative lighting patterns / input photographs per view (detailed in Sec. 6.2), which takes 15 seconds to capture with our setup. To scan a 3D object, we rotate the turntable to 24 equally spaced angles ( $\theta_{i} = \frac{i}{24} 2\pi$ , $i = 0, 1, \dots, 23$ ). We use a feature length of 16 for each color channel. The dimension is reduced to 4 with PCA before sending to COLMAP. It takes 1.3 second to transform 1 million features using the network, and 1.5 hours for our modified COLMAP to compute a dense 3D point cloud out of transformed feature maps. + +We visualize our transformed per-pixel features at different views in Fig. 5. Our features respect the geometric variations (e.g., normal changes) as well as the material discontinuities (e.g., around the ears, eyes and nose of the fox), both of which are useful for discriminability. On the other hand, one can observe the reflection of the gap between LEDs from the photographs (e.g., on the fox's head and body). The gaps are inevitable as they are needed for camera installations. Our feature transform learns to reduce these adversarial, view-dependent appearance. For comparison, we also visualize the learned local patch descriptors of L2-Net [31], computed from photographs taken with a full-on lighting pattern to physically reduce the view/lighting variance of the appearance. We directly test their network pre-trained on the Brown dataset [4]. Note that our features are more view consistent compared with L2-Net, resulting in more correspondence matches as shown in the next subsection. + +# 8.1. Comparisons + +Multi-View Stereo. In Fig. 8, we compare the reconstruction results of a number of objects captured with the lightstage, using our framework against four alternative methods in multi-view stereo. CasMVSNet [11] is a state-of-the-art learning-based multi-view stereo technique. L2-Net [31] learns local features for 3D reconstruction, while differentiable reflectance capture [15] employs diffuse albedos and normals as invariant geometric features. For COLMAP [24, 25], we feed multi-view photographs taken with a full-on lighting pattern. In addition, we test + +![](images/3534e5e6dedbc9df573fe7ef0bffd63f3517875a99ff79c21b1a1941f10a1d2d.jpg) +Figure 5: Feature comparisons at different views. The top row are photographs under a full-on lighting pattern. The second row visualizes the features learned by L2-Net [31] from the above photographs. Our features are visualized in the last row, which are more consistent across multiple views. All high-dimensional features are projected to 3D for visualization. + +![](images/a834f0b28226ec02983d29fbb33f9edac89dc4f7b2f9e7234919009e517f60af.jpg) +Figure 6: Comparison between single- [13] / multiview [17] photometric stereo and our framework with a lightstage. We show color-coded geometric reconstruction errors with respect to a ground-truth model. The unit of the scale bar is mm. Quantitative errors in accuracy / completeness are reported at the bottom. + +Table 1: Quantitative evaluation of the reconstruction quality of different methods (in Fig. 8), in accuracy / completeness $(\%)$ at a $1\mathrm{mm}$ threshold. + +
Ours[11][31][15][24, 25]
Fox53.1/71.941.1/34.229.4/20.040.2/26.939.9/21.3
Cat38.5/83.633.5/23.829.7/08.828.1/13.138.4/05.7
Rooster65.3/79.866.5/60.655.8/53.856.3/19.870.6/23.1
Cup44.6/98.244.6/75.434.1/39.241.5/34.451.4/29.5
+ +another pattern equivalent to four well-spaced point lights in Fig. 9, to introduce more shading cues for reconstruction. In all cases, existing work mainly generates 3D points + +![](images/73cd8d29c8d3d4ed808b46d8f0da493a35c7917ffd45081e2310f7e9467f697d.jpg) +Figure 7: Comparison between photometric stereo and our framework adapted to the input from DiLiGenT-MV. We show color-coded geometric reconstruction errors. Quantitative errors in accuracy / completeness are reported at the bottom. + +around regions with high spatial frequencies. For other regions, reliable correspondences cannot be established due to the lack of discriminative input information. Our method produces more complete shapes, as we fully and automatically exploit the photometric information for computing distinctive and view-invariant features (visualized in Fig. 5). Please refer to Tab. 1 for quantitative errors measured in accuracy / completeness (\%) at a 1mm threshold. + +Photometric Stereo. We first compare our network adapted to the data from the lightstage, against state-of-the-art single- [13] / multi-view [17] photometric stereo in Fig. 6. One hundred photographs with different illumination conditions are fed to both methods as input. To perform quantitative error analysis on the reconstructed geometry, we acquire a ground-truth shape, using a structured-lighting-based handheld industrial scanner [29], with an accuracy of $0.05\mathrm{mm}$ . In comparison with related work, our reconstruction result has a lower geometric error, due to a wider coverage of reliable features correspondences (cf. Fig. 8). + +Next, we compare our network generalized to the input of DiLiGenT-MV (Sec. 7) against photometric stereo on the Bear object. Our result compares favorably with [5] and [17]. For [5], the integration of normals accumulates errors in depth map generation, which are challenging to correct at a single view. For [17], their quality is sensitive to the accuracy of initial points, and its depth propagation is affected by the curvature. This experiment demonstrates our generalization ability to different input conditions / acquisition setups. + +In addition, we compare in Fig. 10 the reconstruction errors of Bear between our framework and multi-view photometric stereo[17], using different number of lighting conditions sampled from DiLiGenT-MV. Our reconstruction quality is consistently higher, and does not degrade as the number of lights decreases. Fig. 11 further visualize the + +![](images/c8f28c19cfbb4b396f95a21b50e754b66db795167f27ddd0bca046afd934555a.jpg) +FOX +Photograph + +![](images/af5a2a616727e3c638ef6f7b4283616d3a82fe75b84408c11f04784fad97c0e0.jpg) +Ours + +![](images/a9396dad7ef31be8c06cb175d9971022ecdc8907a5a9c3cd9390610e3ca0c6bd.jpg) +CasMVSNet [11] + +![](images/8f210d7c231774606d39725ad4160615452f0ab9a447368c06cedb8d61747d3f.jpg) +L2-Net [31] + +![](images/10de63f90a6143f004bc15aedb81bca04b541ca55b5236145b35a35f357895e4.jpg) +Albedos/Normals[15] + +![](images/229a0241b2bc7f030aeef2f5753c725a3f132cfba18e91ef7572ae371595ece1.jpg) +COLMAP [24, 25] + +![](images/d46e56c08d2a4f4b0ec277e79a4b068f57cfec9d721b3f4b2d3cec869f3c18b3.jpg) +Ccat + +![](images/b5753383120ef65ef1f9f39736ef0e6f5490b48a1b433df0486c28bd8076c5f2.jpg) + +![](images/0058c80e928a392e5f81a42316e00cd654b186b397c755c6077aef21e2dab293.jpg) + +![](images/10d2e3781180530b281b0c15398490ec4df03b8c5de2698a36653582b1ab9cee.jpg) + +![](images/db682b128c5c1042a54a70cb0cfb1df9a0f460ee089da8d727ef4a46c7f51fb4.jpg) + +![](images/23ec2c86e2c053133921be6ffaf89de6a69520af0bb2dd77c1cd199beb3d0716.jpg) + +![](images/505dc4e796a237c29384e66458225e2c0e618c9e3a39a56523c281ff1775732d.jpg) + +![](images/b5189ce0594d023bc8e12a76216965bd6c397c8bb391f2ceab98a80dea4d36c1.jpg) +Rooster + +![](images/4cc4c667a25fbb9c501b85dd556b5676fc4f0331f710e2a7dc4358f7b52c0a2e.jpg) + +![](images/32136741ea72521c7034a56c0728b22e155d2fcb58ea1d8610ab0c6a4908d738.jpg) + +![](images/41eb57397803b08a5b86b3c2b64e5cea55f74b5670ea07516a5e39130b6f29b2.jpg) + +![](images/8b071d3e41ea1d8dc3f411166b15bce16ce7ff7a18cdd8fb1ae2e5d4285b461b.jpg) + +![](images/6cc1ccea1aca92a062103e49d70845ba496159dc930dde398a3fd149d736b5e2.jpg) + +![](images/dd2c3ecabdc91ac363551be6a343809c1a5048a89d303a8767e2be2a4e4042c2.jpg) +C +Figure 8: Comparisons with multi-view stereo methods. The first column are photographs of the physical objects. The second column to the last are geometric reconstruction results using our learned features, CasMVSNet [11], learned local features using L2-Net [31], combined results from diffuse albedo / normal maps according to [15], and COLMAP [24, 25] on images taken with a full-on lighting pattern. Corresponding quantitative errors are reported in Tab. 1. + +![](images/07ddea8fe0ccdf9b5f3063b42b56e6596f29c3859db4e521bc885a061fc69128.jpg) + +![](images/50a06b9940a05f5948efda1bd5f595858d1b32aa5f4592e7c11eeb36974a05e2.jpg) + +![](images/45530373b8d6c6d871909be0a24d46b0bdc551d7768e04510e107536b4fb26f3.jpg) + +![](images/fbdc6b203b139dce704bf93c69fe66701b712f555385a53c37f0a5fbfcebf8e7.jpg) + +![](images/5826f197dab5180e3f065d92a52c9d83aceb843e4e91e78284d8a56292f2da48.jpg) + +![](images/55d22bf8add0471d25b1bff57c7615309bdc5262e9eddee942a71c87beea2872.jpg) + +![](images/a95e47749b0143f868e3c5e9b79d45c59c7ff84c02c7629f8f1a51785dd8286f.jpg) +Figure 9: Reconstruction result using COLMAP [24, 25] on photographs with 4 point lights, for more shading cues compared with a full-on pattern. The left image is a photograph, and the right geometric reconstruction. The accuracy is $34.8\%$ and the completeness is $5.6\%$ . + +results. As can be seen from the left two images, the limited lighting variations are not sufficient to predict reliable normals, even using one state-of-the-art learning-based method [5]. On the other hand, [17] struggles to identify the azimuth angle in iso-contours, resulting in shape distortions. In comparison, our reconstruction captures the major + +![](images/6d441e5a8de47b26768f7b225bcede5319c5bd1d7c145625e1b829cc3c798124.jpg) +Figure 10: Comparison of reconstruction accuracy / completeness of Bear with multi-view photometric stereo [17] using different number of input lighting conditions, shown on the x axis. + +geometric features of the original object, demonstrating the ability to efficiently exploit even the highly limited geometric information available in the input. + +Moreover, we test on an object with highly challenging appearance and shape in Fig. 13. The scanner fails to produce a useful result, due to the complex light transport over the object surfaces that severely distorts the struc + +Table 2: The loss $L_{\mathrm{main}}$ of networks / branches with different parameters. Each corresponding bandwidth is listed between parentheses. + +
Inten.-sensitive BranchInten.-insensitive BranchOur Network
56.43 (3)53.98 (6)55.32 (3)11.33 (6)
56.85 (3)53.31 (8)53.72 (5)10.33 (8)
53.89 (5)53.17 (10)53.72 (5)9.45 (10)
+ +![](images/8e70f746caa4b60f9bc2c7a828c295a527d09e1f4bbe6094d1953444895cd91c.jpg) +Figure 11: Comparison with photometric stereo with only 4 input lighting conditions. From the left to right, the ground-truth normal map, predicted normals using [5], geometric reconstruction with [17], and our result. + +![](images/f571c5d64d5e92168a84f0ce20d96058593590982f5eb4feb4748659c9642ce3.jpg) + +![](images/3d6b2bff75b360d01fc9cc7693fa20fa0ff1656029eeaf08f3e4435fa13c96e0.jpg) + +![](images/b9c7c53083a4a4332cb903edac7f8d00e68d505b6deb8de0b504055324f393b6.jpg) + +![](images/9882cbd573bb98338ce259e6f2d4fc3b33f66a40943a69c779f8e78261b651b5.jpg) +65.1/79.8 + +![](images/7604e9dcd876232335ed275719ba3a240a8be30fa7ac964bcc42bc908d1ff0d5.jpg) +64.9/80.2 + +![](images/a6cf4478d667bc57c1b7c85cff123f69d2d8a687d7fd33eed325aa429337d41c.jpg) +64.8/77.4 +Figure 12: Impact of noise over geometric reconstruction. From the left to right, we multiply captured measurements with a unit mean and a standard deviation of $0\% / 1\% / 5\%$ Gaussian noise and show the corresponding reconstructions. Quantitative errors in accuracy / completeness are reported at the bottom. + +![](images/f4e97911f3e22205dcaedb40a20dfaaf601b3f030e2c244dbad74ebb5ab1366d.jpg) +Figure 13: Geometric reconstruction on a challenging object with complex geometry and appearance. From the left to right are our result, the result from a structured-lighting-based 3D scanner [29], single-view photometric stereo [13], and a photograph. + +![](images/b738cd37a6362a1f29326c66db35075702cb6055989f5a6ae3d8aa2c73d61089.jpg) + +![](images/cc94914c37bdba4083064b7554963eca0b694e9cdd2b924d2d4fbd0b01b229b1.jpg) + +![](images/f8eb87ceb93f236cd2f46b9f39acce2f471c973ca1c84a1f79353debf3dd633d.jpg) + +tured pattern. For a similar reason, single-view photometric stereo [13] results in a considerably deviated depth map. As a comparison, our approach produces a 3D point cloud that captures the major geometric features of the original object. + +# 8.2. Evaluations + +We set the final feature length to 4, after balancing the reconstruction time and quality. For each branch of the network, we find that using a feature length that is roughly equal to twice its measurement number strikes a good balance between the feature distinctiveness and the computation time. We report $L_{\mathrm{main}}$ of networks / branches with different parameters in Tab. 2. Overall the loss decreases with the increase of the number of measurements (i.e., bandwidth). This shows that our framework can exploit the available input bandwidth to improve the feature quality. In addition, the effectiveness of adding the intensity-insensitive branch can be observed, when comparing the second column with the last, both of which have the same bandwidth at each row. + +Finally, we evaluate the robustness of our features with respect to measurement noise in Fig. 12. The proposed framework produces reasonable results, even when a noise with 5 times the magnitude of its training counterpart is added, as shown in the figure. + +# 9. Conclusion + +We propose a novel framework to automatically and jointly learn to efficiently measure the physical photometric information and transform into distinctive and invariant features, which can be plugged into existing multi-view stereo pipeline for 3D reconstruction. High-quality geometric results are demonstrated over a number of daily objects with complex appearance, outperforming state-of-the-art techniques. We hope that our work will inspire interesting future work that combines multi-view and photometric cues for geometric reconstruction in a unified framework. + +The proposed work is subject to a number of limitations. It does not model the appearance beyond reflectance (e.g., subsurface scattering), or explicitly handle global illumination effects like self-shadows or inter-reflections. Moreover, the current framework requires calibrated, controlled illumination. It would be promising research directions to address these limitations, to extend the idea to more general settings. We are also interested in taking other physical dimensions (e.g., polarization / hyperspectral imaging) into considerations for the extra discriminative power. + +Acknowledgments. The authors would like to thank Min Li, Xiaodong Gu and Zuozhuo Dai for their help. This work is partially supported by NSF China (61772457, 62022072 & 61890954). + +# References + +[1] Neil Alldrin, Todd Zickler, and David Kriegman. Photometric stereo with non-parametric and spatially-varying reflectance. In CVPR, pages 1-8, 2008. 2 +[2] Neil G Alldrin, Satya P Mallick, and David J Kriegman. Resolving the generalized bas-relief ambiguity by entropy minimization. In CVPR, pages 1-7, 2007. 2 +[3] Ronen Basri, David Jacobs, and Ira Kemelmacher. Photometric stereo with general, unknown lighting. *IJCV*, 72(3):239-257, 2007. 2 +[4] Matthew Brown, Gang Hua, and Simon Winder. Discriminative learning of local image descriptors. TPAMI, 33(1):43-57, 2010. 5 +[5] Guanying Chen, Kai Han, and Kwan-Yee K Wong. Ps-fcn: A flexible learning framework for photometric stereo. In Proceedings of the European conference on computer vision (ECCV), pages 3-18, 2018. 1, 6, 7, 8 +[6] Zhaopeng Cui, Jinwei Gu, Boxin Shi, Ping Tan, and Jan Kautz. Polarimetric multi-view stereo. In CVPR, pages 1558-1567, 2017. 2 +[7] M. Fiala. Artag, a fiducial marker system using digital techniques. In CVPR, pages 590-596 vol. 2, 2005. 2 +[8] Yasutaka Furukawa and Carlos Hernández. Multi-view stereo: A tutorial. Foundations and Trends in Computer Graphics and Vision, 9(1-2):1-148, 2015. 1, 2 +[9] Silvano Galliani, Katrin Lasinger, and Konrad Schindler. Massively parallel multiview stereopsis by surface normal diffusion. In ICCV, pages 873-881, 2015. 2 +[10] Dan B Goldman, Brian Curless, Aaron Hertzmann, and Steven M Seitz. Shape and spatially-varying brdfs from photometric stereo. TPAMI, 32(6):1060-1071, 2009. 2 +[11] Xiaodong Gu, Zhiwen Fan, Siyu Zhu, Zuozhuo Dai, Feitong Tan, and Ping Tan. Cascade cost volume for high-resolution multi-view stereo and stereo matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2495-2504, 2020. 5, 6, 7 +[12] Carlos Hernandez, George Vogiatzis, and Roberto Cipolla. Multiview photometric stereo. TPAMI, 30(3):548-554, 2008. 1, 2 +[13] Satoshi Ikehata and Kiyoharu Aizawa. Photometric stereo using constrained bivariate regression for general isotropic surfaces. In CVPR, pages 2179-2186, 2014. 6, 8 +[14] Kaizhang Kang, Zimin Chen, Jiaping Wang, Kun Zhou, and Hongzhi Wu. Efficient reflectance capture using an autoencoder. ACM Trans. Graph., 37(4):127:1-127:10, July 2018. 5 +[15] Kaizhang Kang, Cihui Xie, Chengan He, Mingqi Yi, Minyi Gu, Zimin Chen, Kun Zhou, and Hongzhi Wu. Learning efficient illumination multiplexing for joint capture of reflectance and shape. ACM Trans. Graph., 38(6):165:1-165:12, Nov. 2019. 2, 3, 5, 6, 7 +[16] Marc Levoy, Kari Pulli, Brian Curless, Szymon Rusinkiewicz, David Koller, Lucas Pereira, Matt Ginzton, Sean Anderson, James Davis, Jeremy Ginsberg, et al. The digital michelangelo project: 3d scanning of large statues. In Proc. SIGGRAPH, pages 131-144, 2000. 1, 2 + +[17] Min Li, Zhenglong Zhou, Zhe Wu, Boxin Shi, Changyu Diao, and Ping Tan. Multi-view photometric stereo: a robust solution and benchmark dataset for spatially varying isotropic materials. IEEE Transactions on Image Processing, 29:4159-4173, 2020. 1, 2, 5, 6, 7, 8 +[18] Fotios Logothetis, Roberto Mecca, and Roberto Cipolla. A differential volumetric approach to multi-view photometric stereo. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1052-1061, 2019. 1, 2 +[19] Feng Lu, Yasuyuki Matsushita, Imari Sato, Takahiro Okabe, and Yoichi Sato. Uncalibrated photometric stereo for unknown isotropic reflectances. In CVPR, pages 1490-1497, 2013. 2 +[20] Diego Nehab, Szymon Rusinkiewicz, James Davis, and Ravi Ramamoorthi. Efficiently combining positions and normals for precise 3d geometry. ACM transactions on graphics (TOG), 24(3):536-543, 2005. 1 +[21] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, NIPS, pages 8024-8035. Curran Associates, Inc., 2019. 5 +[22] Matt Pharr, Wenzel Jakob, and Greg Humphreys. Physically based rendering: From theory to implementation. Morgan Kaufmann, 2016. 2 +[23] Joaquim Salvi, Jordi Pages, and Joan Battle. Pattern codification strategies in structured light systems. Pattern recognition, 37(4):827-849, 2004. 1, 2 +[24] Johannes Lutz Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In CVPR, 2016. 2, 5, 6, 7 +[25] Johannes Lutz Schonberger, Enliang Zheng, Marc Pollefeys, and Jan-Michael Frahm. Pixelwise view selection for unstructured multi-view stereo. In ECCV, 2016. 2, 5, 6, 7 +[26] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, pages 815-823, 2015. 3 +[27] Boxin Shi, Ping Tan, Yasuyuki Matsushita, and Katsushi Ikeuchi. Elevation angle from reflectance monotonicity: Photometric stereo for general isotropic reflectances. In ECCV, pages 455-468. Springer, 2012. 2 +[28] Boxin Shi, Zhe Wu, Zhipeng Mo, Dinglong Duan, Sai-Kit Yeung, and Ping Tan. A benchmark dataset and evaluation for non-lambertian and uncalibrated photometric stereo. In CVPR, pages 3707–3716, 2016. 2 +[29] Shining3D. EinScan Pro 2X Plus handheld industrial scanner. https://www.einscan.com/handheld-3d-scanner/2x-plus/.6,8 +[30] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Learning local feature descriptors using convex optimisation. TPAMI, 36(8):1573-1585, 2014. 2, 3 + +[31] Yurun Tian, Bin Fan, and Fuchao Wu. L2-net: Deep learning of discriminative patch descriptor in euclidean space. In CVPR, pages 661-669, 2017. 2, 3, 4, 5, 6, 7 +[32] Daniel Vlasic, Pieter Peers, Ilya Baran, Paul Debevec, Jovan Popovic, Szymon Rusinkiewicz, and Wojciech Matusik. Dynamic shape capture using multi-view photometric stereo. In ACM SIGGRAPH Asia 2009 Papers, pages 1-11. 2009. 1, 2 +[33] Bruce Walter, Stephen R. Marschner, Hongsong Li, and Kenneth E. Torrance. Microfacet models for refraction through rough surfaces. In Proceedings of the 18th Eurographics Conference on Rendering Techniques, EGSR'07, page 195-206, Goslar, DEU, 2007. Eurographics Association. 3 +[34] Robert J Woodham. Photometric method for determining surface orientation from multiple images. Optical engineering, 19(1):191139, 1980. 1, 2 +[35] Chao-Yuan Wu, R Manmatha, Alexander J Smola, and Philipp Krahenbuhl. Sampling matters in deep embedding learning. In ICCV, pages 2840-2848, 2017. 3 +[36] Shihao Wu, Hui Huang, Tiziano Portenier, Matan Sela, Daniel Cohen-Or, Ron Kimmel, and Matthias Zwicker. Specular-to-diffuse translation for multi-view reconstruction. In ECCV, pages 183–200, 2018. 2 +[37] Sergey Zagoruyko and Nikos Komodakis. Learning to compare image patches via convolutional neural networks. In CVPR, pages 4353-4361, 2015. 2, 3 +[38] Jure Zbontar and Yann LeCun. Computing the stereo matching cost with a convolutional neural network. In CVPR, pages 1592-1599, 2015. 2 +[39] Zhenglong Zhou, Zhe Wu, and Ping Tan. Multi-view photometric stereo with spatially varying isotropic materials. In CVPR, pages 1482-1489, 2013. 2 \ No newline at end of file diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/images.zip b/learningefficientphotometricfeaturetransformformultiviewstereo/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d06a87d3c91186c4c3d166b92668797535ae992 --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:815d7bdfb0b7394b92ca421180cf29a2a8c56b74fe8aa39baa76c356d29ab24b +size 591032 diff --git a/learningefficientphotometricfeaturetransformformultiviewstereo/layout.json b/learningefficientphotometricfeaturetransformformultiviewstereo/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4fe4cecdb526875fd31c277dbc8a6c96b86c3a2a --- /dev/null +++ b/learningefficientphotometricfeaturetransformformultiviewstereo/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f1e31356336631644f90814358b3d244d8995a016e4efc5a2a19c6f9c0bb1eb +size 403968 diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_content_list.json b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..59d811689382deede46afc9ff36114b5594fe165 --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82d4b16335b1844d73ca89cb42440e8f953d50fdb8c3576a43c00a9168b7aa37 +size 81306 diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_model.json b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_model.json new file mode 100644 index 0000000000000000000000000000000000000000..caffbf7e2f626a0d23edc995eff35b916e5bd24e --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e07926c97931a16c90547db28038a1132878b49a83221d5830cb9a9a775e72ae +size 101685 diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_origin.pdf b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5c772e1f5ea4f7651c05cbc727337d3a3fe21fcf --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/0085e73d-3999-4b25-b4f4-1654bc39eb31_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e11b8bb5bd7d91734020975fd0365c6498ebd48b2eb0650e0ea766a6e4682543 +size 1825548 diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/full.md b/learningfacialrepresentationsfromthecycleconsistencyofface/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c2aec3f9032eb6aa4e04dbbcb08bae25d071a948 --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/full.md @@ -0,0 +1,372 @@ +# Learning Facial Representations from the Cycle-consistency of Face + +Jia-Ren Chang + +Yong-Sheng Chen + +Wei-Chen Chiu + +National Yang Ming Chiao Tung University, Hsinchu, Taiwan + +{followwar.cs00g, yschen, walon}@nctu.edu.tw + +# Abstract + +Faces manifest large variations in many aspects, such as identity, expression, pose, and face styling. Therefore, it is a great challenge to disentangle and extract these characteristics from facial images, especially in an unsupervised manner. In this work, we introduce cycle-consistency in facial characteristics as free supervisory signal to learn facial representations from unlabeled facial images. The learning is realized by superimposing the facial motion cycle-consistency and identity cycle-consistency constraints. The main idea of the facial motion cycle-consistency is that, given a face with expression, we can perform de-expression to a neutral face via the removal of facial motion and further perform re-expression to reconstruct back to the original face. The main idea of the identity cycle-consistency is to exploit both de-identity into mean face by depriving the given neutral face of its identity via feature re-normalization and re-identity into neutral face by adding the personal attributes to the mean face. At training time, our model learns to disentangle two distinct facial representations to be useful for performing cycle-consistent face reconstruction. At test time, we use the linear protocol scheme for evaluating facial representations on various tasks, including facial expression recognition and head pose regression. We also can directly apply the learnt facial representations to person recognition, frontalization and image-to-image translation. Our experiments show that the results of our approach is competitive with those of existing methods, demonstrating the rich and unique information embedded in the disentangled representations. Code is available at https://github.com/JiaRenChang/FaceCycle. + +# 1. Introduction + +Face perception is vital for human beings and is also essential in the field of computer vision. Neuroimaging studies of both human and monkey [13, 15, 43] reveal the neuroanatomical dissociation between expression and identity representations in face perception. Their findings suggest that these facial characteristics are processed in different + +# Cycle-consistency of Face + +![](images/5311895bd50f7cb56a96c583448c23e75fb1e951716a8568e9961bbaa7c70cab.jpg) +Figure 1. We propose an unsupervised framework based on cycle-consistency for learning face disentanglement. We define that all the variations between a face and its corresponding neutral face of the same identity as expression. Similarly, all the variations between a neutral face and the global mean face are defined as identity. The input face is sequentially deprived of expression $(R_{\mathrm{exp}})$ and identity $(R_{\mathrm{id}})$ representations by networks to become the neutral face and mean face, respectively, which can be transformed back to the original face in reverse order. + +brain areas. With the renaissance of deep learning in recent years, computer vision research field follows this thread of thinking and progresses in the direction of disentangling the face characteristics into separated low-dimensional latent representations, such as identity [40], expression [45, 48], shape/appearance [35, 44], intrinsic images [36], and fine-grained attributes (age, gender, wearing glasses, etc.) [34]. + +Several supervised methods have been proposed to disentangle face characteristics for image manipulation by conditioning generative models on a pre-specified face representations, including landmarks [47], action units [32], or facial attributes [27]. Particularly, these methods are able to manipulate faces while preserving the identity. Other studies incorporate head pose information to disentangle pose-invariant representations for robust identity [40]/expression [48] recognition. Provided with neutral face, moreover, de-expression residue learning [45] can facilitate the model to learn identity-invariant expression representations for performing facial expression recognition. + +The 3D Morphable Model (3DMM) [2, 4] for face shape modeling incorporates a similar thinking of dissociation for expression and identity. The most widely-used form of 3DMM is that a face shape $\mathbf{S}$ is a linear combination of mean shape $\bar{\mathbf{S}}$ and identity and expression vectors $(\mathbf{z}_{\mathrm{id}},\mathbf{z}_{\mathrm{exp}})$ : $\mathbf{S} = \bar{\mathbf{S}} +\mathbf{A}_{\mathrm{id}}\mathbf{z}_{\mathrm{id}} + \mathbf{A}_{\mathrm{exp}}\mathbf{z}_{\mathrm{exp}}$ , where $\mathbf{A}_{\mathrm{id}}$ and + +$\mathbf{A}_{\mathrm{exp}}$ are the identity and expression PCA bases, respectively. Jiang et al. [20] introduce a variational autoencoder approach for learning latent representations of expression mesh and identity mesh in the framework of 3DMM. However, they provided strong supervision for the disentangle-ment of identity and expression representations, including ground truths of shape meshes for expression, identity, and the mean face [20]. It is difficult to generalize such methods to 2D facial images without being given any ground truth. + +In addition to the aforementioned works which are mostly based on supervised learning, recently a few studies begin to exploit the unsupervised learning framework to disentangle facial characteristics [26, 41, 42, 44]. These methods focus on extracting a part of facial characteristics. For example, FAb-Net [41] learns representations that encode information about pose and expression, [26, 41] introduce frameworks to learn representations for action unit detection, and Zhang et al. [49] propose an autoencoder to locate facial landmarks. Some unsupervised methods [35, 44] attempt to separate two independent representations of face images, including shape and appearance. However, these unsupervised methods can only disentangle a part of information of facial images, but not yet investigate a more general generative procedure of a human face, that is, simultaneous disentanglement of expression and identity representations for a wider usage. + +In this paper, we propose a novel framework that is able to simultaneously disentangle expression and identity representations from 2D facial images in an unsupervised manner. Particularly, the definition of the expression factor in our proposed method contains all the variations between an arbitrary face image and its corresponding neutral face of the same identity, including the facial expression and head pose. While for the identity factor, we define it to contain all the variations between a neutral face and the global mean face, including the facial identity and other subject-specific features such as hair style, age, gender, beard, glasses, etc. Based on these definitions, we propose two novel cycle-consistency constraints to drive our model learning, as illustrated in Figure 1. + +The first cycle-consistency constraint stems from the idea of action unit [9] in which the head poses and facial expressions are the results of the combined and coordinated action of facial muscles. Therefore, the head poses and expression can be treated as the optical flow [28] between a neutral face and any face of the same identity. To this end, a decoder is trained to learn the optical flow field of the input face without the ground truth neutral face. This is achieved by applying the proposed idea called facial motion cycle-consistency, which is able to perform both the de-expression and re-expression operations. + +The second cycle-consistency constraint originates from Eigenfaces [38], in which a facial image is represented by + +adding a linear combination of eigenfaces to the mean face, suggesting that the face identity is embedded in the linear combination of eigenfaces. Instead of representing the identity as the residue of neutral facial image relative to the mean face [38], we model the adding and depriving of identity as a renormalization procedure, analogues to the feed-forward style transfer tasks [18]. To this end, decoders are trained to learn the renormalized features without the ground truth mean face. This is achieved by applying the proposed idea called identity cycle-consistency, which is able to perform identity deprivation as de-identity and the identity styling as re-identity. + +The main contributions of our work are summarized as follows: + +- We propose a novel framework for unsupervised learning of facial representations from a single facial image, based on the novel ideas of facial motion cycle-consistency and identity cycle-consistency. +- The disentangled expression and identity features obtained by our proposed method can be easily utilized for various downstream tasks, such as facial expression recognition, head pose regression, person recognition, frontalization, and image-to-image translation. +- We demonstrate that the performance of the learned representations in different downstream tasks is competitive with the state-of-the-art methods. + +# 2. Unsupervised Learning of Facial Representations + +As motivated previously, in this paper we aim at disentangling the identity and expression representations from a single facial image. Our proposed method is mainly based on an important assumption that: a facial image $F$ , from high-level perspective, can be decomposed as follows: + +$$ +F = \bar {F} + \mathrm {i d} + \exp = \hat {F} + \exp , \tag {1} +$$ + +where $\bar{F}$ is the global mean face shared among all the faces, $\mathbf{id}$ and $\mathbf{exp}$ are the identity and expression factors respectively, and $\hat{F}$ is the neutral face of a particular identity specified by $\mathbf{id}$ . Therefore, our proposed model is trained to learn the expression and identity representations, denoted as $R_{\mathrm{exp}}$ and $R_{\mathrm{id}}$ respectively, for indicating the facial characteristics of facial images. We introduce four processes based on cycle-consistency for learning these representations, as shown in Figure 1: + +- de-expression. We define the de-expression as removing $R_{\mathrm{exp}}$ from the input facial image $F$ , in which we can obtain the neutral face $\hat{F}$ accordingly. + +![](images/988c841d63d45f9cbcef8576689b3f060cf7b3c0a0eb54653e42036f3a410651.jpg) +Figure 2. Overall architecture of the proposed model. The $E_{\mathrm{exp}}$ and $E_{\mathrm{id}}$ are trained to extract expression and identity representations respectively by using our unsupervised disentangling method. By exploring the disentangled representations, networks $D_{\mathrm{flow}}$ , $D_{\mathrm{exp}}$ , MLPs and $D_{\mathrm{id}}$ are trained to generate the representation-removed images, the neutral face $\hat{F}$ and the mean face $\bar{F}$ , and to reconstruct the representation-added images, the input face $F'$ and the neutral face $\hat{F}'$ . Please note that the proposed method needs two images to train the model as described in Sec. 2.2 and 2.4, and we only show a single image forwarding here for simplicity. + +- re-expression. The re-expression is defined as assigning $R_{\mathrm{exp}}$ to the neutral face $\hat{F}$ for reconstructing face with expressions $F'$ . +- de-identity. We define de-identity as an operation for removing $R_{\mathrm{id}}$ from the input neutral face $\hat{F}$ in order to obtain the mean face $\bar{F}$ . +- re-identity. The re-identity is defined as the process of recovering the neutral face $\hat{F}'$ back from the mean face $\bar{F}$ according to $R_{\mathrm{id}}$ . + +As illustrated in Figure 2, the overall architecture of our proposed model consists of two encoders ( $E_{\mathrm{exp}}$ and $E_{\mathrm{id}}$ ) for extracting expression and identity representations respectively, and two decoders ( $D_{\mathrm{exp}}$ , $D_{\mathrm{id}}$ ) for learning nonlinear mapping functions of the aforementioned four processes. In the following, we detail the proposed unsupervised learning method to disentangle expression and identity representations. + +# 2.1. Expression Representation + +We start with the introduction of facial motion cycle-consistency in the following. We denote that the expression representations $R_{\mathrm{exp}}$ are learned by an encoder $E_{\mathrm{exp}}$ from the input face image $F$ : + +$$ +R _ {\exp} = E _ {\exp} (F). \tag {2} +$$ + +As the idea described in the previous section, we model a facial expression as the optical flow field between the neutral face and the face with expression. Therefore, the forward $(F\rightarrow \hat{F})$ optical flow field $flow^{\mathrm{fw}}\in \mathbb{R}^{2\times H\times W}$ where $H$ and $W$ is the height and width of the input image, is learned by the decoder $D_{\mathrm{flow}}$ from expression representations. Moreover, according to the well-known forwardbackward flow consistency [1, 19], we can compute the + +backward $(\hat{F}\rightarrow F)$ optical flow field $flow^{\mathrm{bw}}$ according to $flow^{\mathrm{fw}}$ , which basically is inverse $flow^{\mathrm{fw}}$ by a warp function $\mathcal{W}$ : + +$$ +f l o w ^ {\mathrm {f w}} = D _ {\text {f l o w}} \left(R _ {\text {e x p}}\right), \tag {3} +$$ + +$$ +f l o w ^ {\mathrm {b w}} = - \mathcal {W} (f l o w ^ {\mathrm {f w}}, f l o w ^ {\mathrm {f w}}). +$$ + +We use bilinear interpolation to implement the warping operation $\mathcal{W}$ as in [39]. By using the forward optical flow field $flow^{\mathrm{fw}}$ we can warp $F$ pixel-wisely to obtain an intermediate facial image, denoted as $\tilde{F}$ . Followed by using the corresponding backward optical flow field $flow^{\mathrm{bw}}$ , we are able to warp back from $\tilde{F}$ to reconstruct $F$ . This procedure straightforwardly leads to a reconstruction loss $\mathcal{L}_{\mathrm{flow}}$ which is defined as: + +$$ +\mathcal {L} _ {\text {f l o w}} = | F - \mathcal {W} (\mathcal {W} (F, f l o w ^ {\mathrm {f w}}), f l o w ^ {\mathrm {b w}}) |. \tag {4} +$$ + +Furthermore, we exploit a general image feature extraction to represent a face image, that is, the coarse-to-fine feature maps $feat_{F}$ obtained from layers conv2_1, and conv3_1 of VGG19 network pre-trained on ImageNet [37]. Given a forward flow field $flow^{\mathrm{fw}}$ , we simply use the bilinear interpolation function $d_{s}(\cdot)$ to obtain $d_{s}(flow^{\mathrm{fw}})$ of the size equal to $feat_{F}$ . The de-expression is then achieved by first warping $feat_{F}$ with $d_{s}(flow^{\mathrm{fw}})$ and then adopting a decoder $D_{\mathrm{exp}}$ to generate neutral face image $\hat{F}$ : + +$$ +\hat {F} = D _ {\exp} \left(\mathcal {W} \left(f e a t _ {F}, d _ {s} \left(f l o w ^ {\mathrm {f w}}\right)\right)\right). \tag {5} +$$ + +Moreover, we argue that the image features $feat_{\hat{F}}$ of a neutral face obtained by VGG19 could be warped back via the downsampled backward flow $d_s(flow^{\mathrm{bw}})$ and then be fed into the decoder $D_{\mathrm{exp}}$ for reconstructing a face with expression, denoted as $F'$ , which ideally should be identical to the + +![](images/746a030441d8074cb75bf6c6c7053e2a03c62d39f3fdcdc04104f06efaf01387.jpg) +(a) Facial motion cycle-consistency + +![](images/d1f573e272514b64a632a3fe972e8265d7ce9f8a06b52cfee4340f7258b3e88e.jpg) +(b) Identity cycle-consistency +Figure 3. Illustration of (a) facial motion cycle-consistency for learning expression representations, and (b) identity cycle-consistency for learning identity representations. + +original face $F$ . This process is exactly the re-expression: + +$$ +F ^ {\prime} = D _ {\exp} \left(\mathcal {W} \left(f e a t _ {\hat {F}}, d _ {s} \left(f l o w ^ {\mathrm {b w}}\right)\right)\right). \tag {6} +$$ + +# 2.2. Facial Motion Cycle-Consistency: Invariance for Learning Expression Representation + +The change on a face image $F$ caused by a facial motion can be expressed in terms of a spatial image transformation $T$ , where we denote the corresponding face image with different motion but the same identity as $F_T$ . As both $F$ and $F_T$ are with the same identity, their corresponding neutral faces should be also identical. That is, their decoded neutral faces after performing de-expression are invariant to each other, which leads to the constraint: + +$$ +\hat {F} = \hat {F _ {T}}. \tag {7} +$$ + +Following the concept of this invariance, we should be able to apply the re-expression operation on $\text{feat}_{\hat{F}_T}$ (the features for the decoded neutral face of $F_T$ ) via the downsampled backward flow $d_s(flow_F^{\mathrm{bw}})$ of $F$ (related to the expression of $F$ ) to reconstruct a face image denoted as $F'' = D_{\mathrm{exp}}(\mathcal{W}(feat_{\hat{F}_T}, d_s(flow_F^{\mathrm{bw}}))$ , which ideally is quite similar to the original $F$ due to the hypothesis that $\text{feat}_{\hat{F}} = \text{feat}_{\hat{F}_T}$ as $\hat{F} = \hat{F}_T$ . The similar story holds for performing re-expression on $\text{feat}_{\hat{F}}$ by $d_s(flow_{F_T}^{\mathrm{bw}})$ to reconstruct $F_T'' = D_{\mathrm{exp}}(\mathcal{W}(feat_{\hat{F}}, d_s(flow_{F_T}^{\mathrm{bw}}))$ , which is almost identical to $F_T$ . The illustration of this invariance, also named as facial motion cycle-consistency, is shown in Figure 3(a). + +The reconstruction derived from the invariance (that is $F''$ versus $F$ and $F_T''$ versus $F_T$ ) builds up the objectives $\mathcal{L}_{\mathrm{exp}}$ for learning the expression representations $R_{\mathrm{exp}}$ , where we utilize both the L1 loss and the perceptual loss [11, 21] to evaluate the error of reconstruction: + +$$ +\begin{array}{l} \mathcal {L} _ {\exp} \left(F, F _ {T}\right) = \left| F - F ^ {\prime \prime} \right| + \left| F _ {T} - F _ {T} ^ {\prime \prime} \right| \tag {8} \\ + \lambda (\Phi (F, F ^ {\prime \prime}) + \Phi (F _ {T}, F _ {T} ^ {\prime \prime})), \\ \end{array} +$$ + +where $\lambda$ is set to 0.05 to balance the L1 and perceptual losses. The perceptual loss is defined as $\Phi(F, F'') =$ + +$\sum_{l}\| \phi^{l}(F) - \phi^{l}(F^{\prime \prime})\|_{2} + \sum_{l}\| \mathcal{G}(\phi^{l}(F)) - \mathcal{G}(\phi^{l}(F^{\prime \prime}))\|_{2}.$ The function $\phi^l (\cdot)$ extracts VGG19 features from layer $l$ , in which the conv2_1, conv3_1, and conv4_1 layers are used here. The function $\mathcal{G}(\cdot)$ calculates the Gram matrix of the feature map. + +# 2.3. Identity Representation + +In terms of identity representation $R_{\mathrm{id}}$ , we utilize the encoder $E_{\mathrm{id}}$ to extract $R_{\mathrm{id}}$ from the input face image $F$ : + +$$ +R _ {\mathrm {i d}} = E _ {\mathrm {i d}} (F). \tag {9} +$$ + +Based on the idea described previously, we argue that the identity representation could be deprived from the neutral face to obtain the mean face. To implement the de-identity operation, we design a decoder $D_{\mathrm{id}}$ to generate the mean face $\bar{F}$ from the modulated VGG features $\text{feat}_{\hat{F}}$ of a neutral face $\hat{F}$ , which is similar to the idea of feature modulation idea proposed in the AdaIN paper [18]: + +$$ +\bar {F} = D _ {\mathrm {i d}} \left(\frac {\text {f e a t} _ {\hat {F}} - \mu \left(\text {f e a t} _ {\hat {F}}\right)}{\sigma \left(\text {f e a t} _ {\hat {F}}\right)} \sigma^ {\mathrm {m}} + \mu^ {\mathrm {m}}\right), \tag {10} +$$ + +where $\mu (\cdot)$ and $\sigma (\cdot)$ are used to compute the mean and standard deviation respectively, and $\mu^{\mathrm{m}}$ and $\sigma^{\mathrm{m}}$ are learned from $R_{\mathrm{id}}$ by the multi-layer perceptron $\mathrm{MLP}_{\mathrm{de}}$ : + +$$ +\mu^ {\mathrm {m}}, \sigma^ {\mathrm {m}} = \mathrm {M L P} _ {\mathrm {d e}} \left(R _ {\mathrm {i d}}\right). \tag {11} +$$ + +Furthermore, the re-identity can be achieved in a similar manner but reversely with the decoder $D_{\mathrm{id}}$ : + +$$ +\hat {F} ^ {\prime} = D _ {\mathrm {i d}} \left(\frac {\text {f e a t} _ {\bar {F}} - \mu \left(\text {f e a t} _ {\bar {F}}\right)}{\sigma \left(\text {f e a t} _ {\bar {F}}\right)} \sigma^ {\mathrm {i d}} + \mu^ {\mathrm {i d}}\right), \tag {12} +$$ + +where the $\mu^{\mathrm{id}}$ and $\sigma^{\mathrm{id}}$ are also learned from $R_{\mathrm{id}}$ but by another multi-layer perceptron $\mathrm{MLP}_{\mathrm{re}}$ . + +# 2.4. Identity Cycle-Consistency: Invariance for Learning Identity Representation + +We hypothesize that the mean face is global for all the faces. In other words, no matter starting from which neural face of any identity, we should always obtain the same + +mean face after performing de-identity operation. Given the neutral faces $\hat{F}_1$ and $\hat{F}_2$ of different identities, we can derive the invariance related to identity as: + +$$ +\bar {F} _ {1} = \bar {F} _ {2}. \tag {13} +$$ + +Therefore, we should be able to reconstruct $\hat{F}_1$ by using its corresponding $\{\mu_1^{\mathrm{id}},\sigma_1^{\mathrm{id}}\}$ to apply the re-identity operation on the mean face obtained from $\hat{F}_2$ . The result of this reconstruction is denoted as $\hat{F}_1''$ : + +$$ +\hat {F} _ {1} ^ {\prime \prime} = D _ {\mathrm {i d}} \left(\frac {\text {f e a t} _ {\bar {F} _ {2}} - \mu \left(\text {f e a t} _ {\bar {F} _ {2}}\right)}{\sigma \left(\text {f e a t} _ {\bar {F} _ {2}}\right)} \sigma_ {1} ^ {\mathrm {i d}} + \mu_ {1} ^ {\mathrm {i d}}\right). \tag {14} +$$ + +Again, similar story holds to perform re-identity operation (with $\{\mu_2^{\mathrm{id}},\sigma_2^{\mathrm{id}}\}$ ) on the mean face obtained from $\hat{F}_1$ to reconstruct $\hat{F}_2$ . We denote the reconstruction result as $\hat{F}_2''$ : + +$$ +\hat {F} _ {2} ^ {\prime \prime} = D _ {\mathrm {i d}} \left(\frac {\text {f e a t} _ {\bar {F} _ {1}} - \mu \left(\text {f e a t} _ {\bar {F} _ {1}}\right)}{\sigma \left(\text {f e a t} _ {\bar {F} _ {1}}\right)} \sigma_ {2} ^ {\mathrm {i d}} + \mu_ {2} ^ {\mathrm {i d}}\right). \tag {15} +$$ + +The illustration of this invariance related to identity representations, also named as identity cycle-consistency, is shown in Figure 3(b). + +As the way that $\mathcal{L}_{\mathrm{exp}}$ is defined, the reconstruction derived from the invariance (that is, $\hat{F}_1^{\prime \prime}$ versus $\hat{F}_1$ and $\hat{F}_2^{\prime \prime}$ versus $\hat{F}_2$ ) leads to the objectives $\mathcal{L}_{\mathrm{id}}$ for learning the identity representations $R_{\mathrm{id}}$ : + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {i d}} \left(\hat {F} _ {1}, \hat {F} _ {2}\right) = \left| \hat {F} _ {1} - \hat {F} _ {1} ^ {\prime \prime} \right| + \left| \hat {F} _ {2} - \hat {F} _ {2} ^ {\prime \prime} \right| \tag {16} \\ + \lambda (\Phi (\hat {F} _ {1}, \hat {F} _ {1} ^ {\prime \prime}) + \Phi (\hat {F} _ {2}, \hat {F} _ {2} ^ {\prime \prime})). \\ \end{array} +$$ + +Moreover, we additionally introduce a margin loss $\mathcal{L}_{\mathrm{m}}$ to constrain the mean face: + +$$ +\mathcal {L} _ {\mathrm {m}} (\bar {F}, \hat {F}) = \max \left(\left\| \bar {F} - \hat {F} \right\| - \alpha , 0\right), \tag {17} +$$ + +where we set $\alpha = 0.1$ in all experiments. The main motivation behind this margin loss is that we would like to constrain the difference between the mean face and the neutral face to be within a margin. Otherwise the obtained mean face could potentially become an arbitrary image far from a face image. + +# 3. Experiments + +We report experimental results for a model trained on the combination of VoxCeleb1 [29] and VoxCeleb2 [5] from scratch. The trained representations are evaluated on several tasks, including facial expression recognition, head pose regression, person recognition, frontalization, and image-to-image translation. Through various experiments, we show that the acquired representation generalizes to a range of facial image processing tasks. + +# 3.1. Training Procedures + +The facial motion cycle-consistency described in Section 2.2 involves an image pair of faces with different expressions/poses but of the same identity. Fortunately, this type of data can be easily available from the video recording of human faces, for instance, the video of interview or talk-show, which exists widely on the Internet nowadays. Given any two frames in this type of video clip of a person, we can easily obtain a pair of facial images showing different expressions. Therefore, we can take the advantage of this type of video sequences (as the dataset described in the following) and collect training data for learning both the expression and identity representations in an unsupervised manner. + +Dataset. The proposed model is trained on the combination of VoxCeleb1 [29] and VoxCeleb2 [5] datasets, in which both datasets are built upon videos of interviews. VoxCeleb1 has in total 153,516 video clips of 1,251 speakers, while VoxCeleb2 has 145,569 video clips of 5,994 speakers. Video frames were extracted at 6 fps, cropped to have faces shown in the center of frames, and then resized to the resolution of $64 \times 64$ . We adopted VoxCeleb2 test dataset for visualizing the intermediate results of our disentanglement process. + +Stage-wise Training Procedure. We introduce a stagewise training procedure for our model learning. There are two main stages for sequentially training different parts of the proposed model, in order to disentangle the expression and identity representations. + +- Stage 1: training of $E_{\mathrm{exp}}$ , $D_{\mathrm{flow}}$ and $D_{\mathrm{exp}}$ + +For training the subnetworks related to the de-expression and re-expression parts, as the green-shaded components shown in Figure 2, the objectives of $\mathcal{L}_{\mathrm{flow}}$ and $\mathcal{L}_{\mathrm{exp}}$ are utilized to update $\{E_{\mathrm{exp}}, D_{\mathrm{flow}}, D_{\mathrm{exp}}\}$ . The transformation $T$ needed for the use of $\mathcal{L}_{\mathrm{exp}}$ can be simply obtained by having the horizontal flipping (that is, $F_T$ is the horizontally flipped version of $F$ ) or taking any arbitrary pair of faces from different frames (that is, two faces of the same person shown at different times in a video). We provide an ablation study in the supplementary materials. + +- Stage 2: training of $E_{\mathrm{id}}$ , $D_{\mathrm{id}}$ , $\mathbf{MLP}_{\mathrm{re}}$ , and $\mathbf{MLP}_{\mathrm{de}}$ + +For training the subnetworks related to the de-identity and re-identity parts, as the orange-shaded components shown in Figure 2, both the objectives of $\mathcal{L}_{\mathrm{id}}$ and $\mathcal{L}_{\mathrm{m}}$ are applied to update all of these subnetworks. + +Implementation Details. Our proposed model is implemented based on PyTorch framework and trained with the Adam optimizer $(\beta_{1} = 0.5$ , and $\beta_{2} = 0.999)$ . The batch + +size is set to 32 for all the training stages. The initial learning rate is 0.00005 in the Stage 1 and 0.0001 in the Stage 2. The Stage 1 and Stage 2 are trained for 40 and 20 epochs respectively. The learning rate is decreased by a factor of 10 at half of total epochs. Moreover, both representation encoders (i.e. $E_{\mathrm{exp}}$ and $E_{\mathrm{id}}$ ) adopt the same network architecture which is a 16-layer CNN. We leverage a VGG-19 [37] for the general feature extraction (denoted as VGG19 component in the Figure 2), where the VGG-19 encoded facial features can be further passed through our decoders (i.e. $D_{\mathrm{exp}}$ or $D_{\mathrm{id}}$ ) to generate new facial images. The model architectures are detailed in the supplementary materials. + +Baselines. We adopt the following baselines for making evaluations and comparisons in terms of the quality and representativeness of the extracted facial features: + +- HoG descriptor [6]: We follow the same setting as in [23], where the facial images are first rescaled to the size of $100 \times 100$ , then the HoG feature of 3,240 dimensions is extracted for each image. + +- LBP descriptor [30]: Similar to the HoG descriptor, we follow the same setting as in [23] to extract 1,450 dimensional LBP feature vector from each of the facial images which are resized to $100 \times 100$ . + +- MoCo [16]: We adopt the state-of-the-art self-supervised representation learning method, MoCo, as a strong baseline for us to compare with. We follow the MoCo algorithm to train the feature extractor (in which its network architecture is the same as our encoders) based on the same training dataset as ours (i.e. VoxCeleb1 and VoxCeleb2). The training runs for 40 epochs with SGD optimizer, batch size of 128, momentum 0.999, and 65,536 negative keys. + +- Self-supervisely learnt facial representations: Three state-of-the-art self-supervised frameworks of facial representation learning [24, 26, 41] are utilized to compare with our work. We directly adopt the models officially released by their authors (which are all pretrained on the Voxceleb dataset) for experimenting the downstream tasks of expression classification and head pose regression. Please note that we apply a linear protocol on their learnt features to have a fair comparison. + +# 3.2. Intermediate Results of Our Model + +Figure 4 illustrates several examples of the intermediate results obtained from our model, including the input faces, forward flow fields, neutral faces, backward flow fields, mean faces, and the faces reconstructed from their neutral ones. We demonstrate that the proposed method can handle face images with large variation in poses and can preserve facial attributes such as wearing glasses or beard. + +Visualization of the facial motion flows presents both the head motion and the movement of facial muscles. The neutral faces are deprived of facial motions in comparison to + +![](images/e08fefce009e745c0b13b8198450b13da95917f57ee2f52289b1f92e22449dd7.jpg) +Figure 4. Visualization of intermediate results of our model. Input images are from the test set of the VoxCeleb2 dataset [5]. From left to right, the columns sequentially show the input faces, forward flow fields, neutral faces, backward flow fields, mean faces, and the faces reconstructed from the corresponding neutral ones. + +their original facial images. Moreover, the mean faces obtained from different input images are almost identical to each other, which is in line with our assumption of identity invariance. + +# 3.3. Evaluation for Expression Representation + +Given the trained model, we investigate the learnt expression representation by evaluating the performance of its applications on expression recognition and head pose regression. The goal is to verify whether the expression representation successfully encodes the information related to the facial motions and poses as our definition (i.e. the expression factor contains all the variations between a face image and its corresponding neutral face of the same identity, including facial motions and head poses). We conduct linear-protocol evaluation scheme for demonstrating the effectiveness of our method. + +# 3.3.1 Expression Recognition + +Two datasets are used in the experiments of expression recognition, i.e. FER-2013 [12] and RAF-DB [23]. FER-2013 dataset [12] consists of 28,709 training and 3,589 testing images, while RAF-DB dataset consists of around 30K diverse facial images downloaded from the Internet. Please note that for the RAF-DB dataset, we follow the experimental setup as [23] to particularly use the basic emotion subset of RAF-DB, which includes 12,271 training and 3,068 testing images. For the evaluation scheme of linear-protocol, in order to directly verify the capacity of the expression fea + +
FER-2013RAF-DB
MethodAccuracy (%)Accuracy (%)
Fully supervised
FSN [50]67.6081.10
ALT [10]69.8584.50
Linear classification protocol
LBP37.8952.17
HoG45.4763.53
FAb-Net [41]46.9866.72
TCAE [24]45.0565.32
BMVC’20 [26]47.6158.86
MoCo47.2468.32
Ours48.7671.01
+ +Table 1. Evaluation on the task of expression classification based on the FER-2013 dataset [12] and RAF-DB dataset [23]. + +tures extracted by different models, we construct the linear classifier upon the frozen expression representations to perform the expression recognition, as in [16]. We follow the same procedure as [16] to train the linear layer (as the classifier) for 300 epochs, where the learning rate starts from 30 and decreases by a factor of 10 for every 80 epochs. The classifiers are trained by the SGD optimizer with cross-entropy objective and 256 batch size. + +The quantitative results shown in Table 1 demonstrate that the expression representation extracted from our proposed method is able to provide superior performance with respect to all the baselines. These results suggest that our proposed method can be used as a pretext task for expression recognition, where the rich information of facial expression is well learnt in a self-supervised manner. + +# 3.3.2 Regression of Head Pose + +Our definition indicates that the information of head poses would be also encoded into the expression representations. Obviously the calculated flow fields using the proposed method contain not only the local facial motion but also the global head motion, suggesting that our expression representation can also be used in the task of head pose regression. We adopt the 300W-LP [33] dataset and the AFLW2000 [52] dataset as the training and testing sets respectively, for experimenting the head pose regression. For the evaluation scheme of linear-protocol, we construct a linear regressor on top of the frozen expression representations $E_{\mathrm{exp}}$ . The training runs for 300 epochs for the inear-protocol with SGD optimizer and batch size set to 16. + +As shown in Table 2, for the linear-protocol evaluation scheme, the regressor based on our expression representations achieves 12.47 in terms of mean absolute error (MAE), which outperforms all the baselines. These results demonstrate the effectiveness of our proposed method for well capturing the head pose information into expression + +
MethodYawPitchRollMAE
Fully supervised
FAN [3]6.3612.38.719.12
FSA-Net [46]5.276.715.285.75
Linear regression protocol
Dlib (68 points) [22]23.1013.6010.5015.80
LBP23.5814.8616.3618.27
HoG13.9413.1714.9214.00
FAb-Net [41]13.9213.2514.5113.89
TCAE [24]21.7514.5714.8317.39
BMVC’20 [26]22.0613.5015.1416.90
MoCo28.4916.2915.5520.11
Ours11.7012.7612.9412.47
+ +Table 2. Evaluation on the task of head pose regression, where MAE stands for the mean absolute error. + +representations. + +# 3.4. Evaluating Identity Representations + +We also investigate the applications of identity representations learned by using the proposed method on the VoxCeleb dataset. Good performance of person recognition demonstrates that our identity representations do contain rich information related to identities. + +# 3.4.1 Person Recognition + +In this work we adopt LFW [17] and CPLFW [51] dataset for the evaluation of person recognition, particularly on person verification. The LFW dataset comprises of 13,233 face images from 5,749 identities and has 6,000 face pairs for evaluating person verification. The CPLFW dataset is similar to LFW but includes larger head pose variation. We directly extract the identity representations for all of the images in the face pairs from two datasets by using the encoder $E_{\mathrm{id}}$ and then compute the cosine similarity between identity representations of each pair of face images. Please note that, the features from baselines (i.e. LBP, HoG, and MoCo) are also directly applied to perform verification for a fair comparison. As shown in Table 3, our identity representations can achieve $73.72\%$ in accuracy on LFW, which outperforms the unsupervised state-of-the-art method [7]. + +# 3.5. Frontalization + +Frontalization is the process of synthesizing the frontal facing view of a single facial image. In this work, there are two ways to obtain the neutral face in the frontal view: de-expression and re-identity. The de-expression operation removes the head motion and facial expressions from facial images and thus generates the neutral faces with frontal view. On the other hand, the re-identity operation recovers the neutral face by adding the identity to the mean + +
LFWCPLFW
MethodAccuracy(%)Accuracy(%)
Fully supervised
VGG-Face [31]98.9584.00
SphereFace [25]99.4281.40
ArcFace [8]99.5392.08
Unsupervised or hand-crafted features
VGG [7]71.48-
LBP56.9051.50
HoG62.7351.73
MoCo65.8855.12
Ours73.7258.52
+ +Table 3. Evaluation on the task of person recognition based on the LFW [17] and CPLFW [51] dataset. We compare the performance of state-of-the-art methods in both supervised and unsupervised categories. + +![](images/691fc082670f7a748002cbd7b50ff43bc4f5ecc112a0f7d514935396064cb6c8.jpg) +Figure 5. The frontalization results from (a) the proposed method and (b) the method in [14]. These results clearly demonstrates the capacity of frontalization for facial images with various poses by using our method. + +face which is already in frontal view. As shown in Figure 5(a), the proposed method is able to synthesize the neutral faces from the facial images with various poses by the de-expression operation. The input images are from the LFW dataset [17] which are never seen during the training of our model. We also show a state-of-the-art approach in Figure 5(b) which additionally uses facial landmarks [14] for qualitative comparison. + +We notice that the synthesized images from the proposed method are a little bit blurry, we hypothesize that it might be caused by the plenty blurry training images in the VoxCeleb dataset. We believe that further improvements can be obtained by using other high-quality datasets. + +# 3.6. Image-to-image Translation + +The proposed model can naturally be used to perform image-to-image translation by transferring the facial motion of the source image into the target one. To this end, we simply calculate and then apply the backward flow field of the source image to warp the neutral face of the target image via the re-expression operation. As shown in Figure 6, + +![](images/2bb94e2f1158f3433799b7ff3b70394b44a889c4a8edb32a47f68456c0929907.jpg) +Figure 6. Example results of the proposed method on image-to-image translation in comparison to the X2Face [42] baseline. X2Face shows artifacts when performing large pose transfer. Notice that the proposed method does not include adversarial training to disentangle facial motion and to improve image quality. + +our method can transfer the head pose and expression from the source to the target without noticeable artifacts. On the other hand, the results of X2Face method [42] reveal visible artifacts when the pose difference between source and target is large. + +# 4. Conclusions + +In this work, we propose novel cycle-consistency constraints for disentangling of identity and expression representations from a single facial image, that is, facial motion cycle-consistency and the identity cycle-consistency. The proposed model can be trained in an unsupervised manner by superimposing the proposed cycle-consistency constraints. We perform extensive qualitative and quantitative evaluations on multiple datasets to demonstrate the efficacy of our proposed method on learning disentangled facial representations. These representations contain rich and distinct information of identity and expression, and can be used to facilitate a variety of applications, such as facial expression recognition, head pose estimation, person recognition, frontalization, and the image-to-image translation. + +Acknowledgement. This project is supported by MOST 108-2221-E-009-066-MY3, MOST 110-2636-E-009-001, and MOST 110-2634-F-009-018. We are grateful to the National Center for High-performance Computing for providing computing services and facilities. + +# References + +[1] Michael J Black and Paul Anandan. The robust estimation of multiple motions: Parametric and piecewise-smooth flow fields. Computer vision and image understanding, 63(1):75-104, 1996. 3 +[2] Volker Blanz, Thomas Vetter, et al. A morphable model for the synthesis of 3d faces. In ACM Transactions on Graphics (TOG), 1999. 1 +[3] Adrian Bulat and Georgios Tzimiropoulos. How far are we from solving the 2d & 3d face alignment problem? (and a dataset of 230,000 3d facial landmarks). In IEEE International Conference on Computer Vision (ICCV), 2017. 7 +[4] Baptiste Chu, Sami Romdhani, and Liming Chen. 3d-aided face recognition robust to expression and pose variations. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. 1 +[5] J. S. Chung, A. Nagrani, and A. Zisserman. Voxceleb2: Deep speaker recognition. In INTERSPEECH, 2018. 5, 6 +[6] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2005. 6 +[7] Samyak Datta, Gaurav Sharma, and CV Jawahar. Unsupervised learning of face representations. In IEEE International Conference on Automatic Face & Gesture Recognition (FG), 2018. 7, 8 +[8] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 8 +[9] Paul Ekman and Wallace V Friesen. Facial action coding system: Investigator's guide. Consulting Psychologists Press, 1978. 2 +[10] Corneliu Florea, Laura Florea, Mihai-Sorin Badea, Constantin Vertan, and Andrei Racoviteanu. Annealed label transfer for face expression recognition. In British Machine Vision Conference (BMVC), 2019. 7 +[11] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 4 +[12] Ian J Goodfellow, Dumitru Erhan, Pierre Luc Carrier, Aaron Courville, Mehdi Mirza, Ben Hamner, Will Cukierski, Yichuan Tang, David Thaler, Dong-Hyun Lee, et al. Challenges in representation learning: A report on three machine learning contests. In International conference on neural information processing, 2013. 6, 7 +[13] Michael E Hasselmo, Edmund T Rolls, and Gordon C Baylis. The role of expression and identity in the face-selective responses of neurons in the temporal visual cortex of the monkey. Behavioural Brain Research, 1989. 1 +[14] Tal Hassner, Shai Harel, Eran Paz, and Roee Enbar. Effective face frontalization in unconstrained images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 8 +[15] James V Haxby, Elizabeth A Hoffman, and M Ida Gobbini. The distributed human neural system for face perception. Trends in Cognitive Sciences, 2000. 1 + +[16] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 6, 7 +[17] Gary B. Huang, Manu Ramesh, Tamara Berg, and Erik Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Technical report, University of Massachusetts, Amherst, 2007. 7, 8 +[18] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In IEEE International Conference on Computer Vision (ICCV), 2017, 2, 4 +[19] Junhwa Hur and Stefan Roth. Mirrorflow: Exploiting symmetries in joint optical flow and occlusion estimation. In IEEE International Conference on Computer Vision (ICCV), 2017. 3 +[20] Zi-Hang Jiang, Qianyi Wu, Keyu Chen, and Juyong Zhang. Disentangled representation learning for 3d face shape. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2 +[21] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision (ECCV), pages 694–711. Springer, 2016. 4 +[22] Vahid Kazemi and Josephine Sullivan. One millisecond face alignment with an ensemble of regression trees. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. 7 +[23] Shan Li, Weihong Deng, and JunPing Du. Reliable crowdsourcing and deep locality-preserving learning for expression recognition in the wild. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 6, 7 +[24] Yong Li, Jiabei Zeng, Shiguang Shan, and Xilin Chen. Self-supervised representation learning from videos for facial action unit detection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 6, 7 +[25] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherface: Deep hypersphere embedding for face recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 8 +[26] Liupei Lu, Leili Tavabi, and Mohammad Soleymani. Self-supervised learning for facial action unit recognition through temporal consistency. In *British Machine Vision Conference (BMVC)*, 2020. 2, 6, 7 +[27] Yongyi Lu, Yu-Wing Tai, and Chi-Keung Tang. Attribute-guided face generation using conditional cyclegan. In European Conference on Computer Vision (ECCV), 2018. 1 +[28] Kenji Mase. Recognition of facial expression from optical flow. IEICE TRANSACTIONS on Information and Systems, 1991. 2 +[29] A. Nagrani, J. S. Chung, and A. Zisserman. Voxceleb: a large-scale speaker identification dataset. In Annual Conference of the International Speech Communication Association (INTERSPEECH), 2017. 5 +[30] Timo Ojala, Matti Pietikainen, and Topi Maenpaa. Multiresolution gray-scale and rotation invariant texture classification with local binary patterns. IEEE Transactions on Pattern + +Analysis and Machine Intelligence (TPAMI), 24(7):971-987, 2002. 6 +[31] Omkar M Parkhi, Andrea Vedaldi, and Andrew Zisserman. Deep face recognition. 2015. 8 +[32] Albert Pumarola, Antonio Agudo, Aleix M Martinez, Alberto Sanfeliu, and Francesc Moreno-Noguer. Ganimation: Anatomically-aware facial animation from a single image. In European Conference on Computer Vision (ECCV), 2018. 1 +[33] Christos Sagonas, Georgios Tzimiropoulos, Stefanos Zafeiriou, and Maja Pantic. 300 faces in-the-wild challenge: The first facial landmark localization challenge. In IEEE International Conference on Computer Vision Workshops, 2013. 7 +[34] Wei Shen and Rujie Liu. Learning residual images for face attribute manipulation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 1 +[35] Zhixin Shu, Mihir Sahasrabudhe, Riza Alp Guler, Dimitris Samaras, Nikos Paragios, and Iasonas Kokkinos. Deforming autoencoders: Unsupervised disentangling of shape and appearance. In European Conference on Computer Vision (ECCV), 2018. 1, 2 +[36] Zhixin Shu, Ersin Yumer, Sunil Hadap, Kalyan Sunkavalli, Eli Shechtman, and Dimitris Samaras. Neural face editing with intrinsic image disentangling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 1 +[37] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. ArXiv:1409.1556, 2014. 3, 6 +[38] Lawrence Sirovich and Michael Kirby. Low-dimensional procedure for the characterization of human faces. Journal of the Optical Society of America A, 1987. 2 +[39] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 3 +[40] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning gan for pose-invariant face recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 1 +[41] Olivia Wiles, A Koepke, and Andrew Zisserman. Self-supervised learning of a facial attribute embedding from video. In *British Machine Vision Conference (BMVC)*, 2018, 2, 6, 7 +[42] Olivia Wiles, A Sophia Koepke, and Andrew Zisserman. X2face: A network for controlling face generation using images, audio, and pose codes. In European Conference on Computer Vision (ECCV), 2018. 2, 8 +[43] Joel S Winston, RNA Henson, Miriam R Fine-Goulden, and Raymond J Dolan. fmri-adaptation reveals dissociable neural representations of identity and expression in face perception. Journal of Neurophysiology, 2004. 1 +[44] Xianglei Xing, Tian Han, Ruiqi Gao, Song-Chun Zhu, and Ying Nian Wu. Unsupervised disentangling of appearance and geometry by deformable generator network. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 + +[45] Huiyuan Yang, Umur Ciftci, and Lijun Yin. Facial expression recognition by de-expression residue learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1 +[46] Tsun-Yi Yang, Yi-Ting Chen, Yen-Yu Lin, and Yung-Yu Chuang. Fsa-net: Learning fine-grained structure aggregation for head pose estimation from a single image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 7 +[47] Egor Zakharov, Aliaksandra Shysheya, Egor Burkov, and Victor Lempitsky. Few-shot adversarial learning of realistic neural talking head models. In IEEE International Conference on Computer Vision (ICCV), 2019. 1 +[48] Feifei Zhang, Tianzhu Zhang, Qirong Mao, and Changsheng Xu. Joint pose and expression modeling for facial expression recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1 +[49] Yuting Zhang, Yijie Guo, Yixin Jin, Yijun Luo, Zhiyuan He, and Honglak Lee. Unsupervised discovery of object landmarks as structural representations. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2 +[50] Shuwen Zhao, Haibin Cai, Honghai Liu, Jianhua Zhang, and Shengyong Chen. Feature selection mechanism in cnns for facial expression recognition. In British Machine Vision Conference (BMVC), 2018. 7 +[51] T. Zheng and W. Deng. Cross-posed ffw: A database for studying cross-posed face recognition in unconstrained environments. Technical Report 18-01, Beijing University of Posts and Telecommunications, February 2018. 7, 8 +[52] Xiangyu Zhu, Zhen Lei, Xiaoming Liu, Hailin Shi, and Stan Z Li. Face alignment across large poses: A 3d solution. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 7 \ No newline at end of file diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/images.zip b/learningfacialrepresentationsfromthecycleconsistencyofface/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..95d2c57b18549a81cfcd7ca618d155480bcb6d1d --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e45a857b34ece6ff68e0b723d12bdd5605bf9064bb0cd5801724d3bca1e50e21 +size 511215 diff --git a/learningfacialrepresentationsfromthecycleconsistencyofface/layout.json b/learningfacialrepresentationsfromthecycleconsistencyofface/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7e1418371d73d110250cf2ad32196c309dc30c22 --- /dev/null +++ b/learningfacialrepresentationsfromthecycleconsistencyofface/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3445df3263d09ffc26b4c0acc9d8c3bc83f2ae79073f2ac65c639279469e3e1 +size 474027 diff --git a/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_content_list.json b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..796e9a4d95c193fc01ebe3bf41abe047de9b6640 --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f7b13bf3f3bc3e1335330f3047e60b042e2c673f9690dabf2ff145a671909c0 +size 83704 diff --git a/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_model.json b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c2cfa595f0737dffa1e3035cc79143c4bd742fc4 --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220ad2209987f073374f54cde5b0b00ccf602f7c7ec3e9c376c11689485ad2d7 +size 104896 diff --git a/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_origin.pdf b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..abb63f6c1d3b140ca56b7217e7f0dfe0e88f23ba --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/1376ef13-b27d-4879-ba1f-ceb9c63448bd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e2e37207dc094cf610ae38c5ffe44578a9a4c752587f732c4603440b9f305a2 +size 465807 diff --git a/learningfastsamplereweightingwithoutrewarddata/full.md b/learningfastsamplereweightingwithoutrewarddata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d1700002f2fa8debc2d33dd7f95fb666af1086c8 --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/full.md @@ -0,0 +1,384 @@ +# Learning Fast Sample Re-weighting Without Reward Data + +Zizhao Zhang Tomas Pfister Google Cloud AI + +# Abstract + +Training sample re-weighting is an effective approach for tackling data biases such as imbalanced and corrupted labels. Recent methods develop learning-based algorithms to learn sample re-weighting strategies jointly with model training based on the frameworks of reinforcement learning and meta learning. However, depending on additional unbiased reward data is limiting their general applicability. Furthermore, existing learning-based sample re-weighting methods require nested optimizations of models and weighting parameters, which requires expensive second-order computation. This paper addresses these two problems and presents a novel learning-based fast sample re-weighting (FSR) method that does not require additional reward data. The method is based on two key ideas: learning from history to build proxy reward data and feature sharing to reduce the optimization cost. Our experiments show the proposed method achieves competitive results compared to state of the arts on label noise robustness and long-tailed recognition, and does so while achieving significantly improved training efficiency. The source code is publicly available at https://github.com/google-research/google-research/tree/master/ieg. + +# 1. Introduction + +The performance of DNNs is dependent on the scale of training datasets and the quality of labels. Data biases are inevitable in practice, and in particular, noisy labels [51, 61] or imbalanced classes [9, 25] can negatively influence the model performance. + +Sample re-weighting is an effective strategy that has been explored to address problems caused by data biases [5]. The underline principle of sample re-weighting is as simple as upgrading the weights of good samples and downgrading the weights of bad samples. Finding effective weights that can optimize the model training with stochastic gradient descent (SGD) is a dynamic process. The optimal weight of a sample can change over model training phases. Over-weighting simple samples at later phases while under-weighting hard samples at early phases can cause negative effects to the + +![](images/67e76c3c7f1e033089171518c86e59c0e3cb811efc95a0a197e2c64124495cbe.jpg) +Figure 1. Overview of the proposed method compared with typical method for meta re-weighting. Our method is fast and does not need reward data. + +![](images/a2105dc6c5b7da2670993bfea504df59732280abadcfbba4eeedaa784013d078.jpg) + +overall DNN accuracy [16]. In light of the advances in meta learning and reinforcement learning (RL), there is a growing interest in learning-to-learn based algorithms to optimize sample weights jointly with model training [44, 47, 20, 57]. This problem well resembles the design of MAML [13]: incorporating meta optimization inside the supervised training for sample weight optimization. The meta-objective of reweighting is usually defined as finding the optimal weight per sample such that the trained model has the best objective on an additional reward (a.k.a. validation) dataset. Moreover, such reward dataset is required to be unbiased and to have reasonable size. For example, in label noise robust training problems, this unbiased reward dataset is expected to have clean and class-balanced labels. This extra requirement has been noted to be problematic, but how to remove such a requirement remains unanswered [6]. + +From an optimization and efficiency perspective, although this problem can be directly formulated as an RL problem, the training computation is very expensive [15, 57]. Therefore, most existing work follows the more efficient meta learning framework, assuming that the weight optimization with respect to reward signals is a fully differentiable problem. Even so, similarly to MAML, the overall computation still requires a second-order unroll of DNN computation graphs, which increases the memory requirement and training time complexity significantly [44]. Such a limitation hinders the applicability of the method to large-scale DNNs, and emphasizes the importance of the need for further improving efficiency. + +In this paper, we present a new fast sample re-weighting (FSR) method to overcome the two aforementioned problems + +(Figure 1): a) removing reward data dependence and b) improving training efficiency. To this end we make the following contributions: + +- We leverage a dictionary (essentially an extra buffer) to monitor the training history reflected by the model updates during meta optimization periodically, and propose a valuation function to discover meaningful samples from training data as the proxy of reward data. The unbiased dictionary keeps being updated and provides reward signals to optimize sample weights. +- Motivated by an investigation we conducted into the mechanism of sample weight meta-objective, instead of maintaining model states for both model and sample weight updates separately, we propose to enable feature sharing for saving the computation cost used for maintaining respective states. The proposed method demonstrates significant improvement in training efficiency, which is a desirable feature for large-scale DNN training compared to previous learning-based sample weighting methods. +- Because our proposed method does not rely on additional reward data, we can directly apply it to tackle common data biases, including noisy labels and long-tailed recognition, as well as more challenging complex of these two types of label corruption. Since fast re-weighting ability of FSR is orthogonal to domain-specific techniques, we also propose a momentum relabeling technique with MixUp regularization to enhance the performance of FSR in noise robust training. Extensive experiments demonstrate our competitive performance compared to previous methods. + +# 2. Related Work + +Training samples are unequally important. Weighting training samples is a traditional and effective strategy to improve model performance. Traditional ML methods, such as importance sampling [24], AdaBoost [14], and self-paced learning [28], explore the usage of important samples for better model training. These weighting strategies have been extended to deep learning [22, 26, 35, 54, 5]. More specialized sample weighting approaches have also been developed in order to weight training samples targeting different goals, either to enhance high value data points, or to reduce data biases (e.g., label noises) [12, 27]. Hard sample mining [46] seeks for hard objects to bootstrap model training. Focal Loss [33] is widely used to allow DNNs to focus on hard samples. [9] proposes a class balanced (CB) loss for long-tailed recognition. [45] utilizes the softmax temperature to learn instance and class weights. Moreover, learning based re-weighting methods becomes popular for label noise-robust training. For example, [23] proposes to train a sequence model to predict good sample weighting. + +[44, 47, 20] propose meta learning based re-weighting. Besides learning sample weights alone, followup methods have explored learning additional data related coefficients, such as labels [61, 41, 31] and data augmentation policies [20]. + +Most of the popular learning based weighting methods originated from meta learning (or learning-to-learn) [19], e.g. MAML [13]. A common requirement is the access to a reward dataset that needs to be unbiased, so a meta-objective can be defined to optimize the sample weights. This reward dataset is mandatory for conventional meta learning used for few shot learning which requires models to quickly adapt to new tasks. However, in the task of learning sample weights, where reward data is drawn from the same distribution of training data, we question and investigate the necessity of that. Moreover, this type of methods consumes extensive compute and memory. Recently, the meta learning community has explored how to accelerate training of MAML [43, 39, 62]. However, to our best knowledge, no previous work has studied how to accelerate the training process for learning sample weights. + +# 3. Background: Learning Sample Weights + +In this section, we briefly review the background of learning based sample re-weighting methods [44, 47, 20, 10]. + +We define a dataset $D = \{(x_i^D, y_i^D), 1 \leq i \leq N\}$ with totally $N$ samples and label $y$ contains a certain degree of biases. Assuming we have another unbiased reward dataset $R = \{(x_i^R, y_i^R), 1 \leq i \leq M\}$ with totally $M$ samples (where $M \ll N$ ). The objective of training DNN parameters $\Theta$ can be formulated as a weighted cross-entropy softmax loss, + +$$ +\Theta^ {\star} (\omega) = \arg \min _ {\Theta} \sum_ {i = 1} ^ {N} \omega_ {i} L \left(y _ {i} ^ {D}, f \left(x _ {i} ^ {D}; \Theta\right)\right), \tag {1} +$$ + +where $\omega_{i}$ is the sample loss weight for $x_{i}^{D}$ . $f(\cdot ;\Theta)$ is the targeting DNN that outputs class logits and $L(\cdot ,\cdot)$ is the standard softmax cross-entropy loss for each training data pair $(x,y)$ . In regular supervised training, $\omega$ is equally distributed to samples in each mini-batch. + +Here $\omega$ is treated as learnable parameters for optimization. To this end, the meta learning is formulated to learn the optimal $\omega$ for each training data in $D$ , such that the trained model with new sample weights can perform best on the reward data in $R$ , measured as the reward signal by a cross-entropy loss + +$$ +\omega^ {\star} = \arg \min _ {\omega , \omega \geq 0} \frac {1}{M} \sum_ {i} ^ {M} L \left(y _ {i} ^ {R}, f \left(x _ {i} ^ {R}; \Theta^ {\star} (\omega)\right)\right). \tag {2} +$$ + +The problem can be solved by enumerating real value sample weights in a brute-force fashion and training the model until converge at each weight combination. However, the computation requirement is infinite. Currently methods that try to + +![](images/79890b67a273c2bb7999eae07ba62986774ac5afe956325dfd8fc6cad75db32a.jpg) +Figure 2. Illustration of the three major steps of the method. A dictionary is dynamically updated to maintain the proxy of reward data to enable meta optimization (gradient-by-gradient) of sample weight. Meta model parameters only include partial model parameters (e.g. FC in this example), while the rest are shared. + +address this problem borrow the concept of meta learning to perform a single step model gradient update to online estimating $\Theta^{\star}\colon \Theta_{t + 1}(\omega) = \Theta_t - \eta \nabla_\Theta \bigl (\sum_i\omega_iL(y_i,f(x_i;\Theta_t))\bigr)$ , where $\eta$ is a scalar step size. This enables differentiability of sample weight variables. Therefore, at each timestamp $t$ , we can find the current optimal weight for each sample $\omega_{t,i}^{\star}$ through + +$$ +\left. \omega_ {o, i} - \alpha \frac {1}{M} \sum_ {i = 1} ^ {M} \frac {\partial}{\partial \omega_ {t , i}} L \left(y _ {i} ^ {R}, f \left(x _ {i} ^ {R}; \Theta_ {t + 1} (\omega)\right)\right) \right| _ {\omega_ {t, i} = \omega_ {o}} \tag {3} +$$ + +where $\alpha$ is the step size and $w_{o}$ is the initial value. [44] resets $w_{o} = 0$ and calculates a new value every iteration. [47] treats it as a trainable variable and updates it using SGD. Lastly, the final weights $\omega^{\star}$ are normalized along mini-batch to satisfy $\sum_{i}\omega_{i} = 1$ . + +Training Complexity. $\Theta (\omega)$ is a function of $\omega$ , the gradient computation of $\omega$ in Equation (3) requires second-order back-propagation (also called gradient-by-gradient in literature). The whole training step requires 1) a forward pass on the training data and 2) reward data once each, 3) a step of gradient descent, 4) second-order back-propagation once, and 5) final model update with SGD. Therefore, there needs $3\times$ training time than regular supervised training as analyzed by [44]. At the same time, in modern deep learning libraries, the auto-differentiation mechanism will need to hold intermediate representations for second-order back-propagation, which takes higher GPU memory. The experimental section conducts detailed analysis. + +# 4. Method + +This section introduces the proposed method. Algorithm 1 presents the complete training details of FSR. + +# 4.1. Learning from Past as Dictionary Fetching + +Instead of preparing an extra reward set, we propose to use a dictionary to store valuable training samples that can be + +Algorithm 1 FSR training step. The dictionary is updated every epoch. $\Theta^{\mathrm{meta}}$ is pre-defined based on DNN architectures. + +Input: Training data D, model parameter Θ, batch size b, dictionary R, reward batch size q, warm-up epoch E. + +Initialize $R_0 =$ BalancedSampleBatch $(D,|R|)$ + +for $t = 1$ to $T - 1$ do + +$$ +\left\{X ^ {D}, Y ^ {D} \right\} \leftarrow \operatorname {S a m p l e B a t c h} (D, b). +$$ + +if $\mathrm{Epoch}(t) \geq E$ then + +$$ +\Theta_ {t} ^ {\text {m e t a}} \leftarrow \text {S y n c h r o i z e w i t h} \Theta_ {t}. +$$ + +$$ +\text {I n i t i z e} \omega_ {o} \leftarrow \frac {1}{b}. +$$ + +$$ +\Theta_ {t + 1} ^ {\text {m e t a}} = \Theta_ {t} ^ {\text {m e t a}} - \alpha \nabla_ {\Theta^ {\text {m e t a}}} \sum_ {i} ^ {| X ^ {D} |} \omega_ {i} L (y _ {i}, f (x _ {i}; \Theta_ {t})). +$$ + +$$ +\left\{X ^ {R}, Y ^ {R} \right\} \leftarrow \operatorname {F e t c h B a l a n c e d B a t c h} \left(R _ {t}, q\right). +$$ + +$$ +\omega^ {\star} \leftarrow \text {U p d a t e s a m p l e w e i g h t s (E q u a t i o n 2)}. +$$ + +$$ +\omega^ {\star} \leftarrow \operatorname {N o r m a l i z e} \left(\omega^ {\star}\right). +$$ + +else + +$$ +\omega^ {\star} \leftarrow \omega_ {o} +$$ + +end if + +$\Theta_{t + 1}\gets$ Update model given $\omega^{\star}$ (Equation 1). + +$\mathcal{P}(x,\Theta_{t + 1})\gets$ Compute scores for $x\in X^D$ (Equation 5). + +$\mathcal{P}_t(x)\gets \lambda \mathcal{P}_t(x) + (1 - \lambda)\mathcal{P}(x,\Theta_{t + 1}),x\in X^D.$ + +if EpochEnd(t) then + +$R_{t + 1}\gets$ Update dictionary using $\hat{\mathcal{P}}_t(D)$ (Equation 4). + +else + +$$ +R _ {t + 1} \leftarrow R _ {t} +$$ + +end if + +end for + +used as a proxy of unbiased reward data, where data biases are controllable since labels and model predictions in $R$ are known. The dictionary is dynamically updated to improve its quality. To this end, we maximize a defined a pusher function $\mathcal{P}$ such that the selected dictionary is + +$$ +R ^ {\star} = \arg \max _ {R} \sum_ {x \in R, R \subset D} \mathcal {P} (x, \Theta), \tag {4} +$$ + +where $R$ has a fixed buffer size as an hyper-parameter. See experiments for more discussions about the memorization assumption behind the definition. + +Choosing an effective $\mathcal{P}$ is important for the quality of reward data. This problem connects to an active research field on data valuation [15]. Different from these methods, the valuation calculation here needs to be efficient in order to execute with model updating at every step. We propose the following meta-margin definition + +$$ +\mathcal {P} (x, \Theta_ {t}) = L \left(f (x, \Theta_ {t}), y\right) - L \left(f \left(x, \Theta_ {t} ^ {\star}\right), y\right), \tag {5} +$$ + +where $\Theta_t^{\star}$ represents model state after meta update at times-tamp $t$ . The proposed meta-margin utilizes the states between the model and the meta model on training data. Maximizing meta-margin intuitively finds samples whose losses have the largest drop after model gradient descent. It prioritizes training samples which is not well recognized (i.e., $L(f(x, \Theta_t), y)$ is high) but its loss can be well minimized + +![](images/28fb58b5f715ecdf664bae8475f6d75bb9d81089e397643f62f42aebc1431b05.jpg) +Figure 3. Gradient and gradient-by-gradient illustration of Wide-ResNet28-10 residual layer blocks. + +after then. In contrast, if a sample has small loss (i.e., $L(f(x, \Theta_t), y)$ is low) already (possibly being memorized), the meta-margin will be small as well. More importantly, if the loss cannot be minimized or even increases after update, the pusher function de-prioritizes these samples because they are likely undesirable. + +In label noise robust training, why the meta-margin can avoid selecting unlabeled (undesirable) samples? In practice, unlabeled data is usually harder to be minimized than clean data due to the regularization of DNNs that is able to resist label noise. This phenomenon is prominent at early training phases [51, 34] because models tend to learn simple samples before hard (mislabeled) samples [45, 3]. It is worth noticing that utilizing this intrinsic regularization to deal with noisy labels is fairly common in previous methods to divide possible clean and noisy samples [42, 17, 34, 11]. For example, [42] proposes to calculate margin between logits of the labeled class and largest logits of other classes to achieve this aim. Our proposed meta-margin borrows this high-level inspiration, while at the same time makes use of the meta optimization behaviors to avoid several types of samples that have low value as proxy reward data. In experiments, we also explore several existing data valuation candidates as the pusher function to verify the effectiveness of the proposed meta-margin. + +Momentum pusher. The pusher function $\mathcal{P}$ depends on the state of models. To obtain a robust estimation of data points using a series of history of model states, we propose a momentum based pusher function, where $\hat{P}_t = \lambda \hat{P}_{t-1} + (1 - \lambda)P_t$ . Therefore, we construct $R$ as the reward dataset using the momentum version $\mathcal{P}$ of Equation (4). Lastly, at the start of the training when model is poorly performed, the constructed dictionary could be noisy. Thus we usually setup a couple of epochs for warm-up without applying learned weights (see Algorithm 1 for details). + +# 4.2. Feature Sharing to Reduce Training Time + +Efficiency is an well-known bottleneck for learning based re-weighting, because it requires meta-learning-like nested + +updates. The experimental section shows quantitative analysis. + +We show that improving the training efficiency needs a revisit of model parameter behaviors between nested outer and inner loops. We speculate the potential possibility of feature sharing between $\Theta_{t + 1}$ and $\Theta_t$ . To be specific, Equation 3 can be further written as + +$$ +\begin{array}{l} \left. \frac {\partial}{\partial \omega_ {t , i}} L ^ {R} \right| _ {\omega_ {t, i} = \omega_ {o}} \\ = \frac{1}{M}\sum_{j = 1}^{M}\frac{\partial L_{j}^{R}}{\partial\Theta}\bigg|_{\Theta = \Theta_{t + 1}}\left.\frac{\partial\Theta_{t + 1}(\omega)}{\partial\omega_{t,i}}\right|_{\omega_{t,i} = \omega_{o}} \\ \propto \frac {1}{M} \sum_ {j = 1} ^ {M} \sum_ {l \in \Theta} \left. \frac {\partial L _ {j} ^ {R}}{\partial \Theta_ {l}} \right| _ {\Theta_ {l} = \Theta_ {t, l}} \left. \frac {\partial L _ {i} ^ {D}}{\partial \Theta_ {l}} \right| _ {\Theta = \Theta_ {t, l}} \tag {6} \\ \propto \frac{1}{M}\sum_{j = 1}^{M}\sum_{l\in \Theta^{\mathrm{meta}}}\left.\frac{\partial L_{j}^{R}}{\partial\Theta_{l}}\right|_{\Theta_{l} = \Theta_{t,l}}\left.\frac{\partial L_{i}^{D}}{\partial\Theta_{l}}\right|_{\Theta = \Theta_{t,l}}, \\ \end{array} +$$ + +where $\Theta_l$ refers to the $l$ -th layer of parameters. The derivation indicates the meta-gradient is the sum of the gradient products of all layers of parameters. It motivates us to use partial layers $\Theta^{\mathrm{meta}} \subset \Theta$ to approximate Equation (6) (i.e. the last row). To understand the contribution of different layers, Figure 3 shows the magnitudes of gradient-by-gradient $\nabla_{\Theta_{t+1}} L^R$ and gradient $\nabla_{\Theta_t} L^R$ of several layers, suggesting that the changes of sample weights are majorly contributed by the fully-connected (FC) layer. Thus including FC into $\Theta^{\mathrm{meta}}$ could be sufficient to achieve good approximation with the lowest computation cost. + +This approximation is actually equivalent to enabling feature sharing between the model and the meta model, which connects to the recent investigation of rapid learning in MAML [43]. In implementation, it is achieved by excluding layers of parameters from bottom up to a certain layer from participating meta optimization (see Figure 2). For example, if only FC is included, although a reward data mini-batch still needs to forward the meta model, all rest meta gradient-by-gradient computation is reduced to cheap matrix (from FC weights) multiplication. + +# 4.3. Momentum Re-labeling and Regularization + +Beside re-weighting, we explore more task specific component to improve FSR on noise robust training. Recent methods favor the design that identifying mislabeled samples and then reusing them as unlabeled data for re-labeling and augmentation [11, 30], in light of semi-supervised learning [4, 48, 55, 49, 63]. FSR intrinsically assigns low weight values to filter mislabeled samples from participating into supervision. To enhance FSR for better reuse of those samples, we propose a momentum dictionary to maintain long-term prediction estimation of samples and use the estimated predictions as pseudo labels for supervised training. Compared with previous methods with re-labeling, our approach is + +Table 1. Test accuracy on CIFAR10 with uniform noise. # indicates methods requires additional reward data. ±0.0 and '-' mean the corresponding method does not report the value. + +
MethodNoise ratio
00.20.40.8
GCE93.589.9±0.287.1±0.267.9±0.6
RoG94.287.4±0.081.8±0.0-
MentorNet#96.092.0±0.089.0±0.049.0±0.0
L2R#96.190.0±0.486.9±0.273.0±0.8
MWN#92.090.3±0.687.5±0.2-
CRUST94.491.1±0.289.2±0.258.3±1.8
ELR94.592.1±0.491.4±0.280.7±0.6
FSR-R3294.491.8±0.790.2±0.774.2±0.9
FSR96.895.1±0.193.7±0.182.8±0.3
+ +
Table 2. Test accuracy on CIFAR100 with uniform noise.
MethodNoise ratio
00.20.40.8
GCE81.466.8±0.461.8±0.247.7±0.7
MentorNet#79.073.0±0.068.0±0.035.0±0.0
L2R#81.267.1±0.161.3+2.035.1±1.2
MWN#70.164.2±0.358.6±0.5-
PENCIL81.473.9±0.369.1±0.6-
ELR75.274.7±0.368.4±0.430.2±0.8
FSR-R3271.369.8±0.265.9±0.241.2±3.0
FSR81.678.7±0.274.2±0.446.7±0.8
+ +fairly simpler since it does not need extra copies of extensively augmented data to ensemble pseudo labels or two-stage training to bootstrap unlabeled data [32, 30, 11]. + +The pseudo label $\hat{y}$ of a sample $x$ at timestamp $t$ is updated in a moving-average manner + +$$ +\hat {y} _ {t} = \beta \hat {y} _ {t - 1} + (1 - \beta) f (x, \Theta_ {t}), \tag {7} +$$ + +where $\beta$ is moving-average decay scalar. The batch samples with estimated labels are simply used to construct an extra softmax loss with a multiplier $p$ with the original weighted loss, so the total loss is $\sum_{x_i}\omega_iL(y_i,f(x_i)) + p\cdot L(\hat{y}_i,f(x_i))$ . + +Regularization. In addition, we apply MixUp [59] on training data used to compute the weighted loss only (i.e., the first term of the total loss). This technique almost becomes a common practice for noise robust methods [50]. In experiments, we find MixUp has strong regularization effects to improve dictionary quality (i.e. label clean ratio) for noise robust training. + +# 5. Experiments + +# 5.1. Label Noise Experiments + +We test our method on the CIFAR and WebVision datasets. The compared methods including GCE [60], MentorNet [23], RoG [29], L2R [44], MWN [47], F-correction [40], + +Table 3. Test accuracy on CIFAR10 with asymmetric noise. + +
MethodNoise ratio
0.20.4
GCE89.5±0.382.3±0.7
F-Correction89.1±0.583.6±0.3
PENCIL92.4±0.091.2±0.0
L2R-R3289.2 ±0.384.8±0.0
L2R92.4 ±0.190.8±0.3
FSR-R3291.5±0.190.2 ±0.1
FSR95.0±0.193.6±0.3
+ +Table 4. Top: Hyper-parameters used by different experiments, where most are fixed across experiments. Some hyper-parameters are defined in Algorithm 1. Bottom: Accuracy with sweeping hyper-parameters on CIFAR100 with $40\%$ uniform noise. + +
ExperimentHyper-parameter
|R|qbληαβp
CIFAR (noise)2k2001000.90.110.12
Webvision5k200160.90.110.11
CIFAR (Long-Tailed)3k8001000.90.11--
iNaturalist20182k350320.90.11--
CIFAR (LT+noise)3k2001280.90.110.12
+ +![](images/906835b9b6f264034fded0933cf232fd00918be59ed2b2e866b9096276e85c63.jpg) + +Table 5. Test accuracy on WebVision (50 classes). ImageNet validation accuracy on the 50 classes is also reported. + +
MethodImageNetWebVision
top1top5top1top5
F-correction57.482.461.182.7
D2L57.881.462.784.0
Co-teaching61.584.763.685.2
Iterative-CV61.685.065.285.3
MentorNet#63.885.863.081.4
CRUST67.487.872.489.6
FSR72.387.274.988.2
+ +D2L [37], Co-teaching [17], Iterative-CV [7], PENCIL [56], F-Correction [1], CRUST [38], and ELR [34]. + +CIFAR. We first verify on the common CIFAR10 and CIFAR100 uniform label noises following settings of [44, 23]. We use WRN28-10 as default [58] as it is commonly used in [44, 47]. We also test using ResNet32 [18]. We train the model on a single V100 GPU. We use a cyclical cosine learning rate for 128 epochs and report the accuracy corresponding to the last iteration. + +Table 6. Test accuracy on CIFAR long-tailed recognition. FSR results are obtained by averaging 3 runs. DF refers to deferred enabling re-weighting. CB refers to class-balanced loss with different sub-types [9]. CB-Best adopts the best hyper-parameters for each setup. Note that # indicates methods uses 10 image per class as a reward set, which is not absolute fair comparison. + +
DatasetCIFAR10CIFAR100
Imb. ratio20050102005010
SoftMax65.6874.8186.3934.8443.8555.71
CB-Focal65.2976.7186.6632.6244.3255.78
CB-Best68.8979.2787.4936.2345.3257.99
L2R#66.5178.9385.1933.3844.4453.73
MWN#68.9180.0687.8437.9146.7458.46
FSR-DF66.1579.7888.1536.7444.4355.60
FSR67.7679.1787.4035.4442.5755.45
+ +Table 1 and Table 2 show the results on the two datasets with different noise ratios, respectively. The proposed FSR outperforms compared methods, and also learning based weight competitors, i.e. L2R, MentorNet, and MWN, which requires additional clean reward data. We also verify on asymmetric noise types, which confuses visually similar categories. Table 4 specifies and studies the hyper-parameters used by different experiments. As we can seen, the biggest change by sweeping these hyper-parameters is $\sim 2\%$ , indicating insensitivity to hyper-parameters. Dictionary size and reward data batch size needs to be changed for different datasets since a class-balanced dictionary size and reward data mini-batch depends to the number of classes. + +WebVision. Then, we scale up FSR to large-scale WebVision dataset with 50 classes [23], which contains the top-50 categories of ImageNet. Following the compared methods, ResNet50 is used with random initialization. We use the same training schedule used by CIFAR experiments above. Differently, we train on 8 GPUs for 128 epochs. Table 5 compares results to previous methods, demonstrating promising results including the best top-1 accuracy, although the compared CRUST has higher top-5 accuracy. FSR shows particular strong generalization ability to ImageNet validation accuracy. + +# 5.2. Long-tailed Imbalance Experiments + +CIFAR. We test FSR on long-tailed CIFAR benchmarks, with different imbalance ratios as defined by [9]. We modify some training configurations as we use for label noise experiments. First, we only apply original FSR to test the ability of re-weighting (i.e. without momentum re-labeling and MixUp). Second, similar like related methods [9], we apply 0.1 softmax label smoothing to compute the loss for re-weighting. Third, Equation (2) constraints weight to be non-negative and clips negative values $\max(0, \omega^{\star})$ before normalization. Here we replace this constraint by shifting + +Table 7. Results with mixed label corruption in CIFAR10. Uniform noise ratios are added onto different imbalance ratios. + +
Noise ratio0.20.4
Imbal. ratio0105020001050200
CRUST [38]90.265.741.534.389.259.532.428.8
FSR (Ours)91.885.777.465.590.281.669.849.5
+ +all weights to be non-zero $(\omega^{\star} - \min (\omega^{\star}) + \frac{1}{b})$ before normalization. Fourth, recent methods [6, 25] commonly apply deferred balancing, which trains model in the supervised manner to learn representations and then apply re-balancing methods to fine-tune the model. We reuse the 200-epoch learning schedule from [9] (see Table 4 for extra hyperparameter details). We optionally apply this deferred schedule by enabling FSR after the first learning rate decay at 160 epoch (i.e., set the warm-up epoch $E = 160$ ). We report results with and without the deferred schedule in Table 6. Overall, FSR achieves competitive results to other methods, although it marginally underperforms MWN, which requires additional balanced reward data. + +iNaturalist. We also test our method on iNaturalist 2018 [21], a large-scale long-tailed recognition benchmark. Following the 90 epoch learning schedule of [9] with deferred schedule, FSR achieves promising results compared to previous methods: $65.52\%$ top-1 (85.02% top-5) accuracy, against CB Focal [9] $61.12\%$ (81.0%) and Remix [8] $61.31\%$ (82.30%). Considering FSR here is merely a generic re-weighting approach, we believe it can be incorporated with more sophisticated designs for long-tailed recognition to obtain further improvement. + +# 5.3. Complex of Label Noise and Imbalance + +Although label noise and imbalance are usually studied as independent research, in real-world applications, these label corruption actually happen simultaneously. This is a more realistic yet challenging setup. We take an initiative to tackle this problem. To benchmark, we add uniform noise onto imbalanced CIFAR10. Table 7 compares the results with the best-performing noise-robust method CRUST [38]. It can be seen that FSR achieves much higher improvement margin over compared methods on this dataset than that on the noise-robust datasets, suggesting the robustness of FSR to complex label corruption. + +# 5.4. Training Complexity + +Recent learning based sample weighting methods have similar theoretical training complexity [44, 20, 47]. We use L2R for direct comparison1. Figure 4(left) compares the training time and GPU memory cost on three architectures2. + +![](images/91de0b29824b89706bf0a73cc9a200899fc34e6ce1997e86433122bdd2d63d0b.jpg) +Figure 4. Left: Training complexity comparison in terms of time per second (left) and GPU memory (right). Three network architectures (with different numbers of parameters) are profiled with certain input image size (IS) and batch size (BS). Right: Accuracy with different numbers of layers included in $\Theta^{\mathrm{meta}}$ for learning sample weights (ResNet32 is used here). $x$ -axis indicates the layers after the denoted layer are participated into meta optimization. For instance, FC indicates only the softmax layer is participated (i.e. our default setting) + +![](images/b92dec12ca1ccc5e679f57179eb587a3100d88d13a8b51fc27556607a38cce49.jpg) + +![](images/9c18cadd0dbe4d48f22f88fa2f1b49da09c6a485507dcba8847abac5672d25a8.jpg) + +![](images/a754abb22a9f7206654ec5af795c1f81f9896f8823a20ffbe0c0ed51cfe3c477.jpg) +Figure 5. Ablation study. See explanation in main text. Left: Train loss visualization of model $\Theta_t$ and meta model $\Theta_{t+1}$ . Middle: Dictionary purity versus accuracy under different datasets and noises ratios. Right: Comparison of different pusher functions on CIFAR100 with $20\%$ and $40\%$ uniform noise. + +![](images/96d2e393f2aab7366655d930f6aae2eca285af845f211cbf2a4d20e577456c1b.jpg) + +![](images/d5bf54f265d27181710a26625930178a25e3e54115ca12a684f92a21c629957c.jpg) + +Compared to regular supervised training, FSR increases the training cost by $47\% \sim 87\%$ while the baseline increases $319\% \sim 443\%$ . For GPU memory usage, FSR increases the memory overhead by $1.9\% \sim 34\%$ while the baseline increases $54\% \sim 270\%$ . The results suggest that FSR significantly improves the training efficiency. In addition, FSR requires one-stage training only so it is expected to consume less training cost than popular multi-stage methods, such as our compared Co-teaching [17] and Iterative-CV [7]. + +Furthermore, we study how $\Theta^{\mathrm{meta}}$ impacts the final performance. Does strong feature sharing sacrifice accuracy? We control the number of layers included in $\Theta^{\mathrm{meta}}$ . Figure 4(right) reports accuracy on CIFAR10 $40\%$ with uniform noise using ResNet32, suggesting that using partial layers does not impact much on either L2R or FSR. It is interesting to note that, for FSR, including fewer layers consistently leads to higher accuracy. The study indicates a strong feature sharing is feasible between outer loop and inner loop of a meta optimization step. + +# 5.5. More Studies and Discussions on FSR + +Meta model memorization. Memorization is a factor we need to consider to avoid trivial solution. If all training data are memorized and generates zero training loss, $\mathcal{P}(x,\Theta)$ in Equation (4) will contain no useful information. However, it + +is unlikely for a well-regularized DNNs to memorize (overfit) the training dataset. Figure 5(left) shows the train loss of model $\Theta_t$ and meta model $\Theta_t^\star$ at every timestamp on long-tailed CIFAR (imbalance ratio $= 10$ ). Since meta model is a 'locally' optimized model, it leads to lower softmax loss in average, yet no phenomenon of over-fitting. This observation also applies to all other datasets and architectures we experimented. + +Dictionary purity. In the label noise task, the purity (the clean ratio) of dictionary $R$ plays a critical role in model performance. If undesirable samples are pushed into the dictionary, accuracy can be affected. Figure 5(middle) visualizes the accuracy versus dictionary purity under different noise ratios. As can been seen, dictionary purity at $80\%$ noise ratio (CIFAR100 and CIFAR100 both) reduces clearly and thereby causes clear accuracy drop. + +We further study a variety of pusher function alternatives against the proposed meta-margin. The simplest negative-loss prioritizes well-recognized samples. max-margin is a popular method in active learning [2] which we use here to select certain samples. forgetting-event [53] finds easy-to-forget samples as they are bad or hard samples. A high forgetting rate indicates corrupted labels. area-under-margin (AUM) [42] produces wider margin on clean samples. As can be seen in Figure 5(right), the proposed meta-margin + +![](images/fab7f74e07728497afd53428a3bee3a7f8eea99b35153948c844676162bd5f9a.jpg) +Figure 6. Accuracy, dictionary purity, and sample weight zero ratio studies on combinations of momentum re-labeling and MixUp, experimented on CIFAR10 with $20\%$ uniform noise. + +performs clearly better than negative loss and AUM, though we observe they can all select clean labels with high rates. Forget-event $^{-1}$ performs the worst. We realize it is negatively impacted by MixUp. Removing MixUp will recover CIFAR100 $20\% / 40\%$ noise to accuracy $68.1\% / 60.9\%$ . + +Impact of momentum re-labeling and MixUp. We study how MixUp and the proposed momentum re-labeling (Section 4.3) affect FSR. In Figure 6, we show the accuracy, dictionary purity, and also averaged ratio of zero (inactive) weights. The ratio of zero weight is expected to be close to the noise ratio of the dataset. Higher ratios of zero weights than actually noise ratios hinder sufficient supervision while lower ratios introduces noisy supervision. MixUp has great impact to the dictionary purity, and therefore final accuracy. As we can seen in Figure 6 (right), the ratio of zero weights is closest to the noise ratio if MixUp is enabled. We think MixUp plays a particular regularization role than just augmentation. We do not find it is effective for long-tailed recognition. Label smoothing [36] is not an effective alternative either. We hypothesize it is related to the calibration effects of MixUp [52] which improves the pusher function and dictionary quality. Future work is useful for investigation. Furthermore, momentum re-labeling can further improve all metrics in Figure 6, and pave the last mile to lead accuracy in Table 1. + +Reward data versus proxy dictionary. The size of reward data in L2R [44] has impacts to the model performance. We train L2R with different reward data size on CIFAR10 with $40\%$ uniform noise. As shown in Figure 7, L2R does not benefit much with more reward data and an over-large reward set can even hurt the accuracy. The accuracy of L2R also drops largely given very limited reward data. This observation is aligned with the findings by [44]. + +We then study the impact dictionary size on the accuracy of the proposed FSR. We conduct the same experiments for FSR and FSR without momentum re-labeling and MixUp (denoted as FSR-Raw). We find FSR is insensitive to the dictionary size and FSR-Raw demonstrates normal sensitivity + +![](images/a82e55f5f91ef11bdfa481c874561c08c720b98c7ab0f4e283196a30521899bc.jpg) +Figure 7. Results of the compared L2R, FSR, and FSR-Raw (without momentum re-labeling and MixUp) under varying reward data size (for L2R) and dictionary size (for FSR and FSR-Raw). + +yet much better than the sensitivity of L2R to real reward data. Given sufficient dictionary size, FSR-Raw can perform as good as L2R with arbitrary reward data size. This study further suggests the actual unbiased reward data is dispensable and could be replaced by a well-picked training data subset when with sufficient DNN regularization. + +# 6. Conclusion + +This paper presents a fast sample re-weighting method, named FSR, that addresses two key bottlenecks for learning based sample weighting methods: high training cost and dependence on additional reward data. The fast reweighting ability of FSR is orthogonal to domain-specific techniques. We have shown that by incorporating task specific components (the proposed momentum re-labeling and MixUp), FSR outperforms previous noise robust methods. We conduct extensive experiments to demonstrate its effectiveness on noisy labels and long-tailed class recognition benchmarks. + +As future work, we think FSR has the potential to improve other tasks where sample re-weighting matters. In addition, we observe from experiments that MixUp has a significant impact on the performance of noisy robust training. Exploring more universal regularization techniques could potentially let FSR generalize better to other domains. + +# Acknowledgments + +We would like to thank Chen-Yu Lee, Kihyuk Sohn, and Han Zhang for their valuable discussions. + +# References + +[1] Eric Arazo, Diego Ortego, Paul Albert, Noel E O'Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. ICML, 2019. 5 +[2] Maria-Florina Balcan, Andrei Broder, and Tong Zhang. Margin based active learning. In International Conference on Computational Learning Theory, 2007. 7 +[3] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, 2009. 4 + +[4] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. NeurIPS, 2019. 4 +[5] Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In ICML, 2019. 1, 2 +[6] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. In NeurIPS, 2019. 1, 6 +[7] Pengfei Chen, Benben Liao, Guangyong Chen, and Shengyu Zhang. Understanding and utilizing deep neural networks trained with noisy labels. ICML, 2019. 5, 7 +[8] Hsin-Ping Chou, Shih-Chieh Chang, Jia-Yu Pan, Wei Wei, and Da-Cheng Juan. Remix: Rebalanced mixup. In ECCV, 2020. 6 +[9] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In CVPR, 2019. 1, 2, 6 +[10] Mostafa Dehghani, Aliaksei Severyn, Sascha Rothe, and Jaap Kamps. Learning to learn from weak supervision by full supervision. NIPS Workshop on Meta-Learning, 2017. 2 +[11] Yifan Ding, Liqiang Wang, Deliang Fan, and Boqing Gong. A semi-supervised two-stage approach to learning from noisy labels. In WACV, 2018. 4, 5 +[12] Qi Dong, Shaogang Gong, and Xiatian Zhu. Class rectification hard mining for imbalanced deep learning. In ICCV, 2017. 2 +[13] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017. 1, 2 +[14] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119-139, 1997. 2 +[15] Amirata Ghorbani and James Zou. Data shapley: Equitable valuation of data for machine learning. In ICML, 2019. 1, 3 +[16] Guy Hacohen and Daphna Weinshall. On the power of curriculum learning in training deep networks. In ICML, 2019. 1 +[17] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018. 4, 5, 7 +[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 5 +[19] Timothy Hospedales, Antreas Antoniou, Paul Micaelli, and Amos Storkey. Meta-learning in neural networks: A survey. arXiv preprint arXiv:2004.05439, 2020. 2 +[20] Zhiting Hu, Bowen Tan, Russ R Salakhutdinov, Tom M Mitchell, and Eric P Xing. Learning data manipulation for augmentation and weighting. In NeurIPS, 2019. 1, 2, 6 +[21] iNaturalist. The inaturalist 2018 competition dataset. 2018. 6 +[22] Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander Hauptmann. Self-paced curriculum learning. In AAAI, 2015. 2 + +[23] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. ICML, 2018. 2, 5, 6 +[24] Herman Kahn and Andy W Marshall. Methods of reducing sample size in monte carlo computations. Journal of the Operations Research Society of America, 1(5):263-278, 1953. 2 +[25] Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. ICLR, 2020. 1, 6 +[26] Angelos Katharopoulos and François Fleuret. Not all samples are created equal: Deep learning with importance sampling. In ICML, 2018. 2 +[27] Salman H Khan, Munawar Hayat, Mohammed Bennamoun, Ferdous A Sohel, and Roberto Togneri. Cost-sensitive learning of deep feature representations from imbalanced data. TNNLS, 2017. 2 +[28] M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In NIPS, 2010. 2 +[29] Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. ICML, 2019. 5 +[30] Junnan Li, Richard Socher, and Steven CH Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. *ICLR*, 2020. 4, 5 +[31] Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S Kankanhalli. Learning to learn from noisy labeled data. In CVPR, 2019. 2 +[32] Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In ICCV, 2017. 5 +[33] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In ICCV, 2017. 2 +[34] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. arXiv preprint arXiv:2007.00151, 2020. 4, 5 +[35] Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. TPAMI, 2015. 2 +[36] Michal Lukasik, Srinadh Bhojanapalli, Aditya Menon, and Sanjiv Kumar. Does label smoothing mitigate label noise? In ICML, 2020. 8 +[37] Xingjun Ma, Yisen Wang, Michael E Houle, Shuo Zhou, Sarah M Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. ICML, 2018. 5 +[38] Baharan Mirzasoleiman, Kaidi Cao, and Jure Leskovec. Coresets for robust training of neural networks against noisy labels. NeurIPS, 2020. 5, 6 +[39] Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018. 2 + +[40] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, 2017. 5 +[41] Hieu Pham, Qizhe Xie, Zihang Dai, and Quoc V Le. Meta pseudo labels. arXiv preprint arXiv:2003.10580, 2020. 2 +[42] Geoff Pleiss, Tianyi Zhang, Ethan R Elenberg, and Kilian Q Weinberger. Identifying unlabeled data using the area under the margin ranking. NeurIPS, 2020. 4, 7 +[43] Aniruddh Raghu, Maithra Raghu, Samy Bengio, and Oriol Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. ICLR, 2020. 2, 4 +[44] Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. ICML, 2018. 1, 2, 3, 5, 6, 8 +[45] Shreyas Saxena, Oncel Tuzel, and Dennis DeCoste. Data parameters: A new family of parameters for learning a differentiable curriculum. NeurIPS, 2019. 2, 4 +[46] Abhinav Shrivastava, Abhinav Gupta, and Ross Girshick. Training region-based object detectors with online hard example mining. In CVPR, 2016. 2 +[47] Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-weight-net: Learning an explicit mapping for sample weighting. In NeurIPS, 2019. 1, 2, 3, 5, 6 +[48] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. 4 +[49] Kihyuk Sohn, Zizhao Zhang, Chun-Liang Li, Han Zhang, Chen-Yu Lee, and Tomas Pfister. A simple semi-supervised learning framework for object detection. arXiv preprint arXiv:2005.04757, 2020. 4 +[50] Hwanjun Song, Minseok Kim, Dongmin Park, and Jae-Gil Lee. Learning from noisy labels with deep neural networks: A survey. arXiv preprint arXiv:2007.08199, 2020. 5 +[51] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, 2018. 1, 4 +[52] Sunil Thulasidasan, Gopinath Chennupati, Jeff Bilmes, Tan-moy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. NeurIPS, 2019. 8 +[53] Mariya Toneva, Alessandro Sordoni, Remi Tachet des Combes, Adam Trischler, Yoshua Bengio, and Geoffrey J Gordon. An empirical study of example forgetting during deep neural network learning. arXiv preprint arXiv:1812.05159, 2018. 7 +[54] Yixin Wang, Alp Kucukelbir, and David M Blei. Robust probabilistic modeling with bayesian data reweighting. In ICML, 2017. 2 +[55] Qizhe Xie, Zihang Dai, Eduard H. Hovy, Minh-Thang Luong, and Quoc V. Le. Unsupervised data augmentation. NeurIPS, 2020. 4 +[56] Kun Yi and Jianxin Wu. Probabilistic end-to-end noise correction for learning with noisy labels. CVPR, 2019. 5 + +[57] Jinsung Yoon, Sercan Arik, and Tomas Pfister. Data valuation using reinforcement learning. In ICML, 2020. 1 +[58] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. BMVC, 2016. 5 +[59] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. *ICLR*, 2017. 5 +[60] Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, 2018. 5 +[61] Zizhao Zhang, Han Zhang, Sercan O Arik, Honglak Lee, and Tomas Pfister. Distilling effective supervision from severe label noise. In CVPR, 2020. 1, 2 +[62] Luisa M Zintgraf, Kyriacos Shiarlis, Vitaly Kurin, Katja Hofmann, and Shimon Whiteson. Caml: Fast context adaptation via meta-learning. ICML, 2019. 2 +[63] Yuliang Zou, Zizhao Zhang, Han Zhang, Chun-Liang Li, Xiao Bian, Jia-Bin Huang, and Tomas Pfister. Pseudoseg: Designing pseudo labels for semantic segmentation. *ICLR*, 2021. 4 \ No newline at end of file diff --git a/learningfastsamplereweightingwithoutrewarddata/images.zip b/learningfastsamplereweightingwithoutrewarddata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bc4d5c087c48bd33855ecbaa1dc2ba9e01c8b7a5 --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dabf11caa57f86d19226864d6ba3a58dfea432190af734aee7a1b9cc8831815a +size 552877 diff --git a/learningfastsamplereweightingwithoutrewarddata/layout.json b/learningfastsamplereweightingwithoutrewarddata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ec670922cb386e4de53358a19a0259e26274e560 --- /dev/null +++ b/learningfastsamplereweightingwithoutrewarddata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d1b26acae4f4d1f73e8e9df0cbf2835592a00465f4746969542e5b554cc4b85 +size 434367 diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_content_list.json b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..91c0eee1576d59e2f9237ab04592c6ee3d275cf9 --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eda254fc498ebd014e852450c1207d6b8a059c0c43de79437cd1e825e579a7b +size 84882 diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_model.json b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_model.json new file mode 100644 index 0000000000000000000000000000000000000000..11a352fbe96352ab5f744fc5c6c607ae4c8def09 --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dcf6afefb563406b18a466e8f7e4a2b595be47f4921ab251a67d4e854abe652 +size 104540 diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_origin.pdf b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ba11aab59b34f8ab335e7b897973b2423d7ab55a --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/cb824a2e-98c0-4406-a788-eca6b859f011_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0544eb80bf74f92f74e0d21f447f86a8bb961c2d603ccbcf88af5e2f12b2b140 +size 3113948 diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/full.md b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ca68b6a5d086835c039b8e76507108314a826d78 --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/full.md @@ -0,0 +1,415 @@ +# Learning Frequency-aware Dynamic Network for Efficient Super-Resolution + +Wenbin Xie $^{1,2*}$ , Dehua Song $^{1*}$ , Chang Xu $^{3}$ , Chunjing Xu $^{1}$ , Hui Zhang $^{2}$ , Yunhe Wang $^{1}$ + +1 Noah's Ark Lab, Huawei Technologies. 2 School of Software, Tsinghua University. 3 The University of Sydney. + +{dehua.song, yunhe.wang, xuchunjing}@huawei.com; xiewb18@mail.tsinghua.edu.cn; + +# Abstract + +Deep learning based methods, especially convolutional neural networks (CNNs) have been successfully applied in the field of single image super-resolution (SISR). To obtain better fidelity and visual quality, most of existing networks are of heavy design with massive computation. However, the computation resources of modern mobile devices are limited, which cannot easily support the expensive cost. To this end, this paper explores a novel frequency-aware dynamic network for dividing the input into multiple parts according to its coefficients in the discrete cosine transform (DCT) domain. In practice, the high-frequency part will be processed using expensive operations and the lower-frequency part is assigned with cheap operations to relieve the computation burden. Since pixels or image patches belong to low-frequency areas contain relatively few textural details, this dynamic network will not affect the quality of resulting super-resolution images. In addition, we embed predictors into the proposed dynamic network to end-to-end fine-tune the handcrafted frequency-aware masks. Extensive experiments conducted on benchmark SISR models and datasets show that the frequency-aware dynamic network can be employed for various SISR neural architectures to obtain the better tradeoff between visual quality and computational complexity. For instance, we can reduce the FLOPs of SR models by approximate $50\%$ while preserving state-of-the-art SISR performance. + +# 1. Introduction + +Single image super resolution (SISR) receives low-resolution images and outputs their high-resolution counterparts, which is widely used in real-world applications such as mobile phone, surveillance, autonomous driving, etc. Basically, SISR is an ill-posed reverse problem for recovering more information from the low-resolution versions. Thanks to the great progress of deep learning, a number of approaches have been explored using deep convolutional + +![](images/9a76bf0db2f75027cd025336a98541af0d5d9c8088db97985635f25727b5351f.jpg) +(a) Natural image. + +![](images/9009e678bd8406b18cc529a08dfee0d70034cdf4cc5b15a26abd18085874cf96.jpg) +(b) DCT and masked spectrum. + +![](images/271e86f62ddfa0526dc1a0667d745cd22970a82c4526214caa768b86ca786249.jpg) + +![](images/8fd7e388e77cf8e8133668af2759e3940ba116a061ba00212f4720e2d9cf2fb7.jpg) +(c) Frequency mask from DCT. + +![](images/49b1516938a2206547ff1fa8b8e0088da726e2e03e29d143f5d475a47a32ce7f.jpg) +PSNR + +![](images/98837b4d897519c9b903fd93861f65c8a04c4f8d81de59e900cc36c5eeceb5e1.jpg) +42.26 + +![](images/2b1d124304909c57e068a9678191bb44ca220368617e145de12eccc9b5f42613.jpg) +42.26 (↑0.00) + +![](images/533d1d107ee8fc7cbee5ea9fa82d86c7446f58db6ae3d7d74153bd28a20ad319.jpg) +42.25 (↓0.01) + +![](images/d78301e99578608cf8a91a8a87002974007f3f70e067dbeefc6b7dee7b706349.jpg) +PSNR + +![](images/01092b3e74cc7cdf0953fb2dd8a8ea4204c895aee6ce5ba89231ff88dd72e6ee.jpg) +40.01 + +![](images/c6ce69eab934a72b86f84504a27cb1e8f6931e874848909f27642b16b164cdc7.jpg) +40.53 (↑0.52) + +![](images/0d7692c704748af24e4db57839e4023e9cd917628597c88f4df44ab4eb1f1dd3.jpg) +40.62 (↑0.61) + +![](images/5b6f9904e6600ead37652624acce81db37b96fdbc74c8aee68b2ab6f8af53113.jpg) +PSNR + +![](images/78ea29319dd89cd5f5932a6f733a85f6c61fc08ccb100d3ad41e70cdf63cdfbc.jpg) +29.38 +Figure 1: The motivation of our frequency-aware dynamic network. We illustrate the performance of SISR networks with various amounts of computation separately processing patches with different frequency signals. The profit brought by heavy computations becomes slighter as the frequency decreases. For conventional SR models, massive computation redundancy exists in processing low and medium frequency regions. Wherein, $②$ , $③$ and $④$ denote low, medium and high frequency signals/regions, respectively. + +![](images/80658cc7979c93e255996beb11dc89e22e5d505da140bc91e38a29bc97ea3c42.jpg) +30.00 (10.62) + +![](images/2b1d626ae5a8c47a01987128a8e789a8b0f5c812b56f5dc5615bb3326887bb50.jpg) +31.98 (↑2.60) + +neural networks (CNNs) for addressing the SISR problem. Since neural networks can capture more information from a large amount of available images thus yield higher performance over conventional image recovery algorithms. + +Similar to most computer vision tasks, the design of network architectures is quite important for the performance of SISR. Dong et al. [8] first employed a network on super + +resolution with only three convolutional layers, which obtained better performance than traditional methods. Subsequently, a series of networks with sophisticated architectures and loss functions are developed. For instance, Lim et al. [21] deepened the SR network with 32 res-blocks. Tai et al. [29] and Zhang et al. [38] investigated the dense concatenation on SR. In addition, channel attention (e.g., RCAN [37] and SAN [7]) and spatial attention (e.g., ABPN [23]) mechanisms were also embedded in SISR models and boosted the performance significantly. + +Although tremendous efforts have been made to refine quantitative results i.e., PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structure Similarity), and visual quality of generated high-resolution images, the computational cost should be carefully restrained for real-world applications. For instance, 10,194G FLOPs is required for generating a $1280 \times 720$ (720p) image using RDN [27] model. To improve the model efficiency for deploying them on mobile devices while retaining the performance, Ahn et al. [2] and Luo et al. [24] employed cheap operators to construct efficient SR models manually. Furthermore, Chu et al. [6] and Song et al. [27] explored neural architecture search (NAS) to acquire efficient SISR networks automatically. + +Nevertheless, most of existing approaches focus on reducing computation by processing the whole image with the same way, which are not perfectly efficient. Natural images are composed of distinct frequency signals according to the Fourier Transform [4]. Recovering high frequency information requires massive computations due to its severe damage during the downsample procedure, but reconstructing low frequency information does not demand such huge computations. Fig. 1 illustrates this phenomenon and indicates that the profit brought by heavy computations becomes slighter as the frequency decreases. Hence, massive computation redundancy exists in processing low and medium frequency regions. It motivates us to explore a more efficient SR method according to frequencies of the input instance. + +To this end, this paper proposes a novel frequency-aware dynamic convolutional network (FADN). In each block, we introduce a predictor for dividing the input feature into multiple components based on the discrete cosine transform (DCT [1]) domain, e.g., high-frequency, medium-frequency and low-frequency parts. The predictor is learned under the supervision of hand-crafted frequency-domain masks of images in the training set and the reconstruction loss of SISR, simultaneously. Then, features in these multiple parts will be processed using different convolutional layers with various computation burdens. The features with only low-frequency domain information will be assigned with cheaper operations for reducing computations and vice versa. Since features are divided into multiple branches in our paradigm, the overall computational complexity will be significantly reduced by the optimized allocation. + +Extensive experiments are carefully conducted to verify the effectiveness of the proposed frequency-aware dynamic network on mainstream super-resolution benchmarks. The experimental results demonstrate that our method is able to employ on different neural architectures for achieving comparable and even better super-resolution performance using fewer computations. + +The rest of this paper is structured as follows: we firstly summarize the related works on super-resolution methods in Section 2. In Section 3, the proposed method is introduced in detail. Then, comparison experiments and ablation study are depicted in Section 4. At last, we draw conclusions of the paper in Section 5. + +# 2. Related Work + +SISR problem has been investigated broadly in the last decades and remarkable improvement has been acquired. We summarize and analyze various SR methods. + +# 2.1. Superior Super-resolution Methods + +Enormous super-resolution methods can be roughly divided into three categories: interpolation-based, reconstruction-based and learning-based methods. Interpolation methods are efficient but suffer from severe flaws of fidelity [16]. In order to generate flexible and sharp details, reconstruction-based methods exploit sophisticated prior knowledge to reconstruct the high-resolution image [34]. However, these methods are time-consuming and sensitive to the handcrafted parameters. Recently, deep learning methods have dramatically boosted the performance of SISR. Dong et al. [8] firstly introduced DCNNs to SISR with only three convolution layers, yet its performance was greatly superior to that of traditional methods. Then, many approaches exploited the depth of DCNNs to improve the fidelity of SISR further, such as VDSR [17], SRResNet [20], and EDSR [21]. In addition, MemNet [29] and RDN [38] also explored dense concatenation to fusion features with different receptive fields. Channel attention (e.g. RCAN [37], SAN [7]) and spatial attention (e.g. ABPN [23]) were both applied on super-resolution network for better recovery of details. Lately, non-local-based graph networks (e.g. GCDN [31], IGNN [39]) are becoming a new trend to recover the detailed textures. On the other hand, perceptual loss [15] and adversarial training strategy [20] were adopted to improve the visual quality. + +# 2.2. Efficient Super-resolution Models + +The fidelity of SISR has been promoted significantly while the computational cost increases rapidly too. Massive computations of networks severely limited its application on real-world mobile devices. Hence, many researchers shifted their attention to developing efficient SISR networks. Dong et al. [9] firstly accelerated SISR models by + +![](images/3a04848e8fa88935d7563db89162dbdb31843cbc75bdfd052742a8d31863d5b1.jpg) +Figure 2: The overall framework of the proposed frequency-aware dynamic SR network (FADN). + +delaying the upsample operation. Then, researchers began to design efficient blocks or networks with cheap operators, for example, CARN [2], IDN [13, 12] and LatticeNet [24]. To exploit efficient architecture thoroughly, neural architecture search (NAS) methods (e.g. FALSR [6], ESRN [27]) were employed to seek for extreme lightweight SISR networks. Besides, knowledge distillation technique [10, 35] was introduced to SISR to take full advantage of teacher network. Lately, quantization SISR networks [25, 33] were also explored with the assistance of feature complementary. + +Besides, Liu et al. [22] designed a dynamic inference network to reduce computations, by predicting a depth mask and ignoring the calculations of partial features once the layer is deeper than the predicted depth. Note that the depth predictor cannot be optimized end-to-end. Verelst et al. [32] proposed a similar dynamic network that elides partial calculations for the classification task. These dynamic convolutions are totally designed on the spatial domain. Instead, we proposal a novel dynamic mechanism based on the frequency-domain information in this paper. Our method recovers distinct frequency signals with branches requiring different computations and thus reduces the computational complexity. + +# 3. Frequency-aware Dynamic Network + +The framework of our proposed frequency-aware dynamic network is shown in Fig. 2. FADN consists of feature extraction, frequency-aware dynamic blocks (FADB) and reconstruction. Each dynamic block contains multiple branches with different computation burdens. In the inference stage, FADB automatically assigns higher frequency regions to heavier branches and lower frequency regions to lighter branches according to the learnable frequency mask. + +# 3.1. Frequency-aware Dynamic Block + +Firstly, we revisit prominent blocks in SR task, for example, resblock in EDSR [21] and channel attention resblock in RCAN [37]. The detail architectures of blocks are shown in Fig. 3. Block contains two $3 \times 3$ convolution and one + +ReLU layers. In addition, RCAB also include a channel attention operator. Notating the input tensor as $X$ and the output tensor as $Y$ , RCAB can be modeled as + +$$ +Y = X + C A (F), \tag {1} +$$ + +where $CA$ denotes the channel attention operator, $F$ is output feature of the first two convolution layers, $F = f(X)$ + +Channel attention averages the features across spatial space, hence our frequency-aware dynamic mechanism focuses on the feature transformation stage $f$ . In the standard SR block, all pixels share same filters (i.e. filter size, number and weights). However, the pixels should not be treated equally in SR task, since high frequency signals suffer more seriously damage than low frequency signals during downscaling. In other words, low frequency signals can be recovered using cheap operations. Based on the idea, we design the frequency-aware dynamic block (FADB) which contains multiple branches with different burdens. In the inference stage, each pixel is assigned to a specific branch according to a learnable frequency-aware mask $M$ . The number and detail structures of branches are optional. A typical FADB setting is shown in Fig. 3c which includes three branches. The heaviest branch is the same with standard block. The computations decrease gradually from left two branches to the right one. Notating the branch number as $K$ and the function of branch $k$ as $f_{k}$ , the FADB can be represented as + +$$ +F _ {i} = \sum_ {k = 1} ^ {K} M _ {i, k} \cdot f _ {k} \left(X _ {i}\right), \tag {2} +$$ + +$$ +s. t. M _ {i, k} \in \{0, 1 \} a n d \sum_ {k} ^ {K} M _ {i, k} = 1. +$$ + +where $i$ is the pixel index. The constrains mean that only one branch $k$ where $M_{i,k} = 1$ will be chosen for $X_{i}$ . + +# 3.2. Mask Predictor + +It's important to assign $X_{i}$ to a proper branch according to the frequency strength so that lower frequency signals + +![](images/24ff04297be7efc4cca4d7db42674215176a02684cd34b97fbd7e02b1460c388.jpg) +(a) +Figure 3: The structure of prominent SR blocks. (a) Block in EDSR [21]. (b) Block in RCAN [37] (CA operator stands for channel attention). (c) Corresponding frequency-aware dynamic block (CA is only employed in FAD-RCAN). + +![](images/2de70622cf4319d33c4b1bb7ed702ff546a86817ad82ac5081e256dc900add16.jpg) +(b) + +![](images/019173d7664b079190b8b273ba8ff3952bfc2b98b2989d9fe8496ee7538d67c7.jpg) +(c) + +can be recovered using lighter branches to save computations. An intuitive strategy is to apply DCT type II [1, 28] to generate a frequency mask. We first use DCT to convert the image from spatial domain to frequency domain as shown in Fig. 1 (b-1) where the upper left parts are for low frequency signals and lower right parts are for high frequency signals. Then, we employ $T$ frequency thresholds to separate the spectrum into $T + 1$ parts (e.g., 2 thresholds generate 3 spectrum parts as shown in Fig. 1 (b-2,3,4)). At last, these $T + 1$ spectrum parts are reconverted to spatial domain via IDCT, respectively, and generate the DCT frequency mask as shown in Fig. 1 (c). During the reconverting stage, we process high frequency preferentially, i.e., once a pixel belongs to higher frequency, it won't be considered as lower frequency in the later processing. Hence, we usually generate DCT frequency mask from high frequency region to low frequency region sequentially. + +Unfortunately, human-crafted thresholds are sensitive to noise and specific values are not suitable for all images. We expect the network can learn a frequency mask indicating which branch will be adopted by each pixel in an end-to-end manner. We make use of Gumbel Softmax trick [14] to make the mask prediction differentiable. + +Given $X$ , a $1 \times 1$ convolution is used as a simple mask predictor to generate a distribution $D$ of $K$ channels and same spatial size as $X$ . The predictor is so small that its computational cost can be almost ignored. The frequency mask $M$ can be calculated as + +$$ +M _ {i} = \text {o n e - h o t} (\underset {k} {\arg \max } D _ {i, k}). \tag {3} +$$ + +Equation 3 has two drawbacks. First, it ignores the statis- + +tic randomness as $D$ is actually a continuous distribution instead of discrete variable. Second, it's not differentiable and hence can not be optimized end-to-end. Therefore, we apply Gumbel Softmax trick to get a continuous, differentiable normalized distribution: + +$$ +G _ {i} = \frac {\exp \left(\left(D _ {i} + g _ {i}\right) / \tau\right)}{\sum_ {k = 1} ^ {K} \exp \left(\left(D _ {i , k} + g _ {i , k}\right) / \tau\right)}, \tag {4} +$$ + +where $g_{i}$ is drawn from $Gumbel(0,1)$ , $\tau$ is a temperature value controlling the distribution density and set as 1 in our experiments. The noise is only added in the training stage. We hope only one branch will be chosen for each pixel. In the forward process, the chosen branch (i.e. the frequency mask) is + +$$ +M _ {i} = \text {o n e - h o t} (\underset {k} {\arg \max } G _ {i, k}). \tag {5} +$$ + +In order to train the predictor end-to-end, we calculate the gradient of $M$ according to Equation 4 in the backward process, i.e., + +$$ +M _ {i} = \left\{ \begin{array}{l l} \text {o n e - h o t} (\underset {k} {\arg \max } G _ {i, k}) & \text {f o r w a r d}, \\ G _ {i} & \text {b a c k w a r d}. \end{array} \right. \tag {6} +$$ + +# 3.3. Loss + +The proposed FADN is frequency-aware that models low frequency signals with cheaper operations. To this end, the mask predictor should absorb the prior knowledge from DCT frequency domain. Specifically, we make use of the frequency mask generated with DCT, notated as $D$ , to guide the mask training. Assuming there are $B$ dynamic res-blocks, the DCT loss is + +$$ +L _ {d c t} = \sum_ {b = 1} ^ {B} C E (M _ {b}, D), \tag {7} +$$ + +where $CE(\cdot)$ is cross entropy loss and $M_{b}$ is the predicted frequency mask of the $b$ -th block. + +Besides, it's important to control the computational cost conveniently for satisfying the requirements of various scenes. We realize that the sparsity of predicted frequency mask reflects the total computations, i.e., when the predicted frequency mask contains more low frequency components, the computational cost is smaller. Assuming there are $n$ pixels in each block and $c_{k}$ represents per-pixel FLOPs of branch $k$ , the total FLOPs of a dynamic block are + +$$ +C = \sum_ {i = 1} ^ {n} \sum_ {k = 1} ^ {K} M _ {i, k} \cdot c _ {k}. \tag {8} +$$ + +The sparsity loss is designed as + +$$ +L _ {s p a} = \left(\frac {\sum_ {b = 1} ^ {B} C _ {b}}{B \cdot n c _ {K}} - \alpha\right) ^ {2}, \tag {9} +$$ + +where $C_b$ is FLOPs of the $b$ -th block, $nc_K$ is FLOPs of a SR block and $\alpha$ is a hyper-parameter to control the frequency mask sparsity as well as the total FLOPs. + +The total frequency mask loss is + +$$ +L _ {\text {m a s k}} = L _ {\text {s p a}} + \beta L _ {\text {d c t}}, \tag {10} +$$ + +where $\beta$ is a hyper-parameter to balance the two mask losses. We apply an annealing strategy on $\beta$ and reduce it to zero gradually during training considering the following two reasons. First, the DCT frequency mask is not accurate since it is dependent on human-crafted thresholds and sensitive to noises. Second, $L_{dct}$ cannot control the expected computations conveniently. Therefore, only $L_{spa}$ is used to guide the mask learning in the later stage for better convergence and more precise control of computations. + +To make the recovered images are of similar visual quality as the origin high resolution versions, we use L1 distance as the super-resolution loss: + +$$ +L _ {s r} = \| s r - h r \| _ {1}, \tag {11} +$$ + +where $sr$ is the super-resolution image and $hr$ is the ground truth as well as high-resolution image. + +Finally, FADN is optimized by the two kinds of losses, $L_{sr}$ for recovering more details and $L_{spa}$ for guiding the predictor to learn the frequency distribution and control computational cost. The complete loss can be defined as + +$$ +L = L _ {\text {m a s k}} + L _ {s r}. \tag {12} +$$ + +# 3.4. Efficient Implementation + +Since weight sharing is still kept along each branch, the calculation can be still implemented by GEMM [19] effectively. The first convolution in each branch should have same kernel size (e.g. 3) so that we can first apply image2col to unfold the input $X$ . Meanwhile, the mask predictor generates frequency mask $M$ . Then, the unfolded $X$ is split and serves as the input of each branch according to $M$ . The first convolution can be taken as the matrix multiplication between the unfolded input and kernel weight. $1 \times 1$ convolution and ReLU module is easy to implement since they are pixel-independent. The corresponding frequency mask should be dilated by a $3 \times 3$ kernel to keep receptive field if the branch includes two $3 \times 3$ convolution layers. After calculating the results of each branch, we combine them into an entire tensor. + +# 3.5. Discussion + +FADN vs. other spatially-varying computing methods Verelst et al. [32] proposed a dynamic mechanism by exploiting spatial sparsity for classification. It pays more computation on semantic contents and is not suitable for SISR task. AdaDSR [22] predicts the depth for each pixel directly. All these methods developed a sparse convolution + +that neglects the calculations of partial input features once meeting certain conditions, which causes partial inputs cannot be modeled effectively. In contrast, based on the characteristics of SR illustrated in Fig. 1, our method takes full use of frequency-domain information to construct dynamic block since frequency has a positive relation with recovery difficulty of SR. Hence, the proposed FADN is quite different from other spatially-varying computing methods. + +FADN vs. OctaveConv. The Octave convolution [5] separates the high-frequency and low-frequency with down-sample operations. In essence, the main idea of Octave convolution is consistent with multi-resolution feature representation. In contrast, the proposed dynamic network separates the regions with different frequency information according to mask predictor, which is consistent with DCT frequency information. Their main ideas are quite different. + +# 4. Experiment + +# 4.1. Implementation Details + +Training We apply the proposed frequency-aware dynamic mechanisms on EDSR [21] and RCAN [37] models, which are called FAD-EDSR and FAD-RCAN, respectively. The DIV2K dataset [30] is adopted to train the dynamic networks. DIV2K includes 800 training images and 100 validation images. The low-resolution (LR) images are generated with bicubic degradation algorithm. The input patch size and data augmentation follow literature [21]. The training lasts 800,000 iterations and is optimized by ADAM algorithm [18] with $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ . The initial learning rate is set to 0.01 for the mask predictor parameters, 0.0001 for other parameters (i.e. body parameters) and decays to half every 200,000 iterations. We set $\alpha$ as 0.4 and initialize $\beta$ as 0.0001. We apply a linear annealing strategy on $\beta$ which is reduced to 0 after $70\%$ iterations. + +Evaluation We evaluate our method with PSNR and SSIM metrics on four benchmarks: Set5 [3], Set14 [36], B100 [26] and Urban100 [11]. The PSNR and SSIM are calculated on the Y channel (i.e. the luminance channel) of YCbCr color space. The same amount of pixels as scale from the image boundary are ignored. The computational cost is evaluated by FLOPs (Floating Point of Operations). + +# 4.2. Comparison with State-of-the-arts + +To evaluate the effectiveness and efficiency of the proposed frequency-aware dynamic mechanism, we compare our experimental results with that of deep adaptive approach [22] (abbreviated as Ada-) on prominent EDSR [21] and RCAN [37] models. As shown in Table 1, compared with original SR model, our method reduces almost $50\%$ of computations (i.e. FLOPs) while keeps and even increases the super-resolution accuracy (i.e. PSNR and SSIM). For instance, the FLOPs of EDSR on Set5 $\times 2$ are reduced by + +Table 1: Quantitative results in comparison with the state-of-the-art methods on four benchmark databases. The best results are highlighted in bold. + +
ScaleMethodSet5Set14B100Urban100
PSNR ↑ (dB)SSIM ↑FLOPs ↓ (G)PSNR ↑ (dB)SSIM ↑FLOPs ↓ (G)PSNR ↑ (dB)SSIM ↑FLOPs ↓ (G)PSNR ↑ (dB)SSIM ↑FLOPs ↓ (G)
×2Bicubic33.660.9299—30.240.8688—29.560.8431—26.880.8403—
VDSR [17]37.530.959070.533.050.9130143.031.900.896095.430.770.9140481.6
EDSR [21]38.110.96011338.833.920.91952552.232.320.90131776.932.930.93518041.1
AdaEDSR [22]38.210.9611650.633.970.92081397.332.350.9017965.332.910.93534844.9
FAD-EDSR38.210.9611408.433.950.92021068.832.330.9015686.732.930.93534192.9
RCAN [37]38.270.9614577.934.120.92161101.832.410.9027767.033.340.93843471.2
AdaRCAN [22]38.280.9615469.134.120.9216751.932.410.9026606.333.290.93802907.2
FAD-RCAN38.290.9617260.834.110.9215512.632.420.9028363.733.340.93852089.4
×3Bicubic30.390.8682—27.550.7742—27.210.7385—24.460.7349—
VDSR [17]33.670.921070.529.780.8320143.028.830.799095.427.140.8290481.6
EDSR [21]34.650.9280699.130.520.84621305.729.250.8093924.128.800.86533984.0
AdaEDSR [22]34.650.9288504.830.570.84631013.529.270.8091722.828.780.86493314.2
FAD-EDSR34.690.9288281.030.580.8467651.529.270.8097423.628.890.86682472.9
RCAN [37]34.740.9299328.530.650.8482613.529.320.8111434.229.090.87021872.0
AdaRCAN [22]34.790.9302277.730.650.8481512.929.330.8111369.329.030.86891596.3
FAD-RCAN34.820.9304141.230.660.8485306.129.330.8112212.329.120.87061081.6
×4Bicubic28.420.8104—26.000.7027—25.960.6675—23.140.6577—
VDSR [17]31.350.883070.528.020.7680143.027.290.072695.425.180.7540481.6
EDSR [21]32.460.8968501.928.800.7876908.827.710.7420655.726.640.80332699.4
AdaEDSR [22]32.490.8977371.728.760.7865716.827.710.7410508.526.580.80112265.8
FAD-EDSR32.500.8977218.128.820.7880471.727.730.7438304.626.700.80491729.9
RCAN [37]32.630.9002270.128.870.7889489.027.770.7436352.826.820.80871452.5
AdaRCAN [22]32.610.8998277.528.880.7883418.127.770.7428304.826.800.80671263.0
FAD-RCAN32.650.9007115.428.880.7889258.327.780.7437169.826.860.8092891.2
+ +![](images/c9de84b040626e42b115da2b40299b63814885a14ee1cf9da2bcd2cd320fec02.jpg) +(a) $\times 2$ scale. + +![](images/dc229635ca0314c252d21979d9b50c9e4b74203a1817399bcbdff5de5764b799.jpg) +(b) $\times 3$ scale. +Figure 4: Comparison to state-of-the-art methods in terms of PSNR and FLOPs. The benchmark used is Set5. + +![](images/99aea3f14645cea7d2a6b3b2b49cdbba27cdcfb38d61ec44c33373ea88a834bc.jpg) +(c) $\times 4$ scale. + +$69.6\%$ while PSNR is improved by $0.11dB$ . Compared to deep adaptive approach (i.e. AdaEDSR and AdaRCAN), our method reduces more computation and gets better SR accuracy. Taking the experiment on B100 with $\times 4$ scale as example, the FLOPs of AdaEDSR are reduced by $22.4\%$ and PSNR is similar to EDSR. In contrast, the FLOPs of our model are reduced more, i.e. $53.5\%$ , while PSNR is increased by $0.02dB$ . An interesting phenomenon is that AdaEDSR meets a serious performance degradation in large-scale upscaling (i.e. $\times 3$ and $\times 4$ ) whose optimizations are harder than $\times 2$ upscaling since the larger-scale down-scaling causes more high frequency signals lost. However, our methods still keeps excellent performance because of + +the end-to-end optimization and coordinated branches. We also evaluated the latency of the proposed frequency-aware dynamic models on CPU platform with different number of cores. The experimental results in Table 2 show that the proposed method reduces the latency of model significantly. + +In addition to the quantitative results, we visual the super-resolution resulting images in Fig. 5 including two common scenes, i.e., blurring and artifacts caused by serious downscaling (the first and second row respectively). The proposed method achieves very close even better visual quality compared with original model. The performance of our method outperforms that of deep adaptive mechanism significantly. We use $\alpha$ to control the computational cost as + +![](images/33985252c563d95a80013a4e8415951751584d3fb2a547795e84c2dbfef5aa09.jpg) +img044 in Urban100 × 4 + +![](images/685691f28dbbf6868def6dd8973a20f8357ab31394e560e73d8864b7762642f8.jpg) +Bicubic (25.63/0.4990) + +![](images/3b3fe81f7d23aa97822a649018d0fc49481906394cdec7f9d3e47146bff0faef.jpg) +VDSR (29.60/0.5700) + +![](images/f4d19a4abf808af7f7907d571c28f80a09e13ea7eeb2e80f650e30d47cff2e1f.jpg) +EDSR (30.62/0.8194) + +![](images/ad0dd854355b69e200b973634566505292512809a6b8f7e909335431fd254e4e.jpg) +AdaEDSR (29.42/0.7279) + +![](images/34125384271640796d48ac70a26b38083d03b94e94358b0ae42134024b87e004.jpg) +FAD-EDSR (31.36/0.8876) + +![](images/aa6b130b95bef3a5e0caf740ba47fbcaf295a36964a62a9d68921a70126e4e29.jpg) + +![](images/f4b4669d075e54e1c4765de48e0a651cb7c46043016b36516f4acc0f13b253f6.jpg) +img092 in Urban100 × 4 +Figure 5: Visual Comparison with state-of-the-art methods. $\delta$ is the residual map of the two given images. + +![](images/af97f5259e56a8a5400d2266c306148d78a46f8cbed729b040f859e50301e9c1.jpg) +hr + +![](images/dde94b0b4281548f03402b151fc69b913314416e760047976f231f3870bd9a83.jpg) +8(hr, VDSR) + +![](images/6af88d3a9c363f94c2771a98c730dd64577c0d087bd490d9c318634777f130b3.jpg) +$\delta (\mathrm{hr},\mathrm{EDSR})$ + +![](images/d06d1692d615438a5bb9d9fc5e0203d452e7e3c2aa501e34eeafff91e5a30a9e.jpg) +$\delta (\mathrm{hr},$ AdaEDSR) + +![](images/244b1ae4bd1a339a2b2e5fee3779097c210a045f3c3b3a6f09724af44503a7bd.jpg) +$\delta (\mathbf{hr},\mathbf{FAD - EDSR})$ + +Table 2: Latency of various models executed on CPU. + +
PlatformEDSRFAD-EDSRSpeed-up ratio
Single core CPU39.60s25.44s×1.6
Double core CPU20.08s13.74s×1.5
+ +Table 3: Comparison of various frequency masks on EDSR-baseline [21]. PSNR is reported and scale factor is $\times 2$ . + +
MethodsSet5Set14B100Urban100
Random for blocks37.7933.3332.0631.47
Random for images37.6733.1931.9531.17
DCT mask37.8233.4032.0731.72
Learnable w/o guidance37.8633.4332.1131.81
Learnable w/ guidance37.9233.4932.1331.90
+ +shown in Equation 9. Multiple models with different computations are obtained by adjusting the hyper-parameter and the relation between PSNR and FLOPs is shown in Fig. 4. The upper left points have better performance. One can see that the proposed method outperforms its counterparts. + +Why did FADN achieve higher accuracy over baselines? The proposed FADN possesses more parameters compared with the original baseline. In addition, the branching strategy allows the weights of each branch to adapt to the specific frequency region instead of covering various frequency regions. Finally, cheap operator can achieve better accuracy than heavy operator on low-frequency regions. Hence, our method achieves better performance than the SR baselines. + +More prominent SISR models are evaluated in the Supplementary Material. It shows that the proposed method reduces FLOPs significantly while preserves the performance. + +# 4.3. Ablation Study + +In ablation study, we apply our method on EDSR baseline [21] which includes 16 residual blocks of 64 channels. + +![](images/0faeefe0ba84fff1cda58b0f572b577768dcb88410534a03ec04a58889de177b.jpg) +Figure 6: Confusion Matrix between DCT and learnable frequency mask. + +![](images/7b70ea37e2e7a2f5d80d2dff12a81266c6d16c8b2f3f261be544c5f6c5c79e1d.jpg) +Figure 7: Comparison of different predictor number. PSNR in Urban $\times 2$ is reported. + +All models are trained for 300,000 iterations and the learning rate decays to half every 100,000 iterations. Note that We have adjusted the hyper-parameter $\alpha$ and guaranteed the computations among each experiment are comparable. + +Learnable Frequency Mask The frequency masks are learned by an end-to-end manner in our proposed methods. To demonstrate the effectiveness of learnable frequency masks, we exploit different strategies for mask generation, including random masks for each block, random masks for each image (i.e., sharing a fixed random mask among blocks), fixed frequency masks generated by DCT, learnable frequency masks without DCT guidance and learnable frequency masks with DCT guidance. Note that we are more concerned about the performance on Urban100 since its image quantity and quality are higher. As shown in Table. 3, the performance using random masks is terrible because the model cannot identify the frequency information and assign pixels to the reasonable branches. A fixed random mask is worse than multiple random masks among blocks. The DCT frequency masks outperform random masks because the former provide appropriate indication that assigns pixels to the proper branches. However, the DCT frequency masks are dependent on human-crafted thresholds and sen + +![](images/6e37bc64deb38bb328e26a9e12e421868875ec673cdcc8f02db615dfa222f37d.jpg) + +![](images/e5cae6a50b5e66a23f2773a05ea4840a9970aaaa09bb9446450d620c64600b73.jpg) + +![](images/baf456a206eef797b10b2007782f3c06b13a642fea4c9b15ae3cb127bb2727ad.jpg) + +![](images/837f65bee4dcc74a63068102a64993c4eb5fda42c515a2922cc0bcd1eb667c20.jpg) + +![](images/ac1ea482f409cdf2826421cd95ee5888569d27c8228a0b2cf4db6e91077397d8.jpg) + +![](images/bd81313397bd7d4b1e1aaf0ce28829732a29d053e6916389b1e3de5a18f95154.jpg) +image + +![](images/bd0503cf21fcb8bafed7ced04af88bf5e5eeedb1b785504caa61cd5fd3cc4900.jpg) +mask generated with DCT + +![](images/f3661a25186d60e63dc59070236c9420f0544c06c21e65427dbcdfa8a7020dc8.jpg) +mask of 2th block +Figure 8: Comparison between frequency masks generated with DCT and our learnable frequency masks in different blocks. Yellow, Blue and Purple represent High, Medium and Low frequency respectively. + +![](images/974d7a7d3e813a183151fce91fe3f08b2949579a5bf1d0a28ec3a046f5030974.jpg) +mask of 8th block + +![](images/f0e5822d247b9d544716526185ab9f6e304c4e543fda0151a1ec3db95c6df7ba.jpg) +mask of 14th block + +sitive to noise. Besides, the specific thresholds cannot adapt to all images. The learnable frequency masks avoid the problem by end-to-end optimization. Without the guidance of DCT prior knowledge, learnable frequency masks outperform DCT frequency masks. With the help of guidance, models can converge faster and achieve better performance. + +Apart from the quantitative performance comparison, we compare the learnable frequency masks with DCT frequency masks. As shown in Fig. 8, DCT frequency masks indicate the frequency distribution but are sensitive to noises. Our learnable frequency masks are similar to the DCT frequency masks except for minority regions where the predictor adjusts the mask according to specific inputs for more accurate indication. Besides, the learnable frequency masks are little different among each block since it's not a wise choice to use a fixed frequency mask for all blocks. Generally, the lower frequency pixels tend to use the branches requiring less computations. The result implies the proposed FADN model can identify the frequency strength and assign the pixels to branches of proper computations according to the frequency strength. The confusion matrix between DCT frequency masks and learnable frequency masks is shown in Fig. 6 which also proves that the mask predictor can learn the frequency distribution and adjust the partition thresholds automatically. + +Mask Predictor Number By default, we use a separate mask predictor for each frequency-aware dynamic block. Besides, the predictor can also be shared among multiple blocks. We visualize the influence of predictor number in Figure 7. In particularly, the model learns one frequency mask for the whole network when the predictor number is 1 and learns an independent mask for each block when the number is 16. One can see that a single predictor performs worse than multiple predictors, because the optimal frequency partition is not invariant among blocks. It is another important reason why we can not use the fixed frequency masks generated with DCT directly. Overall, as the + +Table 4: Comparison of different branch number. PSNR is reported and scale factor is $\times 2$ . + +
Branch Num.Set5Set14B100Urban100
237.8433.4432.0931.72
337.9033.4732.1331.85
437.9033.4832.1231.88
+ +predictor number increases, the adjustment ability of FADN is more powerful. The performance therefore becomes better although the improvement grows more slowly. + +Branch Number We use 3-branch FADN in above experiments but the branch number and branch architectures are optional. We test the influence of different branch number. As the branch number increases, each branch only needs to recover signals in a smaller frequency range. The results are shown in Table. 4. Note that we have guaranteed similar computations among different settings. The performance of 3-branch is significantly better than 2-branch while 4-branch is slightly better than 3-branch. Considering the storage cost, 3-branch FADN are recommended. + +# 5. Conclusion + +In this paper, a novel frequency-aware dynamic network (FADN) is proposed for efficient single image super resolution, which assigns cheap operations to low-frequency regions and vice versa. To this end, a predictor is introduced to divide the input feature into multiple components based on DCT domain. The predictor is learned under the supervision of hand-crafted frequency-domain masks of images in the training set and the reconstruction loss of SISR, simultaneously. The overall computational complexity will be significantly reduced by the optimized allocation. In addition, the frequency-aware dynamic mechanism can be conveniently employed on various SISR architectures. Experimental results indicate that FADN can effectively reduce approximate half of FLOPs in multiple benchmark databases while maintaining the performance of the original network. + +# References + +[1] Nasir Ahmed, T Natarajan, and Kamisetty R Rao. Discrete cosine transform. IEEE transactions on Computers, 100(1):90-93, 1974. 2, 4 +[2] Namhyuk Ahn, Byungkon Kang, and Kyung-Ah Sohn. Fast, accurate, and lightweight super-resolution with cascading residual network. In ECCV, pages 252-268, 2018. 2, 3 +[3] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. 2012. 5 +[4] Ronald Newbold Bracewell and Ronald N Bracewell. The Fourier transform and its applications, volume 31999. McGraw-Hill New York, 1986. 2 +[5] Yunpeng Chen, Haoqi Fan, Bing Xu, Zhicheng Yan, Yannis Kalantidis, Marcus Rohrbach, Shuicheng Yan, and Ji-ashi Feng. Drop an octave: Reducing spatial redundancy in convolutional neural networks with octave convolution. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3435–3444, 2019. 5 +[6] Xiangxiang Chu, Bo Zhang, Hailong Ma, Ruijun Xu, Jixiang Li, and Qingyuan Li. Fast, accurate and lightweight superresolution with neural architecture search. arXiv preprint arXiv:1901.07261, 2019. 2, 3 +[7] Tao Dai, Jianrui Cai, Yongbing Zhang, Shu-Tao Xia, and Lei Zhang. Second-order attention network for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 11065-11074, 2019. 2 +[8] Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Learning a deep convolutional network for image super-resolution. In ECCV, pages 184-199, 2014. 1, 2 +[9] Chao Dong, Chen Change Loy, and Xiaou Tang. Accelerating the super-resolution convolutional neural network. In ECCV, pages 391-407. Springer, 2016. 2 +[10] Qinquan Gao, Yan Zhao, Gen Li, and Tong Tong. Image super-resolution using knowledge distillation. In Asian Conference on Computer Vision, pages 527-541. Springer, 2018. 3 +[11] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5197-5206, 2015. 5 +[12] Zheng Hui, Xinbo Gao, Yunchu Yang, and Xiumei Wang. Lightweight image super-resolution with information multi-distillation network. In Proceedings of the 27th ACM International Conference on Multimedia, pages 2024-2032, 2019. 3 +[13] Zheng Hui, Xiumei Wang, and Xinbo Gao. Fast and accurate single image super-resolution via information distillation network. In CVPR, pages 723-731, 2018. 3 +[14] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. 4 +[15] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, pages 694–711. Springer, 2016. 2 + +[16] Robert Keys. Cubic convolution interpolation for digital image processing. IEEE transactions on acoustics, speech, and signal processing, 29(6):1153-1160, 1981. 2 +[17] Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In CVPR, pages 1646-1654, 2016. 2, 6 +[18] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2014. 5 +[19] Chuck L Lawson, Richard J. Hanson, David R Kincaid, and Fred T. Krogh. Basic linear algebra subprograms for fortran usage. ACM Transactions on Mathematical Software (TOMS), 5(3):308-323, 1979. 5 +[20] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative adversarial network. In CVPR, pages 4681-4690, 2017. 2 +[21] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In CVPR Workshops, pages 136-144, 2017. 2, 3, 4, 5, 6, 7 +[22] Ming Liu, Zhilu Zhang, Liya Hou, Wangmeng Zuo, and Lei Zhang. Deep adaptive inference networks for single image super-resolution. In European Conference on Computer Vision Workshop, 2020. 3, 5, 6 +[23] Zhi-Song Liu, Li-Wen Wang, Chu-Tak Li, Wan-Chi Siu, and Yui-Lam Chan. Image super-resolution via attention based back projection networks. In International Conference on Computer Vision Workshop, pages 3517-3525, 2019. 2 +[24] Xiaotong Luo, Yuan Xie, Yulun Zhang, Yanyun Qu, Cuihua Li, and Yun Fu. Latticenet: Towards lightweight image super-resolution with lattice block. In Proceedings of the European Conference on Computer Vision, 2020. 2, 3 +[25] Yinglan Ma, Hongyu Xiong, Zhe Hu, and Lizhuang Ma. Efficient super resolution using binarized neural network. In CVPR Workshops, pages 0–0, 2019. 3 +[26] David Martin, Charless Fowlkes, Doron Tal, and Jitendra Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In ICCV, volume 2, pages 416-423. IEEE, 2001. 5 +[27] Dehua Song, Chang Xu, Xu Jia, Chunjing Xu, and Yunhe Wang. Efficient residual dense block search for image superresolution. 2020. 2, 3 +[28] Gilbert Strang. The discrete cosine transform. SIAM review, 41(1):135-147, 1999. 4 +[29] Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. Memnet: A persistent memory network for image restoration. In ICCV, pages 4539-4547, 2017. 2 +[30] Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, and Lei Zhang. Ntire 2017 challenge on single image super-resolution: Methods and results. In CVPR Workshops, pages 114-125, 2017. 5 +[31] Diego Valsesia, Giulia Fracastoro, and Enrico Magli. Deep graph-convolutional image denoising. IEEE Transactions on Image Processing, 29:8226-8237, 2020. 2 + +[32] Thomas Verelst and Tinne Tuytelaars. Dynamic convolutions: Exploiting spatial sparsity for faster inference. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2320-2329, 2020. 3, 5 +[33] Jingwei Xin, Nannan Wang, Xinrui Jiang, Jie Li, Heng Huang, and Xinbo Gao. Binarized neural network for single image super resolution. In European Conference on Computer Vision, 2020. 3 +[34] Qing Yan, Yi Xu, Xiaokang Yang, and Truong Q Nguyen. Single image superresolution based on gradient profile sharpness. IEEE Transactions on Image Processing, 24(10):3187-3202, 2015. 2 +[35] Yiding Yang, Jiayan Qiu, Mingli Song, Dacheng Tao, and Xinchao Wang. Distilling knowledge from graph convolutional networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7074-7083, 2020. 3 +[36] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In International conference on curves and surfaces, pages 711-730. Springer, 2010. 5 +[37] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Proceedings of the European Conference on Computer Vision, pages 286-301, 2018. 2, 3, 4, 5, 6 +[38] Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image super-resolution. In CVPR, pages 2472-2481, 2018. 2 +[39] Shangchen Zhou, Jiawei Zhang, Wangmeng Zuo, and Chen Change Loy. Cross-scale internal graph neural network for image super-resolution. In Advances in neural information processing systems, 2020. 2 \ No newline at end of file diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/images.zip b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9b1c1ce98d05fc8417176292f1ef15689c8025e9 --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:716f5ea3af0fa4685eb45af8c4a545c3aab85182a64d171b8f49bd94c417a394 +size 858681 diff --git a/learningfrequencyawaredynamicnetworkforefficientsuperresolution/layout.json b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d97ddeeb66e0581bc5756bcff2f9ae10c89d532a --- /dev/null +++ b/learningfrequencyawaredynamicnetworkforefficientsuperresolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d04a14c2bdc201ee63b48d95ef49a4b3c28ad2018de8db726cbb3a57691b320c +size 474768 diff --git a/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_content_list.json b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..da305353d2490cf16fd3d49c8dd52996f290a4a7 --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de9ab25d125ba2685f4ca1c6d9f7a6e1cb298675badc2fa8ac3b19b653cbe7e0 +size 75158 diff --git a/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_model.json b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7c8f38ab9c3fa7867059bb2dcb09f7049f76948a --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70c84580b36977b737cf438b48bfbab2df56fbe4c0f6f20083f3bb506a8ae255 +size 92954 diff --git a/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_origin.pdf b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a4dd4ba04ae47eeea769b656b49e872baa2597e8 --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/f3ec2943-0354-4091-879a-b3bd72b93f62_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c8e05618def2cc35ebb0484cb8cef21ad2f17266efe5d307f7575b3d268b3f +size 3039548 diff --git a/learningfromnoisydatawithrobustrepresentationlearning/full.md b/learningfromnoisydatawithrobustrepresentationlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..578c435006fba9948652b6dbafc3f2430f3dbb9c --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/full.md @@ -0,0 +1,341 @@ +# Learning from Noisy Data with Robust Representation Learning + +Junnan Li Caiming Xiong Steven C.H. Hoi +Salesforce Research + +{junnan.li,cxiong,shoi}@salesforce.com + +# Abstract + +Learning from noisy data has attracted much attention, where most methods focus on label noise. In this work, we propose a new learning framework which simultaneously addresses three types of noise commonly seen in real-world data: label noise, out-of-distribution input, and input corruption. In contrast to most existing methods, we combat noise by learning robust representation. Specifically, we embed images into a low-dimensional subspace, and regularize the geometric structure of the subspace with robust contrastive learning, which includes an unsupervised consistency loss and a supervised mixup prototypical loss. We also propose a new noise cleaning method which leverages the learned representation to enforce a smoothness constraint on neighboring samples. Experiments on multiple benchmarks demonstrate state-of-the-art performance of our method and robustness of the learned representation. Code is available at https://github.com/salesforce/RRL/. + +# 1. Introduction + +Data in real life is noisy. However, deep models with remarkable performance are mostly trained on clean datasets with high-quality human annotations. Manual data cleaning and labeling is an expensive process that is difficult to scale. On the other hand, there exists almost infinite amount of noisy data online. It is crucial that deep neural networks (DNNs) could harvest noisy training data. However, it has been shown that DNNs are susceptible to overfitting to noise [43]. + +As shown in Figure 1, a real-world noisy image dataset often consists of multiple types of noise. Label noise refers to samples that are wrongly labeled as another class (e.g. flower labeled as orange). Out-of-distribution input refers to samples that do not belong to any known classes. Input corruption refers to image-level distortion (e.g. low brightness) that causes data shift between training and test. + +Most of the methods in literature focus on addressing the more detrimental label noise. Two dominant approaches include: (1) find clean samples as those with smaller loss and + +![](images/841815b2c3bb0db626ac01ef2b8b4a116109ad90eea094010372f4687c167e03.jpg) +Label Noise + +![](images/19cdb6b05d55bc1b159f3e75d528a382dd442f1348c99d8351e25a39e7f7e79f.jpg) +Out-of-distribution Input +Figure 1. Google search images from WebVision [22] dataset with keyword "orange". + +![](images/49d413d43bbe2e93147774a482f1a35dd9a28fa2857abe9bb8443d567ee0a70a.jpg) +Input Corruption + +assign larger weights to them [6, 42, 32, 1]; (2) relabel noisy samples using model's predictions [31, 25, 34, 41, 23, 18]. Previous methods that focus on addressing label noise do not consider out-of-distribution input or input corruption, which limits their performance in real-world scenarios. Furthermore, using a model's own prediction to relabel samples could cause confirmation bias, where the prediction error accumulates and harms performance. + +We propose a new direction for effective learning from noisy data. Different from existing methods, our method learns noise-robust low-dimensional representations, and performs noise cleaning by enforcing a smoothness constraint on neighboring samples. Specifically, our algorithmic contributions include: + +- We propose noise-robust contrastive learning, which introduces two contrastive losses. The first is an unsupervised consistency contrastive loss. It enforces inputs with perturbations to have similar normalized embeddings, which helps learn robust and discriminative representation. +- Our second contrastive loss is a weakly-supervised prototypical contrastive loss. We compute class prototypes as normalized mean embeddings, and enforces each sample's embedding to be closer to its class prototype. Inspired by Mixup [44], we construct virtual training samples as linear interpolation of inputs, and encourage the same linear relationship w.r.t the class prototypes. +- We propose a new noise cleaning method which leverages the learned representations to enforce a smoothness constraint on neighboring samples. For each sample, we aggregate information from its top- $k$ neighbors to create a pseudo-label. A subset of training samples with confi + +dent pseudo-labels are selected to compute the weakly-supervised loss. This process can effectively clean both label noise and out-of-distribution (OOD) noise. + +# Our experimental contributions include: + +- We experimentally show that our method achieves state-of-the-art performance on multiple datasets with controlled noise and real-world noise. +- We demonstrate that the proposed noise cleaning method can effectively clean a majority of label noise. It also learns a curriculum that gradually leverages more samples to compute the weakly-supervised loss as the pseudolabels become more accurate. +- We validate the robustness of the learned low-dimensional representation by showing (1) $k$ -nearest neighbor classification outperforms the softmax classifier. (2) OOD samples can be separated from in-distribution samples. + +# 2. Related work + +# 2.1. Label noise learning + +Learning from noisy labels have been extensively studied in the literature. While some methods require access to a small set of clean samples [40, 35, 36, 17, 11], most methods focus on the more challenging scenario where no clean labels are available. These methods can be categorized into two major types. The first type performs label correction using predictions from the network [31, 25, 34, 41, 23]. The second type tries to separate clean samples from corrupted samples, and trains the model on clean samples [6, 1, 14, 13, 38, 3, 24, 20]. DivideMix [18] combines label correction and sample selection with the Mixup [44] data augmentation under a co-training framework, but cost $2 \times$ the computational resource of our method. + +Different from existing methods, our method addresses label noise learning by learning robust representations. We propose a more effective noise cleaning method by leveraging the structure of the learned representations. Furthermore, our model is robust not only to label noise, but also to out-of-distribution and corrupted input. A previous work has studied open-set noisy labels [38], but their method does not enjoy the same level of robustness as ours. + +# 2.2. Contrastive learning + +Contrastive learning is at the core of recent self-supervised representation learning methods [4, 8, 29, 39]. In self-supervised contrastive learning, two randomly augmented images are generated for each input image. Then a contrastive loss is applied to pull embeddings from the same source image closer, while pushing embeddings from different source images apart. Recently, prototypical contrastive learning (PCL) [21] has been proposed, which uses cluster + +centroids as prototypes, and trains the network by pulling an image embedding closer to its assigned prototypes. + +Different from these methods, our method performs contrastive learning in the principal subspace by training a linear autoencoder. Our weakly-supervised contrastive loss improves PCL [21] by using pseudo-labels to compute class-prototypes, and augments the input with Mixup [44]. Different from the original Mixup where learning happens at the classification layer, our learning takes places in the low-dimensional subspace to learn robust representation. + +# 3. Method + +Given a noisy training dataset $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^n$ , where $x_i$ is an image and $y_i \in \{1, \dots, C\}$ is its class label. We aim to train a network that is robust to the noise in training data and achieves high accuracy on a clean test set. The proposed method performs two steps iteratively: (1) noise-robust contrastive learning, which trains the network to learn robust representations; (2) noise cleaning with smooth neighbors, which aims to correct label noise and remove OOD samples. A pseudo-code is given in Algorithm 1. Next, we delineate each step in details. + +# 3.1. Noise-robust contrastive learning + +As shown in Figure 2, the network consists of three components: (1) a deep encoder (a convolutional neural network) that encodes an image $\boldsymbol{x}_i$ to a high-dimensional feature $\boldsymbol{v}_i$ ; (2) a classifier (a fully-connected layer followed by softmax) that receives $\boldsymbol{v}_i$ as input and outputs class predictions; (3) a linear autoencoder that projects $\boldsymbol{v}_i$ into a low-dimensional embedding $\boldsymbol{z}_i \in \mathbb{R}^d$ . We aim to learn robust embeddings with two contrastive losses: unsupervised consistency loss and weakly-supervised mixup prototypical loss. + +Unsupervised consistency contrastive loss. Following the NT-Xent [4] loss for self-supervised representation learning, our consistency contrastive loss enforces images with semantic-preserving perturbations to have similar embeddings. Specifically, given a minibatch of $b$ images, we apply weak-augmentation and strong-augmentation to each image, and obtain $2b$ inputs $\{x_{i}\}_{i = 1}^{2b}$ . Weak augmentation is a standard flip-and-shift augmentation strategy, while strong augmentation consists of color and brightness changes with details given in Section 4.1. + +We project the inputs into the low-dimensional space and obtain their normalized embeddings $\{\hat{z}_i\}_{i=1}^{2b}$ . Let $i \in \{1, \dots, b\}$ be the index of a weakly-augmented input, and $j(i)$ be the index of the strong-augmented input from the same source image, the consistency contrastive loss is defined as: + +$$ +\mathcal {L} _ {\mathrm {c c}} = \sum_ {i = 1} ^ {b} - \log \frac {\exp \left(\hat {\boldsymbol {z}} _ {i} \cdot \hat {\boldsymbol {z}} _ {j (i)} / \tau\right)}{\sum_ {k = 1} ^ {2 b} \mathbb {1} _ {i \neq k} \exp \left(\hat {\boldsymbol {z}} _ {i} \cdot \hat {\boldsymbol {z}} _ {k} / \tau\right)}, \tag {1} +$$ + +where $\tau$ is a scalar temperature parameter. The consistency + +![](images/f329d44a2cf066ba17458dc59482d7261912c357d85fa9a31991a7c76bfb990b.jpg) +Figure 2. Our proposed framework for noise-robust contrastive learning. We project images into a low-dimensional subspace, and regularize the geometric structure of the subspace with $(1)\mathcal{L}_{cc}$ : a consistency contrastive loss which enforces images with perturbations to have similar embeddings; $(2)\mathcal{L}_{\mathrm{pc\_mix}}$ : a prototypical contrastive loss augmented with mixup, which encourages the embedding for a linearly-interpolated input to have the same linear relationship w.r.t the class prototypes. The low-dimensional embeddings are also trained to reconstruct the high-dimensional features, which preserves the learned information and regularizes the classifier. + +contrastive loss maximizes the inner product between the pair of positive embeddings $\hat{z}_i$ and $\hat{z}_{j(i)}$ , while minimizing the inner product between $2(b - 1)$ pairs of negative embeddings. By mapping different views (augmentations) of the same image to neighboring embeddings, the consistency contrastive loss encourages the network to learn discriminative representation that is robust to low-level image corruption. + +Weakly-supervised mixup prototypical contrastive loss. Our second contrastive loss injects structural knowledge of classes into the embedding space. Let $\mathcal{I}_c$ denote indices for the subset of images in $\mathcal{D}$ labeled with class $c$ , we calculate the class prototype as the normalized mean embedding: + +$$ +\boldsymbol {z} ^ {c} = \frac {1}{| \mathcal {I} _ {c} |} \sum_ {i \in \mathcal {I} _ {c}} \hat {\boldsymbol {z}} _ {i}, \quad \hat {\boldsymbol {z}} ^ {c} = \frac {\boldsymbol {z} ^ {c}}{\| \boldsymbol {z} ^ {c} \| _ {2}}, \tag {2} +$$ + +where $\hat{z}_i$ is the embedding of a center-cropped image, and the class prototypes are calculated at the beginning of each epoch. + +The prototypical contrastive loss enforces an image embedding $\hat{z}_i$ to be more similar to its corresponding class prototype $\hat{z}^{y_i}$ , in contrast to other class prototypes: + +$$ +\mathcal {L} _ {\mathrm {p c}} \left(\hat {\boldsymbol {z}} _ {i}, y _ {i}\right) = - \log \frac {\exp \left(\hat {\boldsymbol {z}} _ {i} \cdot \hat {\boldsymbol {z}} ^ {y _ {i}} / \tau\right)}{\sum_ {c = 1} ^ {C} \exp \left(\hat {\boldsymbol {z}} _ {i} \cdot \hat {\boldsymbol {z}} ^ {c} / \tau\right)}. \tag {3} +$$ + +Since the label $y_{i}$ is noisy, we would like to regularize the encoder from memorizing training labels. Mixup [44] has been shown to be an effective method against label noise [1, 18]. Inspired by it, we create virtual training samples by linearly interpolating a sample (indexed by $i$ ) with another + +sample (indexed by $m(i)$ ) randomly chosen from the same minibatch: + +$$ +\boldsymbol {x} _ {i} ^ {m} = \lambda \boldsymbol {x} _ {i} + (1 - \lambda) \boldsymbol {x} _ {m (i)}, \tag {4} +$$ + +where $\lambda \sim \mathrm{Beta}(\alpha, \alpha)$ . + +Let $\hat{z}_i^m$ be the normalized embedding for $x_i^m$ , the mixup version of the prototypical contrastive loss is defined as a weighted combination of the two $\mathcal{L}_{\mathrm{pc}}$ w.r.t class $y_i$ and $y_{m(i)}$ . It enforces the embedding for the interpolated input to have the same linear relationship w.r.t. the class prototypes. + +$$ +\mathcal {L} _ {\mathrm {p c} - \operatorname {m i x}} = \sum_ {i = 1} ^ {2 b} \lambda \mathcal {L} _ {\mathrm {p c}} \left(\hat {\boldsymbol {z}} _ {i} ^ {m}, y _ {i}\right) + (1 - \lambda) \mathcal {L} _ {\mathrm {p c}} \left(\hat {\boldsymbol {z}} _ {i} ^ {m}, y _ {m (i)}\right). \tag {5} +$$ + +Reconstruction loss. We also train a linear decoder $\mathbf{W}_{\mathrm{d}}$ to reconstruct the high-dimensional feature $\pmb{v}_i$ based on $\pmb{z}_i$ . The reconstruction loss is defined as: + +$$ +\mathcal {L} _ {\text {r e c o n}} = \sum_ {i = 1} ^ {2 b} \| \boldsymbol {v} _ {i} - \mathbf {W} _ {\mathrm {d}} \boldsymbol {z} _ {i} \| _ {2} ^ {2}. \tag {6} +$$ + +There are several benefits for training the autoencoder. First, an optimal linear autoencoder will project $v_{i}$ into its low-dimensional principal subspace and can be understood as applying PCA [2]. Thus the low-dimensional representation $z_{i}$ is intrinsically robust to input noise. Second, minimizing the reconstruction error is maximizing a lower bound of the mutual information between $v_{i}$ and $z_{i}$ [37]. Therefore, knowledge learned from the proposed contrastive losses can be maximally preserved in the high-dimensional representation, which helps regularize the classifier. + +![](images/ef06f3a68334064dd42d5d16acf633d7f6faaa8b1730600e1d75db17396965a7.jpg) +(a) + +![](images/0d351695b69dc5da41e7defbb85119090e4cebb1bb33d5b3ed3157e28f170521.jpg) +(b) + +![](images/93d8081a16070cb67a76c59e9a9a67f06bea023dc94ae23302e4d4175f8cb2ed.jpg) +(c) +Figure 3. Curriculum learned by the proposed label correction method for training on CIFAR datasets with $50\%$ sym. noise. (a) Accuracy of pseudo-labels w.r.t to clean training labels. Our method effectively cleans a majority of the label noise. (b) Number of samples in the weakly-supervised subset $\mathcal{D}_{\mathrm{ws}}^t$ . As the pseudo-labels become more accurate, more samples are used to compute the supervised losses. (c) Label noise ratio in the weakly-supervised subset, which maintains at a low level even as the size of the subset grows. + +Classification loss. Given the softmax output from the classifier, $p(\pmb{y}; \pmb{x}_i)$ , we define the classification loss as the cross-entropy loss. Note that it is only applied to the weakly-augmented inputs. + +$$ +\mathcal {L} _ {\mathrm {c e}} = - \sum_ {i = 1} ^ {b} \log p \left(y _ {i}; \boldsymbol {x} _ {i}\right). \tag {7} +$$ + +The overall training objective is to minimize a weighted sum of all losses: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {c e}} + \omega_ {\mathrm {c c}} \mathcal {L} _ {\mathrm {c c}} + \omega_ {\mathrm {p c}} \mathcal {L} _ {\mathrm {p c . m i x}} + \omega_ {\mathrm {r e c o n}} \mathcal {L} _ {\mathrm {r e c o n}} \tag {8} +$$ + +For all experiments, we fix $\omega_{\mathrm{cc}} = 1$ , $\omega_{\mathrm{recon}} = 1$ , and change $\omega_{\mathrm{pc}}$ only across datasets. Our method is in general net sensitive to the values of the weights. In our ablation study, we show that setting either $\omega_{\mathrm{cc}} = 0$ or $\omega_{\mathrm{recon}} = 0$ still yields performance competitive or better than the current SoTA. + +# 3.2. Noise cleaning with smooth neighbors + +After warming-up the model by training with the noisy labels $\{y_{i}\}_{i = 1}^{n}$ for $t_0$ epochs, we aim to clean the noise by generating a soft pseudo-label $q_{i}$ for each training sample. Different from previous methods that perform label correction purely using the model's softmax prediction, our method exploits the structure of the low-dimensional subspace by aggregating information from top- $k$ neighboring samples, which helps alleviate the confirmation bias problem. + +At the $t$ -th epoch, for each sample $\pmb{x}_i$ , let $\pmb{p}_i^t$ be the classifier's softmax prediction, let $\pmb{q}_i^{t-1}$ be its soft label from the previous epoch, we calculate the soft label for the current epoch as: + +$$ +\boldsymbol {q} _ {i} ^ {t} = \frac {1}{2} \boldsymbol {p} _ {i} ^ {t} + \frac {1}{2} \sum_ {j = 1} ^ {k} w _ {i j} ^ {t} \boldsymbol {q} _ {j} ^ {t - 1}, \tag {9} +$$ + +where $w_{ij}^{t}$ represents the normalized affinity between a sample and its neighbor and is defined as $w_{ij}^{t} = \frac{\exp(\hat{\mathbf{z}}_{i}^{t}\cdot\hat{\mathbf{z}}_{j}^{t} / \tau)}{\sum_{i = 1}^{k}\exp(\hat{\mathbf{z}}_{i}^{t}\cdot\hat{\mathbf{z}}_{j}^{t} / \tau)}$ . We set $k = 200$ in all experiments. + +The soft label defined by eqn.(9) is the minimizer of the following quadratic loss function: + +$$ +J \left(\boldsymbol {q} _ {i} ^ {t}\right) = \sum_ {j = 1} ^ {k} w _ {i j} ^ {t} \left\| \boldsymbol {q} _ {i} ^ {t} - \boldsymbol {q} _ {j} ^ {t - 1} \right\| _ {2} ^ {2} + \left\| \boldsymbol {q} _ {i} ^ {t} - \boldsymbol {p} _ {i} ^ {t} \right\| _ {2} ^ {2}. \tag {10} +$$ + +The first term is a smoothness constraint which encourages the soft label to take a similar value as its neighbors' labels, whereas the second term attempts to maintain the model's class prediction. + +We construct a weakly-supervised subset which contains (1) clean sample whose soft label score for the original class $y_{i}$ is higher than a threshold $\eta_0$ , (2) pseudo-labeled sample whose maximum soft label score exceeds a threshold $\eta_{1}$ . For pseudo-labeled samples, we convert their soft labels into hard labels by taking the class with the maximum score. + +$$ +\begin{array}{l} \mathcal {D} _ {\mathrm {w s}} ^ {t} = \left\{\boldsymbol {x} _ {i}, y _ {i} \mid q _ {i} ^ {t} (y _ {i}) > \eta_ {0} \right\} \cup \left\{\boldsymbol {x} _ {i}, \hat {y} _ {i} ^ {t} = \underset {c} {\arg \max } q _ {i} ^ {t} (c) \right\vert \\ \forall \max _ {c} q _ {i} ^ {t} (c) > \eta_ {1}, c \in \{1,.., C \} \} \tag {11} \\ \end{array} +$$ + +Given the weakly-supervised subset, we modify the classification loss $\mathcal{L}_{\mathrm{ce}}$ , the mixup prototypical contrastive loss $\mathcal{L}_{\mathrm{pc\_mix}}$ , and the calculation of prototypes $\hat{z}^c$ , such that they only use samples from $\mathcal{D}_{\mathrm{ws}}^t$ . The unsupervised losses (i.e. $\mathcal{L}_{\mathrm{cc}}$ and $\mathcal{L}_{\mathrm{recon}}$ ) still operate on all training samples. + +Learning curriculum. Our iterative noise cleaning method learns an effective training curriculum, which gradually increases the size of $\mathcal{D}_{\mathrm{ws}}^t$ as the pseudo-labels become more accurate. To demonstrate such curriculum, we analyse the noise cleaning statistics for training our model on CIFAR-10 and CIFAR-100 datasets with $50\%$ label noise (experimental + +Algorithm 1: Pseudo-code for our method. +1 Input: noisy training data $\mathcal{D} = \{(x_i,y_i)\}_{i = 1}^n$ , model parameters $\theta$ +2 for $t\gets 0$ to $t_0 - 1$ do // learn from noisy labels for $t_0$ epochs (warm-up) +3 $\{\hat{z}_i\}_{i = 1}^n = \{f_\theta (\pmb {x}_i)\}_{i = 1}^n$ // get normalized low-dimensional embeddings for all images +4 $\{\hat{z}^c\}_{c = 1}^C =$ Calculate-Prototype( $\{\hat{z}_i,y_i\}_{i = 1}^n$ // calculate class prototypes +5 for $\{(x_i,y_i)\}_{i = 1}^{2b}$ in $\mathcal{D}$ do // load a minibatch +6 $\hat{z}_i = f_\theta (\pmb {x}_i)$ // obtain normalized low-dimensional embeddings +7 $\lambda \sim \mathrm{Beta}(\alpha ,\alpha)$ // sample a mixup weight from a beta distribution +8 $\pmb{x}_i^m = \lambda \pmb {x}_i + (1 - \lambda)\pmb{x}_{m(i)}$ // generate virtual training samples +9 $\hat{z}_i^m = f_\theta (\pmb {x}_i^m)$ // obtain embeddings for virtual samples +10 $\mathcal{L} = \sum_{i = 1}^{b}\mathcal{L}_{\mathrm{ce}}(\pmb {x}_i,\pmb {y}_i) + \sum_{i = 1}^{2b}\left(\omega_{\mathrm{cc}}\mathcal{L}_{\mathrm{cc}}(\hat{z}_i) + \right.$ $\omega_{\mathrm{pc}}\mathcal{L}_{\mathrm{pc\_mix}}(\hat{z}_i^m,y_i,\lambda) + \omega_{\mathrm{recon}}\mathcal{L}_{\mathrm{recon}}(\pmb {x}_i,\hat{z}_i))$ +11 $\theta = \mathrm{SGD}(\mathcal{L},\theta)$ // compute loss and update model parameters +12 end +13 end +14 for $t\gets t_0$ to MaxEpoch do // learn from psuedo-labels +15 $\{\hat{z}_i^t,p_i^t\}_{i = 1}^n = \{f_\theta (\pmb {x}_i)\}_{i = 1}^n$ // get embeddings and softmax predictions for all images +16 ${q_i}^t = \frac{1}{2}{p_i}^t +\frac{1}{2}\sum_{j = 1}^k w_{ij}^t q_j^{t - 1}$ $q_{i}^{t_{0} - 1} = p_{i}^{t_{0}}$ // aggregate information from top-k neighbors to generate soft labels +17 $\mathcal{D}_{\mathrm{ws}}^t = \{\pmb {x}_i,y_i\mid q_i^t (y_i) > \eta_0\} \cup \{\pmb {x}_i,\hat{y}_i^t =$ arg max $c_{i}q_{i}^{t}(c)\mid \forall \max_{c}q_{i}^{t}(c) > \eta_{1},c\in \{1,..,C\}\}$ // construct a subset containing clean samples and pseudo-labeled samples +18 Repeat line 4-12, but only use samples from $\mathcal{D}_{\mathrm{ws}}^t$ to compute $\hat{z}^c$ , Lce, Lpc\_mix. + +details explained in the next section). In Figure 3 (a), we show the accuracy of the soft pseudo-labels w.r.t to clean training labels (only used for analysis purpose). Our method can significantly reduce the ratio of label noise from $50\%$ to $5\%$ (for CIFAR-10) and $17\%$ (for CIFAR-100). Figure 3 (b) shows the size of $\mathcal{D}_{\mathrm{ws}}^t$ as a percentage of the total number of training samples, and Figure 3 (c) shows the effective label noise ratio within the weakly-supervised subset $\mathcal{D}_{\mathrm{ws}}^t$ . Our method maintains a low noise ratio in the weakly-supervised subset, while gradually increasing its size to utilize more + +samples for the weakly-supervised losses. + +# 4. Experiment + +In this section, we validate the proposed method on multiple benchmarks with controlled noise and real-world noise. Our method achieves state-of-the-art performance across all benchmarks. For fair comparison, we compare with DivideMix [18] without ensemble. In Table 7, we report the result of our method with co-training and ensemble, which further improves performance. + +# 4.1. Experiments on controlled noisy labels + +Dataset. Following [34, 18], we corrupt the training data of CIFAR-10 and CIFAR-100 [16] with two types of label noise: symmetric and asymmetric. Symmetric noise is injected by randomly selecting a percentage of samples and changing their labels to random labels. Asymmetric noise is class-dependant, where labels are only changed to similar classes (e.g. dog $\leftrightarrow$ cat, deer $\rightarrow$ horse). We experiment with multiple noise ratios: sym $20\%$ , sym $50\%$ , and asym $40\%$ (see results for sym $80\%$ and $90\%$ in Table 7). Note that asymmetric noise ratio cannot exceed $50\%$ because certain classes would become theoretically indistinguishable. + +Implementation details. Same as previous works [1, 18], we use PreAct ResNet-18 [9] as our encoder model. We set the dimensionality of the bottleneck layer as $d = 50$ . Our model is trained using SGD with a momentum of 0.9, a weight decay of 0.0005, and a batch size of 128. The network is trained for 200 epochs. We set the initial learning rate as 0.02 and use a cosine decay schedule. We apply standard crop and horizontal flip as the weak augmentation. For strong augmentation, we use AugMix [12], though other methods (e.g. SimAug [4]) work equally well. For all CIFAR experiments, we fix the hyper-parameters as $\omega_{\mathrm{cc}} = 1$ , $\omega_{\mathrm{pc}} = 5$ , $\omega_{\mathrm{recon}} = 1$ , $\tau = 0.3$ , $\alpha = 8$ , $\eta_1 = 0.9$ . For CIFAR-10, we activate noise cleaning at epoch $t_0 = 5$ , and set $\eta_0 = 0.1$ (sym.) or 0.4 (asym.). For CIFAR-100, we activate noise cleaning at epoch $t_0 = 15$ , and set $\eta_0 = 0.02$ . We use faiss-gpu [15] for efficient knn search in the low-dimensional subspace, which finishes within 1 second. + +Results. Table 1 shows the comparison with existing methods. Our method outperforms previous methods across all label noise settings. On the more challenging CIFAR-100, we achieve $3 - 4\%$ accuracy improvement. + +In order to demonstrate the advantage of the proposed noise-robust representation learning method, we perform $k$ -nearest neighbor (knn) classification ( $k = 200$ ), which projects training and test images into normalized low-dimensional embeddings. Compared to the trained classifier, knn achieves higher accuracy, which verifies the robustness of the learned representation. + +
Dataset Noise typeCIFAR-10CIFAR-100
Sym 20%Sym 50%Asym 40%Sym 20%Sym 50%
Cross-Entropy [18]82.757.972.361.837.3
Forward [30]83.159.483.161.437.3
Co-teaching+ [42]88.284.1-64.145.3
Mixup [44]92.377.6-66.046.6
P-correction [41]92.088.788.168.156.4
MLNT [19]92.088.888.667.758.0
M-correction [1]93.891.986.373.465.4
DivideMix [18]95.093.791.474.872.1
ELR [23] (reproduced)94.7±0.193.5±0.291.7±0.975.3±0.271.3±0.3
DivideMix (reproduced)95.1±0.193.6±0.291.3±0.875.1±0.272.1±0.3
Ours (classifier)95.8±0.194.3±0.291.9±0.879.1±0.174.8±0.4
Ours (knn)95.9±0.194.5±0.192.4±0.979.4±0.175.0±0.4
+ +Table 1. Comparison with state-of-the-art methods on CIFAR datasets with label noise. Numbers indicate average test accuracy (\%) over last 10 epochs. We report results over 3 independent runs with randomly-generated label noise. Results for previous methods are copied from [1, 18]. We re-run DivideMix and ELR (without model ensemble) using the publicly available code on the same noisy data as ours. + +
Input noiseCEIterative [38]GCE [45]DivideMix [18]Ours (cls.)Ours (knn)
+CIFAR-100 20k53.687.287.389.091.593.1±0.3
+SVHN 20k58.188.688.891.993.393.9±0.2
Image corruption53.887.787.989.891.491.6±0.2
+ +Table 2. Comparison with state-of-the-art methods on CIFAR-10 dataset with label noise (50% symmetric) and input noise (OOD images or corrupted images). Numbers indicate average test accuracy (%) over last 10 epochs. We report results over 3 independent runs with randomly-generated noise. We re-run previous methods using publicly available code with the same data and model as ours. + +# 4.2. Experiments on controlled noisy labels with noisy images + +Dataset. We further corrupt a noisy-labeled (50% symmetric) CIFAR-10 dataset by injecting two types of input noise: out-of-distribution (OOD) images and input corruption. For OOD noise, we follow [38] and add $20k$ additional images from either one of the two other datasets: CIFAR-100 and SVHN [28], which enlarges the training set to $70k$ . A random CIFAR-10 label is assigned to each OOD image. For input corruption, we follow [10] and corrupt each image in CIFAR-10 with a noise randomly chosen from the following four types: Fog, Snow, Motion blur and Gaussian noise. Examples of both types of input noise are shown in Figure 4. For training, we follow the same implementation details as the CIFAR-10 experiments described in Section 4.1. + +Results. Table 2 shows the results. Our method consistently outperforms existing methods by a substantial margin. We observe that OOD images from a similar domain (CIFAR-100) are more harmful than OOD images from a more different domain (SVHN). This is because noisy images that are closer to the test data distribution are more likely to distort the decision boundary in a way that negatively affects test performance. Nevertheless, performing knn classification + +![](images/b27882898bc1b0b82ad80bb52d06da4d63f8e1d237f01cac8452ff92769a7692.jpg) +Figure 4. Examples of input noise injected to CIFAR-10. + +using the learned embeddings demonstrates high robustness to input noise. + +In Figure 5, we show the t-SNE [26] visualization of the low-dimensional embeddings for all training samples, including in-distribution CIFAR-10 images and out-distribution CIFAR-100 or SVHN images. As training progresses from epoch 10 to epoch 200, our model learns to separate OOD samples (represented as gray points) from in-distribution samples (represented as color points). It also learns to cluster CIFAR-10 images according to their true class, despite their noisy labels. Therefore, this visualization demonstrates that the proposed method learns representation that is robust to both label noise and OOD noise. + +![](images/ecf20d6048b42bf4c790e47bd865adc05b0c4cb0e49f956649c701c3e328f85f.jpg) +Figure 5. t-SNE visualization of low-dimensional embeddings for CIFAR-10 images (color represents the true class) + OOD images (gray points) from CIFAR-100 or SVHN. The model is trained on noisy CIFAR-10 (50k images with 50% label noise) and 20k OOD images with random labels. Our method can effectively learn to (1) cluster CIFAR-10 images according to their true class, despite their noisy labels; (2) separate OOD samples from in-distribution samples, such that their harm is reduced. + +![](images/79df126911434ce0799ba2952af867c067d6c6c92cb1dcdae924e6f8e4873662.jpg) + +![](images/fc30ce51cfdab19124b2eec98b410ba161a80c803d2b8a98ad69ab059ca263ea.jpg) + +![](images/286bda469e4fcaed71d6d99b83fbb62e587b73db98ffdd35fbcfb2e5ca199953.jpg) + +
CIFAR-10 Sym 50%+CIFAR-100 20k+Image CorruptionCIFAR-100 Sym 50%
w/o Lpc_mix85.9 (86.1)79.7 (81.5)81.6 (81.7)65.6 (65.9)
w/o Lcc93.7 (93.8)91.3 (91.5)89.4 (89.5)71.9 (71.8)
w/o Lrecon93.3 (94.0)90.7 (92.9)90.2 (91.0)73.2 (73.9)
w/o mixup89.5 (89.9)85.4 (87.0)84.7 (84.9)69.3 (69.7)
w/ standard aug.94.1 (94.3)90.8 (92.9)90.5 (90.7)74.5 (75.0)
DivideMix93.689.089.872.1
Ours94.3 (94.5)91.5 (93.1)91.4 (91.6)74.8 (75.0)
+ +Table 3. Effect of the proposed components. We show the accuracy of the classifier (knn) on four benchmarks with different noise. Note that DivideMix [18] also performs mixup. + +
bottleneck dimensiond=25d=50d=100d=200
CIFAR-10 Sym 50%93.494.394.293.7
CIFAR-100 Sym 50%73.874.874.473.8
+ +Table 4. Classifier's test accuracy (%) with different low-dimensions. + +# 4.3. Ablation study + +Effect of the proposed components. In Table 3, we study the effect of 5 components from the proposed method including (1) the weakly-supervised mixup prototypical contrastive loss $\mathcal{L}_{\mathrm{pc\_mix}}$ , (2) the unsupervised consistency contrastive loss $\mathcal{L}_{\mathrm{cc}}$ , (3) the reconstruction loss $\mathcal{L}_{\mathrm{recon}}$ , (4) mixup augmentation, and (5) strong data augmentation with AugMix. We remove each of these components and report the accuracy of the classifier and knn across four benchmarks. The result shows that $\mathcal{L}_{\mathrm{pc\_mix}}$ is most crucial to the model's performance. $\mathcal{L}_{\mathrm{cc}}$ has a stronger positive effect with image corruption or larger number of classes (CIFAR-100). Our method still achieves competitive performance when either the $\mathcal{L}_{\mathrm{cc}}$ or $\mathcal{L}_{\mathrm{recon}}$ is removed. When using standard data augmentation (random crop and horizontal flip) instead of AugMix, our method still achieves state-of-the-art result. + +Effect of bottleneck dimension. We vary the dimensionality of the bottleneck layer, $d$ , and examine the performance change in Table 4. Our model is in general not sensitive to + +the change of $d$ + +# 4.4. Experiments on real-world noisy data + +Dataset. Next, we verify our method on two real-word noisy datasets: WebVision [22] and Clothing1M [40]. Webvision contains images crawled from the web using the same concepts from ImageNet ILSVRC12 [5]. Following previous works [3, 18], we perform experiments on the first 50 classes of the Google image subset. Clothing1M consists of images collected from online shopping websites where labels were generated from surrounding texts. Note that we do not use the additional clean set for training. + +Implementation details. For WebVision, we follow previous works [3, 18] and use inception-resnet v2 [33] as the encoder. We train the model using SGD with a weight decay of 0.0001 and a batch size of 64. We train for 40 epochs with an initial learning rate of 0.04. The hyper-parameters are set as $d = 50$ , $\omega_{\mathrm{cc}} = 1$ , $\omega_{\mathrm{pc}} = 2$ , $\omega_{\mathrm{recon}} = 1$ , $\tau = 0.3$ , $\alpha = 0.5$ , $\eta_0 = 0.05$ , $\eta_1 = 0.8$ , $t_0 = 15$ . For Clothing1M, we + +
Test datasetWebVisionILSVRC12
Accuracy (%)top1top5top1top5
Forward [30]61.182.757.482.4
Decoupling [27]62.584.758.382.3
D2L [25]62.784.057.881.4
MentorNet [14]63.081.457.879.9
Co-teaching [6]63.685.261.584.7
INCV [3]65.285.361.085.0
ELR [23]76.391.368.787.8
DivideMix [18]75.990.173.389.2
Ours (w/o noise cleaning)75.590.272.090.0
Ours (classifier)76.391.573.391.2
Ours (knn)77.891.374.490.9
+ +Table 5. Comparison with state-of-the-art methods trained on WebVision (mini). Numbers denote accuracy (%) on the WebVision validation set and the ImageNet ILSVRC12 validation set. We report results for ELR and DivideMix without model ensemble. + +
MethodCEForwardJoint-OptELRMLNTMentorMixSLDivideMixOurs (cls.)Ours (knn)
Accuracy69.2169.8472.1672.8773.4774.3074.4574.4874.8474.97
+ +Table 6. Comparison with state-of-the-art methods on Clothing1M dataset. Results for previous methods are directly copied from corresponding papers. We report results for ELR and DivideMix without model ensemble. + +
DatasetCIFAR-10CIFAR-100
Noise typeSym.Asym.Sym.
Noise ratio20%50%80%90%40%20%50%80%90%
DivideMix [18] w/o ensemble95.093.792.474.291.474.872.157.629.2
DivideMix [18] w/ ensemble95.794.492.975.492.176.974.259.631.0
ELR+ [23] w/ ensemble95.694.693.176.192.077.174.059.931.3
Ours95.894.392.475.091.979.174.857.729.3
Ours w/ co-training96.194.892.876.392.479.875.358.931.5
Ours w/ co-training & ensemble96.495.393.377.492.680.376.061.133.1
+ +Table 7. Results of our proposed method with co-training and model ensemble. We report the average test accuracy over last 10 epochs. + +follow previous works [7, 18] and use ResNet-50 with ImageNet pretrained weights. We sample 1000 mini-batches as one epoch, and train the model for 50 epochs with an initial learning rate of 0.01. The hyper-parameters are set as $d = 32$ , $\omega_{\mathrm{cc}} = 1$ , $\omega_{\mathrm{pc}} = 1$ , $\omega_{\mathrm{recon}} = 1$ , $\tau = 0.3$ , $\alpha = 0.5$ , $\eta_0 = 0.4$ , $\eta_1 = 0.9$ , $t_0 = 1$ . Most of hyper-parameters are kept to be the same across datasets. + +Results. We report the results for WebVision in Table 5 and Clothing1M in Table 6. Our method achieves state-of-the-art performance on both datasets. The performance on WebVision is competitive even without noise cleaning, which shows the robustness of the learned representation. + +# 4.5. Co-training and model ensemble + +Co-training and model ensemble have been shown to be useful in combating label noise [6, 18, 23]. Therefore, we + +incorporate these two techniques by (1) simultaneously train two models that are randomly initialized and average their soft label $\pmb{q}_i^t$ to produce a new soft label, (2) use their ensemble prediction during test. The results on CIFAR datasets are shown in Table 7. + +# 5. Conclusion + +In this paper, we propose a new method for learning from noisy data by learning robust representation. We propose a noise-robust contrastive learning framework for representation learning, and a noise cleaning method based on nearest-neighbor constraints. Our method can address label noise, OOD noise, and image corruption. We demonstrate our model's state-of-the-art performance with extensive experiments on multiple noisy datasets. For future work, we plan to extend our framework to other domains. + +# References + +[1] Eric Arazo, Diego Ortego, Paul Albert, Noel E. O'Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. In ICML, pages 312-321, 2019. 1, 2, 3, 5, 6 +[2] Pierre Baldi and Kurt Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 2(1):53-58, 1989. 3 +[3] Pengfei Chen, Benben Liao, Guangyong Chen, and Shengyu Zhang. Understanding and utilizing deep neural networks trained with noisy labels. In ICML, pages 1062-1070, 2019. 2, 7, 8 +[4] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 2, 5 +[5] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009. 7 +[6] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor W. Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, pages 8536-8546, 2018. 1, 2, 8 +[7] Jiangfan Han, Ping Luo, and Xiaogang Wang. Deep self-learning from noisy labels. In ICCV, pages 5137-5146, 2019. 8 +[8] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019. 2 +[9] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, pages 630-645, 2016. 5 +[10] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In ICLR, 2019. 6 +[11] Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In NeurIPS, pages 10477-10486, 2018. 2 +[12] Dan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In ICLR, 2020. 5 +[13] Lu Jiang, Di Huang, Mason Liu, and Weilong Yang. Beyond synthetic noise: Deep learning on controlled noisy labels. In ICML, 2020. 2 +[14] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In ICML, pages 2309–2318, 2018. 2, 8 +[15] Jeff Johnson, Matthijs Douze, and Herve Jégou. Billion-scale similarity search with gpus. arXiv preprint arXiv:1702.08734, 2017. 5 + +[16] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Mater's thesis, University of Toronto, 2009. 5 +[17] Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. Cleannet: Transfer learning for scalable image classifier training with label noise. In CVPR, pages 5447-5456, 2018. 2 +[18] Junnan Li, Richard Socher, and Steven C.H. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In ICLR, 2020. 1, 2, 3, 5, 6, 7, 8 +[19] Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S. Kankanhalli. Learning to learn from noisy labeled data. In CVPR, pages 5051-5059, 2019. 6 +[20] Junnan Li, Caiming Xiong, and Steven C.H. Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2021. 2 +[21] Junnan Li, Pan Zhou, Caiming Xiong, and Steven C.H. Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2021. 2 +[22] Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data. arXiv:1708.02862, 2017. 1, 7 +[23] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. In NeurIPS, 2020. 1, 2, 6, 8 +[24] Yueming Lyu and Ivor W. Tsang. Curriculum loss: Robust learning and generalization against label corruption. In ICLR, 2020. 2 +[25] Xingjun Ma, Yisen Wang, Michael E. Houle, Shuo Zhou, Sarah M. Erfani, Shu-Tao Xia, Sudanthi N. R. Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In ICML, pages 3361-3370, 2018. 1, 2, 8 +[26] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9:2579-2605, 2008. 6 +[27] Eran Malach and Shai Shalev-Shwartz. Decoupling “when to update” from “how to update”. In NIPS, pages 960–970, 2017. 8 +[28] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS-WS, 2011. 6 +[29] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 2 +[30] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, pages 2233-2241, 2017. 6, 8 +[31] Scott E. Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. In ICLR, 2015. 1, 2 +[32] Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In ICML, pages 5739-5748, 2019. 1 +[33] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A. Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, pages 4278-4284, 2017. 7 + +[34] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, pages 5552-5560, 2018. 1, 2, 5 +[35] Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In NIPS, pages 5601-5610, 2017. 2 +[36] Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge J. Belongie. Learning from noisy large-scale datasets with minimal supervision. In CVPR, pages 6575-6583, 2017. 2 +[37] Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. J. Mach. Learn. Res., 11:3371-3408, 2010. 3 +[38] Yisen Wang, Weiyang Liu, Xingjun Ma, James Bailey, Hongyuan Zha, Le Song, and Shu-Tao Xia. Iterative learning with open-set noisy labels. In CVPR, pages 8688-8696, 2018. 2, 6 +[39] Zhirong Wu, Yuanjun Xiong, Stella X. Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, pages 3733-3742, 2018. 2 +[40] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In CVPR, pages 2691-2699, 2015. 2, 7 +[41] Kun Yi and Jianxin Wu. Probabilistic end-to-end noise correction for learning with noisy labels. In CVPR, 2019. 1, 2, 6 +[42] Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor W. Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In ICML, pages 7164-7173, 2019. 1, 6 +[43] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017. 1 +[44] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. 1, 2, 3, 6 +[45] Zhilu Zhang and Mert R. Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, pages 8792-8802, 2018. 6 \ No newline at end of file diff --git a/learningfromnoisydatawithrobustrepresentationlearning/images.zip b/learningfromnoisydatawithrobustrepresentationlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1550d5907bd23b442cb3ef0707e34e25afb597d0 --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cad86dc5366d9a39bf32204976d06ed3d1b94684fbb9c0de7193f6194722904f +size 633354 diff --git a/learningfromnoisydatawithrobustrepresentationlearning/layout.json b/learningfromnoisydatawithrobustrepresentationlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b1afaa1e9be91e2e71d85a14c81bbd08d47b20f4 --- /dev/null +++ b/learningfromnoisydatawithrobustrepresentationlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cef80aa5505364eaab72a9906b94aec9c8152baa803db42314c31f1de913b13a +size 442379 diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_content_list.json b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7cdcfb4c1c8d51d90bd207f891f07c58fa435d28 --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a2b1fc8f2f75d33e5d769461370bccff94873dbb3b59979c7252006fada5ac4 +size 84373 diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_model.json b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4d6f2a9db3a19f4a497ee69aff82424076794c3a --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c44e43f87edc3451047ab638f4c676e9b03ea49eacfe003b6d5c7a2ea8731d6 +size 101230 diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_origin.pdf b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7ec9cb1017db05d03d564735d21c1bd865150e32 --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/24c9b2d9-f622-4f65-a937-c9aa7de83590_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a80e0f795c09ccb45f1ba2872be90719a86212a621c6dbe4d67d8cbe2cbdd14 +size 4293464 diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/full.md b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a22cadbb0b1df6399eba99e3109ffe52892b26d7 --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/full.md @@ -0,0 +1,288 @@ +# Learning Generative Models of Textured 3D Meshes from Real-World Images + +Dario Pavllo + +Jonas Kohler + +Thomas Hofmann + +Aurelien Lucchi + +# Department of Computer Science ETH Zurich + +![](images/c208a54c78f6c0d3b7b77ac8d8f7e63f120b74948cf131be81d509d764ea934c.jpg) + +![](images/30ef03819d482897618d9a7adeca2aab7c4cd138ddd78f55a6182ead098e80d2.jpg) +Figure 1. Left: we focus on GANs, where our generator outputs a triangle mesh and a UV-mapped texture. Middle: our method learns to synthesize textured 3D meshes given a real-world collection of 2D images. Top-right: we showcase a setting where we train a single model to generate all classes. This model successfully disentangles some factors of the 3D environment (e.g. lighting/shadows) without explicit supervision. Bottom-right: we also demonstrate a conditional model that generates meshes from 3D semantic layouts. + +![](images/de40f4098bb41b1c9f2600ecfd516868905196f536b701442fd9b4b2cd5f7eeb.jpg) + +![](images/2eb7f7119792339402b253f633bc0fe4af3b98b4f0e1e8375ff6d70352092eb6.jpg) + +![](images/a85ec5fb9d401011a22ee2e42e4d5b742fbea25e7ce6cff091d1a809d6c31449.jpg) + +![](images/c892464c02644b56af0b71b714655994b82f145ff4c0f8ca2c8b7b14217d34f6.jpg) + +![](images/6c90e299744fa0f0b520d24c45eef69a699634c9ea2f7bcfa0ffe6fc738fbbbd.jpg) + +![](images/e70cf427c885d73f76425d17b049d7dfe72bd94d818478476a5ded41d3a4c22a.jpg) + +![](images/f8f9cae44f9adfeae3ccd2fa7d1714e78ff062b710755b40fc168c1a80a50028.jpg) +Latent dimension for "light intensity" + +![](images/00a2d2f4a55784f87738ce46c3cb99750c8e2653621333759d09c43ee0b5d7e5.jpg) + +![](images/307def3bd885c6b9843d2ba3ebd4bd3e2271a1752f79306dfae9cad7b1652054.jpg) + +# Abstract + +Recent advances in differentiable rendering have sparked an interest in learning generative models of textured 3D meshes from image collections. These models natively disentangle pose and appearance, enable downstream applications in computer graphics, and improve the ability of generative models to understand the concept of image formation. Although there has been prior work on learning such models from collections of 2D images, these approaches require a delicate pose estimation step that exploits annotated keypoints, thereby restricting their applicability to a few specific datasets. In this work, we propose a GAN framework for generating textured triangle meshes without relying on such annotations. We show that the performance of our approach is on par with prior work that relies on ground-truth keypoints, and more importantly, we demonstrate the generality of our method by setting new baselines on a larger set of categories from ImageNet – for which keypoints are not available – without any class-specific hyperparameter tuning. We release our code at + +https://github.com/dariopavllo/textured-3d-gan + +# 1. Introduction + +Most of the recent literature in the field of generative models focuses on 2D image generation [36, 54, 22, 3, 23], which largely ignores the fact that real-world images depict 2D projections of 3D objects. Constructing 3D generative models presents multiple advantages, including a fully disentangled control over shape, appearance, pose, as well as an explicit representation of spatial phenomena such as occlusions. While the controllability aspect of 2D generative models can be improved to some extent by disentangling factors of variation during the generation process [53, 40, 21, 22], the assumptions made by these approaches have been shown to be unrealistic without an inductive bias [33]. It is thus unclear whether 2D architectures can reach the same degree of controllability as a native 3D representation. + +As a result, a growing line of research investigates learning textured 3D mesh generators in both GAN [39, 4] and variational settings [15]. These approaches are trained with 2D supervision from a collection of 2D images, but require camera poses to be known in advance as learning a joint distribution over shapes, textures, and cameras is particularly difficult. Usually, the required camera poses are estimated from keypoint annotations using a factorization algorithm + +such as structure-from-motion (SfM) [35]. These keypoint annotations are, however, very expensive to obtain and are usually only available on a few datasets. + +In this work, we propose a new approach for learning generative models of textured triangle meshes with minimal data assumptions. Most notably, we do not require keypoint annotations, which are often not available in real-world datasets. Instead, we solely rely on: (i) a single mesh template (optionally, a set of templates) for each image category, which is used to bootstrap the pose estimation process, and (ii) a pretrained semi-supervised object detector, which we modify to infer semantic part segmentations on 2D images. These, in turn, are used to augment the initial mesh templates with a 3D semantic layout that allows us to refine pose estimates and resolve potential ambiguities. + +First, we evaluate our approach on benchmark datasets for this task (Pascal3D+ [31] and CUB [45]), for which keypoints are available, and show that our approach is quantitatively on par with the state-of-the-art [39] as demonstrated by FID metrics [16], even though we do not use keypoints. Secondly, we train a 3D generative model on a larger set of categories from ImageNet [6], where we set new baselines without any class-specific hyperparameter tuning. To our knowledge, no prior works have so far succeeded in training textured mesh generators on real-world datasets, as they focus either on synthetic data or on simple datasets where poses/ keypoints are available. We also show that we can learn a single generator for all classes (as opposed to different models for each class, as done in previous work [39, 4, 15]) and notice the emergence of interesting disentanglement properties (e.g. color, lighting, style), similar to what is observed on large-scale 2D image generators [3]. + +Finally, we quantitatively evaluate the pose estimation performance of our method under varying assumptions (one or more mesh templates; with or without semantic information), and showcase a proof-of-concept where 3D meshes are generated from sketches of semantic maps (semantic mesh generation), following the paradigm of image-to-image translation. In summary, our main contributions are as follows: + +- We introduce a new approach to 3D mesh generation that does not require keypoint annotations, enabling its use on a wider range of datasets as well as new image categories. +- We showcase 3D generative models in novel settings, including learning a single 3D generator for all categories, and conditional generation from semantic mesh layouts. In addition, we provide a preliminary analysis of the disentanglement properties learned by these models. +- We propose a comprehensive 3D pose estimation framework that combines the merits of template-based approaches and semantic-based approaches. We further extend this framework by explicitly resolving pose ambiguities and by adding support to multiple templates. + +# 2. Related work + +Differentiable 3D representations. Recent work in 3D deep learning has focused on a variety of 3D representations. Among reconstruction approaches, where the goal is to reconstruct 3D meshes from various input representations, [37] predict signed distance fields from point clouds, [5, 12, 51, 9, 56, 47, 42] predict 3D meshes from images using a voxel representation, and [7] predict point clouds from images. These approaches require some form of 3D supervision, which is only achievable through synthetic datasets. More recent efforts have therefore focused on reconstructing meshes using 2D supervision from multiple views, e.g. [50, 11, 44, 46, 43, 52] in the voxel setting, and [19] using point clouds. However, the multiple-viewpoint assumption is unrealistic on real-world collections of natural images, which has motivated a new class of methods that aim to reconstruct 3D meshes from single-view images. Among recent works, [24, 32, 20, 4, 10, 29] are all based on this setting and adopt a triangle mesh representation. Our work also focuses on triangle meshes due to their convenient properties: (i) their widespread use in computer graphics, movies, video games; (ii) their support for UV texture mapping, which decouples shape and color; (iii) the ability of efficiently manipulating and transforming vertices via linear algebra. The use of triangle meshes in deep learning was recently enabled by differentiable renderers [34, 24, 32, 4], i.e. renderers that provide gradients w.r.t. scene parameters. Motivated by its support for UV maps, we use DIB-R [4] as our renderer of choice throughout this work. + +Keypoint-free pose estimation. The use of keypoints for pose estimation is limiting due to the lack of publicly available data and an expensive annotation process. Thus, a growing line of research focuses on inferring poses via semi-supervised objectives. To our knowledge, no approach has so far focused on generation, but there have been some successful attempts in the reconstruction literature. The initial pose estimation step of our framework is most closely related to [10, 29], which both propose approaches for 3D mesh reconstruction without keypoints. In terms of assumptions, [10] require a canonical mesh template for each category. Object poses are estimated by fitting the mesh template to the silhouette of the object and by concurrently optimizing multiple camera hypotheses (which helps to deal with the large amount of bad local minima). [29] do not require a mesh template, but instead use object part segmentations from a self-supervised model (SCOPS [18]) to infer a 3D semantic template that is matched to the reference segmented image. Based on early experiments, we were unable to individually generalize these methods to generation (our goal), which we found to have a lower tolerance to errors due to the intrinsic difficulty in training GANs. Instead, we here successfully combine both ideas (mesh templates and semantics) and extend the overall framework with $(i)$ the + +optional support for multiple mesh templates, $(ii)$ a principled ambiguity resolution step that leverages part semantics to resolve conflicts among camera hypotheses with similar reprojection errors. We additionally adopt a more general object-part segmentation framework. Namely, we use a pre-trained semi-supervised object detector [17] modified to produce fine-grained semantic templates (Fig. 2), as opposed to SCOPS (used in [29]), which we found to require class-specific hyperparameter tuning. + +Mesh generation. In the generation literature there has been work on voxel representations [48, 9, 41, 49, 55, 2] and point clouds [1, 8]. These approaches require 3D supervision from synthetic data and are thus subject to the same limitations mentioned earlier. To our knowledge, the only approaches that tackle this task on a triangle mesh setting using exclusively 2D supervision are [15], which focuses on a VAE setting using face colors (as opposed to full texture mapping) and is thus complementary to our work, and [4, 39], which adopts a GAN setting. In particular, [4] represents the earliest attempt in generating textured 3D meshes using GANs, but their approach cannot supervise textures directly from image pixels. By contrast, the more recent [39] proposes a more comprehensive framework that can model both meshes and UV-mapped textures, which allows for successful application to natural images (albeit with keypoint annotations). We build upon [39], from which we borrow the GAN architecture but substantially rework the supervision strategy to relax the keypoint requirement. + +# 3. Method + +Data requirements. As usual in both the reconstruction [24, 20, 10, 29] and generation [14, 4, 39] literature, we require a dataset of segmented images. Segmentation masks (a.k.a. silhouettes) can easily be obtained through an off-the-shelf model (we use PointRend [26] pretrained on COCO [30]; details in Appendix A.1). Whereas prior approaches require keypoint annotations for every image, we only require an untextured mesh template for each image category, which can be downloaded freely from the web. Optionally, our framework supports multiple mesh templates per category, a choice we explicitly evaluate in sec. 4.2. We note that pose estimation from silhouettes alone can in some cases be ambiguous, and therefore we rely on object part semantics to resolve these ambiguities wherever possible. To this end, we use the semi-supervised, large-vocabulary object detector from [17, 38] to infer part segmentations on all images. We adopt their pretrained model as-is, without further training or fine-tuning, but post-process its output as described in Appendix A.1. + +Dataset preparation. Since our goal is to apply our method to real-world data that has not been manually cleaned or annotated – unlike the commonly-used datasets CUB [45] and Pascal3D+ [31] – we attempt to automatically detect + +![](images/317abf59c1d7f15579ef4f6ac737b6761464086cf15876f6a8f78bdcfee7eb09.jpg) +Figure 2. The dataset is initially processed into a clean collection of images with associated object masks and semantic part segmentations. This is done via off-the-shelf models and does not involve any additional data collection. Semantic classes have a precise meaning and are shared between different categories (e.g. wheels appear in both cars and motorbikes). + +and remove images that do not satisfy some quality criteria. In particular, objects should not be $(i)$ too small, $(ii)$ truncated, or $(iii)$ occluded by other objects (implementation details in Appendix A.1). This filtering step is tuned for high precision and low recall, as we empirically found that it is beneficial to give more importance to the former. All our experiments and evaluations (sec. 4) are performed on the dataset that results from this step. Finally, sample images and corresponding silhouettes/part segmentations can be seen in Fig. 2, which also highlights how some semantic parts are shared across image categories. + +# 3.1. Pose estimation framework + +Overview. Most reconstruction and generation approaches require some form of pose estimation to initialize the learning process. Jointly learning a distribution over camera poses and shapes/textures is extremely challenging and might return a trivial solution that does not entail any 3D reasoning. Therefore, our approach also requires a pose estimation step in order to allow the learning process to converge to meaningful solutions. Our proposed pose estimation pipeline is summarized in Fig. 3: starting from a set of randomly-initialized camera hypotheses for each object instance, we render the mesh template(s) using a differentiable renderer and optimize the camera parameters so that the rendered silhouette matches the target silhouette of the object. At this point, no semantics, colors, or textures are involved, so the approach can lead to naturally ambiguous poses (see Fig. 3 right, for an example). We then introduce a novel ambiguity detection step to select only images whose inferred pose is unambiguous, and use the most confident ones to infer a 3D semantic template, effectively augmenting the initial mesh templates with semantic information (more examples of such templates can be seen in Fig. 5). Afterwards, the process is repeated – this time leveraging semantic information – to resolve ambiguities and possibly reinstate images that were previously discarded. The final + +![](images/0a3a65644ead9da134c0c27db16e5f8dc9ddddff8b9f74cd22e26b1375280f52.jpg) +Figure 3. Left: schematic overview of the proposed pose estimation pipeline. The left side shows our data requirements (a collection of 2D images and one or more textured mesh templates). For clarity, we only show the optimization process for the circled airplane, although the semantic template inference step involves multiple instances. Right: ambiguity arising from opposite poses. The two camera hypotheses produce almost-identical silhouettes which closely approximate the target, but describe opposite viewpoints. This particular example would initially be rejected by our ambiguity detection test, but it would then be resolved once semantics are available. + +![](images/919a18334579be79b8b499274b598f03264ebf0292b50c735690bb4c6b844b8e.jpg) + +output is a camera pose for each object as well as a confidence score that can be used to trade off recall (number of available images) for precision (similarity to ground-truth poses). In the following, we describe each step in detail. + +Silhouette optimization. The first step is a fitting procedure applied separately to each image. Following [10], who observe that optimizing multiple camera hypotheses with differing initializations is necessary to avoid local minima, we initialize a set of $N_{c}$ camera hypotheses for each image as described in Appendix A.1. Our camera projection model is the augmented weak-perspective model of [39], which comprises a rotation $\mathbf{q} \in \mathbb{R}^4$ (a unit quaternion), a scale $s \in \mathbb{R}$ , a screen-space translation $\mathbf{t} \in \mathbb{R}^2$ , and a perspective correction term $z_0 \in \mathbb{R}$ which is used to approximate perspective distortion for close objects. We minimize the mean squared error (MSE) in pixel space between the rendered silhouette $\mathcal{R}(\cdot)$ and the target silhouette $\mathbf{x}$ : + +$$ +\min _ {\mathbf {q}, \mathbf {t}, s, z _ {0}} \| \mathcal {R} \left(\mathbf {V} _ {\mathrm {t p l}}, \mathbf {F} _ {\mathrm {t p l}}; \mathbf {q}, \mathbf {t}, s, z _ {0}\right) - \mathbf {x} \| ^ {2}, \tag {1} +$$ + +where $\mathcal{R}$ is the differentiable rendering operation, $\mathbf{V}_{\mathrm{tpl}}$ represents the (fixed) mesh template vertices, and $\mathbf{F}_{\mathrm{tpl}}$ represents the mesh faces. Each camera hypothesis is optimized using a variant of Adam [25] that implements full-matrix preconditioning as opposed to a diagonal one. Given the small number of learnable parameters (8 for each hypothesis), the $\mathcal{O}(n^3)$ cost of inverting the preconditioning matrix is negligible compared to the convergence speed-up. We provide hyperparameters and more details about this choice in the Appendix A.1. In the settings where we use multiple mesh templates $N_{t}$ , we simply replicate each initial camera hypothesis $N_{t}$ times so that the total number of hypotheses to optimize is $N_{c} \cdot N_{t}$ . In this case, we compensate for the increase in optimization time by periodically pruning the worst camera hypotheses during optimization. Additionally, in all settings, we start by rendering at a low image resolution and progressively increase the resolution over time, which further speeds up the process. We describe how both strategies are implemented in the Appendix A.1. + +Scoring and ambiguity detection. All symmetric objects (i.e. many natural and man-made objects) present ambigu- + +ous poses: opposite viewpoints that produce the same sil- houette after 2D projection (Fig. 3 right). Similar ambiguities can also arise as a result of noisy segmentation masks, inappropriate mesh templates, or camera hypotheses that converge to bad local minima. Since wrong pose estimates have a significant negative impact on the rest of the pipeline, this motivates the design of an ambiguity detection step. Ideally, we would like to accept pose estimates that are both confident - using the intersection-over-union (IoU) between the rendered/target silhouettes as a proxy measure - and unambiguous, i.e. no two camera hypotheses with high IoU should describe significantly different poses. We formalize this as follows: we first score each hypothesis $k$ as $(\mathbf{v}_{\mathrm{conf}})_k = (\mathrm{softmax}(\mathbf{v}_{\mathrm{IoU}} / \tau))_k$ , where $\tau = 0.01$ is a temperature coefficient that gives similar weights to IoU values that are close to the maximum, and low weights to IoU values that are significantly lower than the maximum. Next, we require that highly-confident poses (as measured by $\mathbf{v}_{\mathrm{conf}}$ ) should describe similar rotations. We therefore construct a pairwise distance matrix $\mathbf{D}$ of shape $N_{c} \times N_{c}$ , where each entry $d_{ij}$ describes the geodesic distance between the rotation of the $i$ -th hypothesis and the rotation of the $j$ -th hypothesis. Entries are then weighted by $\mathbf{v}_{\mathrm{conf}}$ across both rows and columns, and are finally summed up, yielding a scalar agreement score $v_{\mathrm{agr}}$ for each image: + +$$ +\mathbf {D} = 1 - \left(\mathbf {Q} ^ {T} \mathbf {Q}\right) ^ {\circ 2}, \quad v _ {\mathrm {a g r}} = \left\| \mathbf {D} \odot \left(\mathbf {v} _ {\text {c o n f}} \mathbf {v} _ {\text {c o n f}} ^ {T}\right) \right\| _ {1} \tag {2} +$$ + +where $\mathbf{Q}$ is a $4\times N_{c}$ matrix of unit quaternions (one per hypothesis), $\mathbf{M}^{\circ 2}$ denotes the element-wise square, and $\odot$ denotes the element-wise product. + +The agreement score $v_{\mathrm{agr}}$ can be roughly interpreted as follows: a score of 0 (best) implies that all confident camera hypotheses describe the same rotation (they agree with each other). A score of 0.5 describes two poses that are rotated by 180 degrees from one another1. Empirically, we established that images with $v_{\mathrm{agr}} > 0.3$ should be rejected. + +Semantic template inference. Simply discarding ambiguous images might significantly reduce the size and diver + +sity of the training set. Instead, we propose to resolve the ambiguous cases. While this is hardly possible when we only have access to silhouettes, it becomes almost trivial once semantics are available (Fig. 3 right). A similar idea was proposed in [29], who infer a 3D semantic template by averaging instances that are close to a predetermined exemplar (usually an object observed from the left or right side). Yet, our formulation does not require an exemplar but directly leverages samples that have passed the ambiguity detection test. Since our data requirements assume that mesh templates are untextured, our first step in this regard aims at augmenting each mesh template with part semantics. Among images that have passed the ambiguity test $(v_{\mathrm{agr}} < 0.3)$ , we select the camera hypothesis with the highest IoU. For each mesh template, the semantic template is computed using the top $N_{\mathrm{top}} = 100$ images assigned to that template, as measured by the IoU. Then, we frame this step as an optimization problem where the goal is to learn vertex colors while keeping the camera poses fixed, minimizing the MSE between the rendered (colored) mesh template and the 2D image semantics, averaged among the top samples: + +$$ +\min _ {\mathbf {C} _ {\mathrm {t p l}}} \frac {1}{N _ {\mathrm {t o p}}} \sum_ {i} \| \mathcal {R} (\mathbf {V} _ {\mathrm {t p l}}, \mathbf {F} _ {\mathrm {t p l}}, \mathbf {C} _ {\mathrm {t p l}}; \mathbf {q} _ {\mathrm {i}}, \mathbf {t} _ {\mathrm {i}}, s _ {i}, z _ {0 i}) - \mathbf {C} _ {\mathrm {i}} \| ^ {2}, \tag {3} +$$ + +where $\mathbf{C}_{\mathrm{tpl}}$ represents the vertex colors of the template and $\mathbf{C_i}$ denotes the 2D semantic image. For convenience, we represent $\mathbf{C}_{\mathrm{tpl}}$ as a $K\times N_{v}$ matrix, where $N_{v}$ is the number of vertices and $K$ is the number of semantic classes (color channels, not necessarily limited to 3), and $\mathbf{C_i}$ is a $K\times N_{pix}$ matrix, where $N_{pix}$ is the number of image pixels. In the Appendix A.1, we derive an efficient closed-form solution that requires only a single pass through the dataset. Examples of the resulting semantic templates are shown in Fig. 5. + +Ambiguity resolution. In the last step of our pose estimation pipeline, we repeat the scoring process described in "Scoring and ambiguity detection" with the purpose of resolving ambiguities. Instead of evaluating the scores on the IoU, however, we use the mean intersection-over-union (mIoU) averaged across semantic classes. Since our inferred semantic templates are continuous, we adopt a smooth generalization of the mIoU (weighted Jaccard similarity) in place of the discrete version: + +$$ +\mathrm {m I o U} = \frac {1}{K} \sum_ {k} \frac {\left\| \min \left(\hat {\mathbf {C}} _ {\mathbf {k}} , \mathbf {C} _ {\mathbf {k}}\right) \right\| _ {1}}{\left\| \max \left(\hat {\mathbf {C}} _ {\mathbf {k}} , \mathbf {C} _ {\mathbf {k}}\right) \right\| _ {1}} \tag {4} +$$ + +where $\hat{\mathbf{C}}_{\mathbf{k}}$ is the rendered semantic class $k$ and min, max (performed element-wise) represent the weighted intersection and union, respectively. We then recompute the confidence scores and agreement scores as before (using the mIoU as a target metric), discard the worst $10\%$ images in terms of mIoU as well as those whose $v_{\mathrm{agr}} > 0.3$ , and select the best hypothesis for each image as measured by the mIoU. We found no practical advantage in repeating the semantic template inference another time, nor in re + +![](images/f8f984eb4a410727a77e0b02061812b8ec3e37f84052b71dbd674f099ee3199c.jpg) +Figure 4. Generation framework using the convolutional mesh representation. Images are fed into a network trained to reconstruct meshes (parameterized as 2D displacement maps), given camera poses. The meshes are then used to project natural images onto the UV map. Finally, the resulting partial textures, displacement maps, and (optionally) predicted semantics are used to train a 2D convolutional GAN in UV space. + +optimizing/fine-tuning the camera poses using semantics. We show this quantitatively in sec. 4.2 and discuss further details on various exploratory attempts in Appendix A.4. + +# 3.2. Generation framework + +The camera poses obtained using the approach described in sec. 3.1 can be used to train a generative model as shown in Fig. 4. For this component, we build upon [39], from which we borrow the convolutional mesh representation and the GAN architecture. Our generation approach mainly consists of three steps. (i) Given a collection of images, segmentation masks, and their poses $^2$ , we train a reconstruction model to predict mesh, texture, and semantics given only the 2D image as input. Although predicted textures are not used in subsequent steps (the GAN learns directly from image pixels), [39] observe that predicting textures during training has a beneficial regularizing effect on the mesh, and therefore we also keep this reconstruction term. Unlike [39] (where semantics were not available), however, we also predict a 3D semantic part segmentation in UV space, which provides further regularization and enables interesting conditional generation settings (we showcase this in sec. 4.2). As in [39], we parameterize the mesh as a 2D displacement map that deforms a sphere template in its tangent space. (ii) Through an inverse rendering approach, image pixels are projected onto the UV map of the mesh, yielding partially occluded textures. Occlusions are represented as a binary mask in UV space. (iii) Finally, displacement maps and textures are modeled in UV space using a standard 2D convolutional GAN, whose training strategy compensates for occlusions by masking inputs to the discriminator. + +Architecture. Our experiments (sec. 4) analyze two different settings: A where we train a separate model for each category, and B where we train a single model for all cat- + +![](images/a6a60b77541ea69cb36ec7ff3d1ba5b9ea5ed7229638f47defa15c7b57a2a575.jpg) +Figure 5. Learned 3D semantic templates. We show one template per category from two views (front/back). Colors are exaggerated for presentation purposes, but in practice the probability maps are smoother. We also highlight how semantic parts are shared among categories. + +egories. In setting $\mathbf{A}$ , we reuse similar reconstruction and GAN architectures to [39] in order to establish a fair comparison with their approach. We only modify the output head of the reconstruction model, where we add $K$ extra output channels for the semantic class prediction ( $K$ depends on the category). In setting $\mathbf{B}$ , we condition the model on the object category by modifying all BatchNorm layers and learning different gain and bias parameters for each category. Additionally, in the output head we share semantic classes among categories (for instance there is a unique output channel for wheel that is shared for buses, trucks, etc.; see Fig. 5). We do not make any other change that would affect the model's capacity. As for the GAN, in both $\mathbf{A}$ and $\mathbf{B}$ , we use the same architecture as [39]. Further details regarding hyperparameters, implementation and optimizations to improve rendering speed can be found in Appendix A.1. + +Loss. The reconstruction model is trained to jointly minimize the MSE between $(i)$ rendered and target silhouettes, $(ii)$ predicted RGB texture and target 2D image, $(iii)$ predicted semantic texture (with $K$ channels) and target 2D semantic image. As in [39], we add a smoothness loss to encourage neighboring faces to have similar normals. Finally, the availability of mesh templates allows us to incorporate a strong shape prior into the model via a loss term that can be regarded as an extreme form of semi-supervision: on images with very confident poses (high IoU), we provide supervision directly on the predicted 3D vertices by adding a MSE loss between the latter and the vertices of the mesh template (i.e. our surrogate ground-truth), only on the top $10\%$ of images as measured by the IoU. This speeds up convergence and helps with modeling fine details such as wings of airplanes, where silhouettes alone provide a weak learning signal from certain views. This step requires remeshing the templates to align them to a common topology, which we describe in Appendix A.1. + +# 4. Experiments + +We quantitatively evaluate the aspects that are most central to our approach: pose estimation and generation quality. Pose estimation. On datasets where annotated keypoints are available, we compare the poses estimated by our + +approach to poses estimated from structure-from-motion (SfM) on ground-truth keypoints. Since the robustness of SfM depends on the number of visible keypoints, we never refer to SfM poses as "ground-truth poses", as these are not available in the real-world datasets we use. Nonetheless, we believe that SfM poses serve as a good approximation of ground-truth poses on most images. Our evaluation metrics comprise (i) the geodesic distance (GD) between the rotation $\mathbf{q}$ predicted by our approach and the SfM rotation $\mathbf{p}$ , defined as $\mathrm{GD} = 1 - (\mathbf{p} \cdot \mathbf{q})^2$ for quaternions, where $\mathrm{GD} \in [0,1]^3$ ; and (ii) the recall, which measures the fraction of usable images that have passed the ambiguity detection test. We evaluate pose estimation at different stages: after silhouette optimization (where no semantics are involved), and after the semantic template inference. Additionally, we compare settings where only one mesh template per category is available, and where multiple mesh templates are employed (we use 2-4 templates per category). + +Generative modeling. Following prior work on textured 3D mesh generation with GANs [39], we evaluate the Fréchet Inception Distance (FID) [16] on meshes rendered from random viewpoints. For consistency, our implementation of this metric follows that of [39]. Since our pose estimation framework discards ambiguous images and the FID is sensitive to the number of evaluated images, we always use the full dataset for computing reference statistics. As such, there is an incentive for optimizing both $GD$ and recall metrics as opposed to trading one off for the other. Finally, consistently with [39], we generate displacement maps at $32 \times 32$ resolution, textures at $512 \times 512$ , and sample from the generator using a truncated Gaussian at $\sigma = 1.0$ . + +# 4.1. Datasets + +We evaluate our approach on three datasets: CUB-200-2011 (CUB) [45], Pascal3D+ (P3D) [31], and a variety of classes from ImageNet [6]. The first two provide keypoint annotations and serve as a comparison to previous work, whereas on the latter we set new baselines. Combining all + +![](images/2b3b6a3c56f2569d67e3d45d8f2cf95a9446d402418ad81310b3821fe1cb3bdd.jpg) +Figure 6. Qualitative results for all 13 classes used in our work. For each class, we show one wireframe mesh on the left, the corresponding textured mesh on the right, and two additional textured meshes on the second row. Meshes are rendered from random viewpoints. + +![](images/22e71ef8489daaced4e0878413a7558414a40959d4e3480e9ce504be82f63fd1.jpg) + +![](images/3e86f793177fa473b9637ba444fac71591811483bb972aee6ac0604d8cc0a3b1.jpg) + +![](images/dbcb9dcc9cfca9c23fac770463d0a6a24343b813335fd760c0c835a8618d04f5.jpg) + +![](images/01d06ca8b4f1af7da1572718534096bc3cb3c618ee61b2aa392fe9332d759b4f.jpg) + +![](images/881121b56f6d6636f41df0ad25d7718a550d67eb6fc575a4cb1023c94cb2d5fb.jpg) + +![](images/cf4efde48dc20c1a9fded9d9762ee28449bf7feceab01e9d7a52d7efcf29f4ea.jpg) + +
SettingStepBirdCarAirplane
GD(1)GD (Recall)GD(1)GD (Recall)GD(1)GD (Recall)
Single templateSilhouette0.470.35 (52%)0.120.05 (75%)0.310.28 (85%)
Semantics0.290.24 (74%)0.110.06 (84%)0.250.18 (78%)
Repeat x20.290.24 (76%)0.150.11 (85%)0.240.17 (75%)
Multiple templatesSilhouette0.470.33 (44%)0.100.05 (78%)0.280.22 (81%)
Semantics0.320.27 (76%)0.060.04 (88%)0.220.15 (79%)
Repeat x20.320.27 (78%)0.070.05 (89%)0.210.16 (80%)
+ +Table 1. Pose estimation results under different settings. Best in bold; second best underlined. We report geodesic distance (GD; lower = better) after each step and associated recall (higher = better) arising from ambiguity detection. For comparison, we also report GD w/o ambiguity detection, GD(1), assuming $100\%$ recall. + +datasets, we evaluate our approach on 13 categories. + +CUB (Birds). For consistency with prior work, we adopt the split of [39, 20] ( $\approx$ 6k training images). As we work in the unconditional setting, we do not use class labels. + +Pascal3D+ (P3D). Again, we adopt the split of [39, 20], and test our approach on both car and airplane categories. Since [39] has only tested on cars, we train the model of [39] on airplanes and provide a comparison here. P3D comprises a subset of images from ImageNet and [39] evaluates only on this subset; for consistency, we adopt the same strategy. + +ImageNet. Our final selection of classes comprises the vehicles and animals that can be seen in Fig. 5/6. The list of synsets used in each class as well as summary statistics are provided in the Appendix A.3. The set of ImageNet classes includes car and airplane, which partially overlap with P3D. Therefore, when we mention these two classes, we always specify the subset we refer to (ImageNet or P3D). We also note that the dataset is heavily imbalanced, ranging from $\approx 300$ usable images for giraffe to thousands of images for car. For this reason, in setting B we take measures to balance the dataset during training (Appendix A.1). + +# 4.2. Results + +Pose estimation. We evaluate our pose estimation framework on bird, car, and airplane, for which we have keypoint annotations. Reference poses are obtained using the SfM implementation of [20]. For birds (CUB), the scores are computed on all images, whereas for cars/airplanes they are computed on the overlapping images between P3D and + +our ImageNet subset. Results are summarized in Table 1. Interestingly, using multiple mesh templates does not seem to yield substantially different results, suggesting that our approach can work effectively with as little as one template per class. Moreover, incorporating semantic information improves both GD and recall. Finally, we repeat the ambiguity detection and semantic template inference steps a second time, but observe no improvement. Therefore, in our following experiments we only perform these steps once. We further discuss these results in Appendix A.2, where we aim to understand the most common failure modes by analyzing the full distribution of rotation errors. Qualitatively, the inferred 3D semantic templates can be found in Fig. 5. + +Generative model. We report the FID on ImageNet in Table 2, left (bird refers to CUB), where we set new baselines. As before, we compare settings where we adopt a single mesh template vs multiple templates. We also showcase a conditional model that learns to synthesize all categories using a single generator (setting $\mathbf{B}$ ). Although this model has the same capacity as the individual models (but was trained to generate all classes at once), we note that its scores are in line with those of setting $\mathbf{A}$ , and in some classes (e.g. + +![](images/a7367829dfddf75bfa6096b3b28d89aeca4f67287ecfbbb21e9e84dc472cafa4.jpg) +Figure 7. Disentanglement and interpolation in the model trained to generate all classes (setting B). Top: directions in latent space that correlate with certain style factors, such as skin color and lighting. The effect is consistent across different classes. Bottom: interpolation between different classes with a fixed latent code. + +
SettingMBikeBusTruckCarAirplaneBirdSheepElephantZebraHorseCowBearGiraffeAll
Single TPL (A)107.4219.3164.130.7377.8455.75173.7114.528.19113.3137.0187.1157.7-
Multi TPL (A)107.0160.7206.132.19102.256.54155.1135.922.10107.1133.0195.5126.0-
Single TPL (B)94.74204.98179.339.6846.4688.47169.9127.624.47106.9139.4156.4176.860.82
Multi TPL (B)94.03187.75204.746.1177.2777.23163.8146.231.70113.4117.5189.9158.063.00
+ +
MethodBird (CUB)Car (P3D)Airplane (P3D)
Keypoints+SfM [39]41.5643.09147.8*
Silhouette (single TPL)73.6738.16100.5
Silhouette (multi TPL)88.3936.1796.28
Semantics (single TPL)55.7536.5281.28
Semantics (multi TPL)56.5437.5688.85
+ +Table 2. Left: FID of our approach on ImageNet (except bird, which refers to CUB). We report results for models trained separately on different classes (setting A) and a single model that generates all classes (setting B). Right: comparison of our FID w.r.t. prior work, using either silhouettes alone or our full pipeline. * = trained by us; TPL = mesh template(s); lower = better, best in bold, second best underlined. + +airplane) they are significantly better, most likely due to a beneficial regularizing effect. However, we also note that there is no clear winner on all categories. To our knowledge, no prior work has trained a single 3D generator on multiple categories without some form of supervision from synthetic data. Therefore, in one of the following paragraphs we analyze this model from a disentanglement perspective. Next, in Table 2 (right), we compare our results to the state-of-the-art [39] on the bird, car, and airplane categories from CUB/P3D. We find that our approach outperforms [39] on car and airplane (P3D) – even though we do not exploit ground-truth keypoints – and performs slightly worse on bird (CUB). We speculate this is mainly due to the fact that, on CUB, all keypoints are annotated (including occluded ones), whereas P3D only comprises annotations for visible keypoints, potentially reducing the effectiveness of SfM as a pose estimation method. Finally, we point out that although there is a large variability among the scores across classes, comparing FIDs only makes sense within the same class, since the metric is affected by the number of images. + +Qualitative results. In addition to those presented in Fig. 1, we show further qualitative results in Fig. 6. For animals, we observe that generated textures are generally accurate (e.g. the high-frequency details of zebra stripes are modeled correctly), with occasional failures to model facial details. With regards to shape, legs are sporadically merged but also appear correct on many examples. We believe these issues are mostly due to a pose misalignment, as animals are deformable but our mesh templates are rigid. As part of future work, we would like to add support for articulated mesh templates [28] to our method. As for vehicles, the generated shapes are overall faithful to what one would expect, especially on airplanes where modeling wings is very challenging. We also note, however, that the textures of rare classes (truck above all) present some incoherent details. Since we generally observe that the categories with more data are also those with the best results, these issues could in principle be mitigated by adding more images. Finally, we show additional qualitative results in the Appendix A.2. + +Disentanglement and interpolation. We attempt to interpret the latent space of the model trained to synthesize all classes (setting $\mathbf{B}$ ), following [13]. We identify some directions in the latent space that correlate with characteristics of the 3D scene, including light intensity (Fig. 1, top-right), specular reflections and color (Fig. 7). Importantly, these factors seem to be shared across different classes and are + +![](images/9899e7f233ff45dd9c3a8197283a4b17d0ec3252e33dd6c8507bb07d5bf0a8c4.jpg) +Figure 8. Conditional mesh generation from semantic layouts. In this demo, we progressively build a car by sketching its parts, proposing an interesting way of controlling the generation process. + +![](images/2e1d995d8ee67380f4b0de0af473ab45a653446681a1458cf2ca8cadd63a0386.jpg) + +learned without explicit supervision. Although our analysis is preliminary, our findings suggest that 3D GANs disentangle high-level features in an interpretable fashion, similar to what is observed in 2D GANs to some extent (e.g. on pose and style). However, since 3D representations already disentangle appearance and pose, the focus of the disentangled features is on other aspects such as texture and lighting. Fig. 7 (bottom) illustrates interpolation between different classes while keeping the latent code fixed. Style is preserved and there are no observable artifacts, suggesting that the latent space is structured. + +Semantic mesh generation. Since our framework predicts a 3D semantic layout for each image, we can condition the generator on such a representation. In Fig. 8, we propose a proof-of-concept where we train a conditional model on the car class that takes as input a semantic layout in UV space and produces a textured mesh. Such a setting can be used to manipulate fine details (e.g. the shape of the headlights) or the placement of semantic parts. + +# 5. Conclusion + +We proposed a framework for learning generative models of textured 3D meshes. In contrast to prior work, our approach does not require keypoint annotations, enabling its use on real-world datasets. We demonstrated that our method matches the results of prior works that use groundtruth keypoints, without having to rely on such information. Furthermore, we set new baselines on a subset of categories from ImageNet [6], where keypoints are not available. We believe there are still many directions of interest to pursue as future work. In addition to further analyzing disentanglement and exploring more intuitive semantic generation techniques, it would be interesting to experiment with articulated meshes and work with more data. + +Acknowledgments. This work was partly supported by the Swiss National Science Foundation (SNF), grant #176004. + +# References + +[1] Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas Guibas. Learning representations and generative models for 3d point clouds. In International Conference on Machine Learning, pages 40-49, 2018. 3 +[2] Elena Balashova, Vivek Singh, Jiangping Wang, Brian Teixeira, Terrence Chen, and Thomas Funkhouser. Structure-aware shape synthesis. In 2018 International Conference on 3D Vision (3DV), pages 140-149. IEEE, 2018. 3 +[3] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations (ICLR), 2019. 1, 2 +[4] Wenzheng Chen, Huan Ling, Jun Gao, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3d objects with an interpolation-based differentiable renderer. In Neural Information Processing Systems, pages 9605-9616, 2019. 1, 2, 3, 16 +[5] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In European conference on computer vision, pages 628-644. Springer, 2016. 2 +[6] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248-255. IEEE, 2009. 2, 6, 8 +[7] Haoqiang Fan, Hao Su, and Leonidas J Guibas. 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, pages 605-613, 2017. 2 +[8] Matheus Gadelha, Rui Wang, and Subhransu Maji. Multiresolution tree networks for 3d point cloud processing. In Proceedings of the European Conference on Computer Vision (ECCV), pages 103-118, 2018. 3 +[9] Rohit Girdhar, David F Fouhey, Mikel Rodriguez, and Abhinav Gupta. Learning a predictable and generative vector representation for objects. In European Conference on Computer Vision, pages 484-499. Springer, 2016. 2, 3 +[10] Shubham Goel, Angjoo Kanazawa, and Jitendra Malik. Shape and viewpoint without keypoints. In European Conference on Computer Vision, pages 88-104. Springer, 2020. 2, 3, 4, 14 +[11] JunYoung Gwak, Christopher B Choy, Manmohan Chandraker, Animesh Garg, and Silvio Savarese. Weakly supervised 3d reconstruction with adversarial constraint. In 2017 International Conference on 3D Vision (3DV), pages 263-272. IEEE, 2017. 2 +[12] Christian Hane, Shubham Tulsiani, and Jitendra Malik. Hierarchical surface prediction for 3d object reconstruction. In 2017 International Conference on 3D Vision (3DV), pages 412-420. IEEE, 2017. 2 +[13] Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering interpretable gan controls. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Bal + +can, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 9841-9850, 2020. 8 +[14] Paul Henderson and Vittorio Ferrari. Learning single-image 3d reconstruction by generative modelling of shape, pose and shading. International Journal of Computer Vision, pages 1-20, 2019. 3 +[15] Paul Henderson, Vagia Tsiminaki, and Christoph H Lampert. Leveraging 2d data to learn textured 3d mesh generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. 1, 2, 3 +[16] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Neural Information Processing Systems, pages 6626-6637, 2017. 2, 6 +[17] Ronghang Hu, Piotr Dólar, Kaiming He, Trevor Darrell, and Ross Girshick. Learning to segment every thing. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4233-4241, 2018. 3, 12 +[18] Wei-Chih Hung, Varun Jampani, Sifei Liu, Pavlo Molchanov, Ming-Hsuan Yang, and Jan Kautz. Scops: Self-supervised co-part segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 869-878, 2019. 2, 12 +[19] Eldar Insafutdinov and Alexey Dosovitskiy. Unsupervised learning of shape and pose with differentiable point clouds. In Advances in Neural Information Processing Systems, pages 2802-2812, 2018. 2 +[20] Angjoo Kanazawa, Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Learning category-specific mesh reconstruction from image collections. In European Conference on Computer Vision (ECCV), 2018. 2, 3, 7, 14 +[21] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In International Conference on Learning Representations (ICLR), 2018. 1 +[22] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4401-4410, 2019. 1 +[23] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8110-8119, 2020. 1 +[24] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3D mesh renderer. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3907-3916, 2018. 2, 3 +[25] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representions (ICLR), 2014. 4, 13, 14 +[26] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9799-9808, 2020. 3, 12 + +[27] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Li Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision (IJCV), 123(1):32-73, 2017. 12 +[28] Nilesh Kulkarni, Abhinav Gupta, David F Fouhey, and Shubham Tulsiani. Articulation-aware canonical surface mapping. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 452-461, 2020. 8, 12 +[29] Xueting Li, Sifei Liu, Kihwan Kim, Shalini De Mello, Varun Jampani, Ming-Hsuan Yang, and Jan Kautz. Self-supervised single-view 3d reconstruction via semantic consistency. In European Conference on Computer Vision, pages 677-693. Springer, 2020. 2, 3, 5, 14 +[30] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dálár, and C Lawrence Zitnick. Microsoft COCO: common objects in context. In European Conference on Computer Vision (ECCV), pages 740-755. Springer, 2014. 3, 12 +[31] Hsueh-Ti Derek Liu, Michael Tao, Chun-Liang Li, Derek Nowrouzezahrai, and Alec Jacobson. Beyond pixel normballs: Parametric adversaries using an analytically differentiable renderer. International Conference on Learning Representations, 2019. 2, 3, 6 +[32] Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft rasterizer: A differentiable renderer for image-based 3d reasoning. In IEEE International Conference on Computer Vision (ICCV), pages 7708-7717, 2019. 2, 16 +[33] Francesco Locatello, Stefan Bauer, Mario Lucic, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In International Conference on Machine Learning (ICML), 2019. 1 +[34] Matthew M Loper and Michael J Black. Opendra: An approximate differentiable renderer. In European Conference on Computer Vision (ECCV), pages 154-169. Springer, 2014. 2 +[35] Manuel Marques and João Costeira. Estimating 3d shape from degenerate sequences with missing data. Computer Vision and Image Understanding, 113(2):261-272, 2009. 2 +[36] Takeru Miyato and Masanori Koyama. cGANs with projection discriminator. In International Conference on Learning Representations (ICLR), 2018. 1 +[37] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. DeepSDF: Learning continuous signed distance functions for shape representation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 165-174, 2019. 2 +[38] Dario Pavllo, Aurelien Lucchi, and Thomas Hofmann. Controlling style and semantics in weakly-supervised image generation. In European Conference on Computer Vision (ECCV), 2020. 3, 12 +[39] Dario Pavllo, Graham Spinks, Thomas Hofmann, Marie-Francine Moens, and Aurélien Lucchi. Convolutional generation of textured 3d meshes. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 1, 2, 3, 4, 5, 6, 7, 8, 14 + +[40] Krishna Kumar Singh, Utkarsh Ojha, and Yong Jae Lee. FineGAN: Unsupervised hierarchical disentanglement for fine-grained object generation and discovery. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1 +[41] Edward J Smith and David Meger. Improved adversarial systems for 3d object generation and reconstruction. In Conference on Robot Learning, pages 87–96, 2017. 3 +[42] Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Octree generating networks: Efficient convolutional architectures for high-resolution 3d outputs. In Proceedings of the IEEE International Conference on Computer Vision, pages 2088-2096, 2017. 2 +[43] Shubham Tulsiani, Alexei A Efros, and Jitendra Malik. Multi-view consistency as supervisory signal for learning shape and pose prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2897-2905, 2018. 2 +[44] Shubham Tulsiani, Tinghui Zhou, Alexei A Efros, and Jitendra Malik. Multi-view supervision for single-view reconstruction via differentiable ray consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2626-2634, 2017. 2 +[45] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. 2, 3, 6 +[46] Olivia Wiles and Andrew Zisserman. Silnet: Single- and multi-view reconstruction by learning from silhouettes. In Gabriel Brostow Tae-Kyun Kim, Stefanos Zafeiriou and Krystian Mikolajczyk, editors, Proceedings of the British Machine Vision Conference (BMVC), pages 99.1–99.13. BMVA Press, September 2017. 2 +[47] Jiajun Wu, Yifan Wang, Tianfan Xue, Xingyuan Sun, Bill Freeman, and Josh Tenenbaum. Marrnet: 3d shape reconstruction via 2.5d sketches. In Neural Information Processing Systems, pages 540-550, 2017. 2 +[48] Jiajun Wu, Chengkai Zhang, Tianfan Xue, Bill Freeman, and Josh Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. In Advances in Neural Information Processing Systems, pages 82–90, 2016. 3 +[49] Jianwen Xie, Zilong Zheng, Ruiqi Gao, Wenguan Wang, Song-Chun Zhu, and Ying Nian Wu. Learning descriptor networks for 3d shape synthesis and analysis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8629-8638, 2018. 3 +[50] Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective transformer nets: Learning single-view 3d object reconstruction without 3d supervision. In Advances in Neural Information Processing Systems, pages 1696-1704, 2016. 2 +[51] Bo Yang, Hongkai Wen, Sen Wang, Ronald Clark, Andrew Markham, and Niki Trigoni. 3d object reconstruction from a single depth view with adversarial learning. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 679-688, 2017. 2 + +[52] Guandao Yang, Yin Cui, Serge Belongie, and Bharath Hariharan. Learning single-view 3d reconstruction with limited pose supervision. In Proceedings of the European Conference on Computer Vision (ECCV), pages 86-101, 2018. 2 +[53] Jianwei Yang, Anitha Kannan, Dhruv Batra, and Devi Parikh. LR-GAN: layered recursive generative adversarial networks for image generation. In International Conference on Learning Representations (ICLR), 2017. 1 +[54] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International Conference on Machine Learning (ICML), 2019. 1 +[55] Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jiajun Wu, Antonio Torralba, Josh Tenenbaum, and Bill Freeman. Visual object networks: Image generation with disentangled 3d representations. In Neural Information Processing Systems, pages 118-129, 2018. 3 +[56] Rui Zhu, Hamed Kiani Galoogahi, Chaoyang Wang, and Simon Lucey. Rethinking reprojection: Closing the loop for pose-aware shape reconstruction from a single image. In Proceedings of the IEEE International Conference on Computer Vision, pages 57-65, 2017. 2 \ No newline at end of file diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/images.zip b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4a2db2081f0f9c401a2b37c88ed6ebbe9fe59146 --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1fc365929ae90231647eecdc5eacd4ebfa9f60020cd55663dd627fbf70d22a6 +size 601893 diff --git a/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/layout.json b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cc9d6b9e85e49e08292b328982a89ad42c37c9d2 --- /dev/null +++ b/learninggenerativemodelsoftextured3dmeshesfromrealworldimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:681319a08fbcc399b56cc8d34a272e442d16d037cc08bb6c034bea2a85441b1a +size 381275 diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_content_list.json b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9daabce4f4de1cddc6df16112fb33dd4379c61b2 --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9154ff467d5f00ad25b8fad1cf69245d2d5f63571e7cb6ad09a6a502a9d32a20 +size 88105 diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_model.json b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_model.json new file mode 100644 index 0000000000000000000000000000000000000000..49ba649f8e31f412e58508993b0bea5cc341dd07 --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a59230b56e14fb4d4f346acd9ca08d379f23c8c4a231ad87a4aecc70fed61f85 +size 108437 diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_origin.pdf b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8c9643ecc1ca3b7c193cb20ed296b30165ce6c7b --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/d2b8f92b-ae76-453c-9760-f21d7b2f7762_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4442b8b43156daca544c80b3a2385d85f664416eec39bb538a0aee184a88454c +size 469702 diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/full.md b/learninghierarchicalgraphneuralnetworksforimageclustering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..344659f2fb72eea3ffe8d4ed17358b91339107b6 --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/full.md @@ -0,0 +1,343 @@ +# Learning Hierarchical Graph Neural Networks for Image Clustering + +Yifan Xing* Wei Xia + +Tong He* David Wipf + +Tianjun Xiao f + +Yongxin Wang Zheng Zhang + +Yuanjun Xiong Stefano Soatto + +# Amazon Web Services + +{yifax,htong,tianjux,yongxinw,yuanjx,wxia,daviwipf,zhaz,soattos}@amazon.com + +# Abstract + +We propose a hierarchical graph neural network (GNN) model that learns how to cluster a set of images into an unknown number of identities using a training set of images annotated with labels belonging to a disjoint set of identities. Our hierarchical GNN uses a novel approach to merge connected components predicted at each level of the hierarchy to form a new graph at the next level. Unlike fully unsupervised hierarchical clustering, the choice of grouping and complexity criteria stems naturally from supervision in the training set. The resulting method, Hi-LANDER, achieves an average of $49\%$ improvement in F-score and $7\%$ increase in Normalized Mutual Information (NMI) relative to current GNN-based clustering algorithms. Additionally, state-of-the-art GNN-based methods rely on separate models to predict linkage probabilities and node densities as intermediate steps of the clustering process. In contrast, our unified framework achieves a three-fold decrease in computational cost. Our training and inference code are released1. + +# 1. Introduction + +Clustering is a pillar of unsupervised learning. It consists of grouping data points according to a manually specified criterion. Without any supervision, the problem is self-referential, with the outcome being defined by the choice of grouping criterion. Different criteria yield different solutions, with no independent validation mechanism. Even within a given criterion, clustering typically yields multiple solutions depending on a complexity measure, and a separate model selection criterion is introduced to arrive at a unique solution. A large branch of unsupervised clustering methods follow the hierarchical/agglomerative framework [41, 42, 44], which gives a tree of cluster partitions with varying granularity of the data, but they still require a model + +selection criterion for the final single grouping. Rather than engineering the complexity and grouping criteria, we wish to learn them from data.2 Clearly, this is not the data we wish to cluster, for we do not have any annotations for them. Instead, it is a different set of training data, the metatraining set, for which cluster labels are given, corresponding to identities that are disjoint from those expected in the test set. For example, the test set might be an untagged collection of photos by a particular user, for which there exists a true set of discrete identities that we wish to discover, say their family members. While those family members have never been seen before, the system has access to different photo collections, tagged with different identities, during training. Our goal is to leverage the latter labeled training set to learn how to cluster different test sets with unknown numbers of different identities. This is closely related to "open-set" or "open universe" classification [40, 26]. + +We present the first hierarchical/agglomerative clustering method using Graph Neural Networks (GNNs). GNNs are a natural tool for learning how to cluster [51, 57, 56], as they provide a way of predicting the connectivity of a graph using training data. In our case, the graph describes the connectivity among test data, with connected components ultimately determining the clusters. + +Our hierarchical GNN uses a novel approach to merge connected components predicted at each level of the hierarchy to form a new graph at the next level. We employ a GNN to predict connectivity at each level, and iterate until convergence. While in unsupervised agglomerative clustering convergence occurs when all clusters are merged to a single node [42, 44], or when an arbitrary threshold of an arbitrary model complexity criterion is reached, in our case convergence is driven by the training set, and occurs when no more edges are added to the graph by the GNN. There is no need to define an arbitrary model selection criterion. Instead, the "natural granularity" of the clustering + +process is determined inductively, by the ground truth in the training set. Unlike prior clustering work using GNNs [51, 57, 56], we perform full-graph inference to jointly predict two attributes: linkage probabilities at the edges, and densities at the nodes, defined as the proportion of similar vertices that share the same label within a node's neighborhood [14, 3, 56]. The densities establish a relative order between nodes [3, 56], which is then used to guide the connectivity. Nodes at the boundary between two ground-truth clusters, or nodes having a majority of their neighbors belonging to different classes, tend to have a low density, and accordingly a low expectation of linkage probability to their neighbors. Prior methods predict the edge connectivity as a node attribute on numerous sampled sub-graphs [51, 56]; ours directly infers the full graph and predicts connectivity as an attribute of the edges. Also, prior methods require separate models for the two attributes of linkage probabilities and node densities, whereas ours infers them jointly. This is beneficial as there is strong correlation between the two attributes, defined by the ground truth. A joint model also achieves superior efficiency, which enables hierarchical inference that would otherwise be intractable. Compared to the two separate models, we achieve a speedup from 256s to 36s as shown in Table 1. + +In terms of accuracy, Our method achieves an average $49\%$ improvement in F-score, from 0.390 to 0.585, and an average $7\%$ increase in NMI, from 0.778 to 0.836 compared to state-of-art GNN based clustering methods [56, 51] over the face and species clustering benchmarks as shown in Table 3. Furthermore, the pseudo-labels generated by our clustering of unlabeled data can be used as a regularization mechanism to reduce face verification error by $14\%$ , as shown in Table 4, from 0.187 to 0.159 in compared to state-of-art clustering methods, allowing us to approach the performance of fully supervised training at 0.136. + +In the next section, we summarize our contributions in the context of prior related work. In Section 3 we introduce the technical innovations of our paper, and in Section 4 we detail our experiment results. We discuss failure modes and limitations of our method in Section 5. + +# 2. Related Work and Contributions + +Unsupervised Visual Clustering Traditional unsupervised clustering algorithms utilize the notion of similarity between objects, such as K-means [27] and hierarchical agglomerative methods [32, 41, 37]. [5] extends Hierarchical Agglomerative Clustering (HAC) [41] with a distance based on node pair sampling probability. Approaches based on persistent-homology [61] and singular perturbation theory [33] deal with the scale-selection issue. [14, 3, 8] utilize a notion of density defined as the proportion of similar nodes within a neighborhood. Spectral clustering methods [33, 17, 47] approximate graph-cuts with a low-dimensional + +embedding of the affinity matrix via eigen-decomposition. Graclus [13] provides an alternative to spectral clustering with multi-level weighted graph cuts. H-DBSCAN [8] removes the distance threshold tuning in [14]. FINCH [39] proposes a first neighbor heuristic and generates a hierarchy of clusters. More recent unsupervised methods [23, 24] utilize deep CNN features. [60] proposes a Rank-Order distance measurement. Our hierarchical design relates the most to [39], however, instead of the heuristic to link the first-neighbor of each node for edge selection, which is prone to error and has limited capability in dealing with large-scale complex cluster structures, we use a learnable GNN model. + +Supervised Visual Clustering Supervised graph neural network-based approaches [51, 57, 59, 57, 56] perform clustering on a $k$ -NN graph. In contrast to these methods that produce only a single partition, our method generates a hierarchy of cluster partitions and deals with unseen complex cluster structures with a learnt convergence criterion from the natural granularity of the "meta-training" set. In contrast to [56] which requires two separate models to perform edge connectivity and node density estimation, our method jointly predicts these two quantities with a single model of higher accuracy and efficiency (Table 1). Furthermore, [51, 56] estimate linkage as a node attribute on sub-sampled graphs, whereas we estimate it as an edge attribute with natural parallelization through full-graph inference and significantly reduce runtime (Table 5). [1] uses a two-step process that first refines visual embeddings with a GNN and then runs a top-down divisive clustering, with testing limited to small datasets. In contrast, our method performs clustering as a graph edge selection procedure. + +Hierarchical Representation Hierarchical structures have also been extensively studied in many visual recognition tasks [34, 21, 28, 53, 29, 15, 31, 22]. In this paper, our hierarchy is formed by multiple $k$ -NN graphs recurrently built with clustering and node aggregation, which are learnt from the meta-training set. Hierarchical representation has also been explored in the graph representation learning literature [58, 9, 4, 19, 18, 25]. There, the focus is to learn a stronger feature representation to classify graph [58] or input nodes [18] into a closed set of class labels. Whereas, our goal is to "learn" to cluster from a meta-training set whose classes are disjoint to those of test-time. + +Graph Neural Networks in Visual Understanding The expressive power of GNNs in dealing with complex graph structures is shown to benefit many visual learning tasks [20, 16, 10, 50, 45, 12, 54, 55, 11, 6, 52]. [16] samples and aggregates embeddings of neighboring nodes. [45] further advances [16] with additive attention. [10] uses a batch training scheme based on [16] to reduce computational cost. [50] performs node classification with edge convolution and feature aggregation through max-pooling. Our method dif + +![](images/8791c975593559e6e7be33d4e5f7203b9dbbc06065f010b4c948ef1d64f5d3df.jpg) +Figure 1. The proposed hierarchical clustering framework Hi-LANDER. Images are embedded into a $k$ -NN graph with their visual features. The green, yellow and blue image boundaries illustrate that they belong to three different classes; same for the color of the graph nodes. At each level of the hierarchy, our base LANDER model outputs a set of selected edges and thus intermediate clusters. These clusters are then grouped into super-nodes as input for the next level. The process continues til convergence, i.e., when no more edges are added to the graph. Weights of LANDER are shared across multiple levels of the hierarchy. Best viewed in color. + +fers from [50] in that we use a unified model that jointly learns node densities and edge linkages with two supervision signals. Furthermore, our GNN learns the edge selection and convergence criteria for a hierarchical agglomerative process. + +Contributions We propose the first hierarchical structure in GNN-based clustering. Our method, partly inspired by [39], refines the graph into super-nodes formed by sub-clusters and recurrently runs the clustering on the supernode graphs, but differs in that we use a learnt GNN to predict sub-clusters at each recurrent step instead of an arbitrary manual grouping criterion. At convergence, we trace back the predicted cluster labels on the super-nodes from the top-level graph to the original data points to obtain the final cluster. + +Our method converges to a cluster based on the level of granularity established by ground truth labels in the training set. Although the identities are different from the test set, they are sufficient to implicitly define a complexity criterion for the clustering at inference time, without the need for a separate model selection criterion. + +To run multiple iterations of the GNN model efficiently and effectively, we design a base model that approximates label-aware linkage probabilities and densities of similar nodes that share the same label. The densities are useful for additional regularization and refining edge selection. We refer to this base model as our Link Approximation aNd Density Estimation Refinement (LANDER) module. Finally, we denote our hierarchical clustering method Hi-LANDER and Figure 1 illustrates its structure. + +The key innovation of our method is two-fold: 1) we produce a hierarchy of cluster partitions instead of a single flat partition of [57, 51, 56]; 2) We perform full-graph inference to jointly predict attributes of both nodes and edges, whereas prior GNN methods used sub-graph infer + +ence and separate models for node and edge attribute prediction. These innovations are collectively responsible for improving the clustering performance by an average of $49\%$ F-score and $7\%$ NMI over existing GNN-based methods. + +# 3. Methodology + +# 3.1. Clustering with a $k$ -NN Graph + +Formally, given a set of $N$ images $D = \{I_i\}_{i=1}^N$ and their corresponding visual embeddings $F = \{f_i\}_{i=1}^N$ , we first construct an affinity graph $G = \{V,E\}$ , where $|V| = N$ , via $k$ -nearest neighbors determined w.r.t. cosine similarity, i.e., the inner-product of the normalized visual embeddings. Each image (for example one face crop) entails one object to cluster and represents a node in the graph, with the node feature being its visual embedding $f_i$ . The edges connect each node to its $k$ neighbors. Per the clustering paradigms in [14, 8, 3, 39, 51, 56, 35], a function $\phi$ takes as input the affinity graph $G$ and the node features $F$ , and produces an edge subset $E' \subset E$ , i.e. $E' = \phi(G,F)$ . The resulting graph $G' = \{V,E'\}$ is then split into connected components, with each corresponding to a cluster of nodes. Our method is built upon this $k$ -NN graph based clustering paradigm. + +# 3.2. Hierarchical Generalization to Hi-LANDER + +In order to model the natural level of granularity of clusters in a dataset, we propose a hierarchical generalization to the above single-level $k$ -NN based clustering paradigm. Given a set of initial visual embeddings $F$ and a small fixed value of $k$ ,3 we iteratively generate a sequence of graphs $G_{l} = \{V_{l}, E_{l}\}$ and the corresponding node features $H_{l} = \{h_{i}\}$ , where $i = 1 \dots |V_{l}|$ and $l = 1 \dots$ , using a + +base cluster function $\phi$ and an aggregation function $\psi$ . Algorithm 1 summarizes the proposed hierarchical generalization process. + +To start, we define $G_{1}$ as the $G$ in Section 3.1 and $H_{1} = \{f_{i}\}$ . The function $\phi$ performs the following operation + +$$ +E _ {l} ^ {\prime} = \phi \left(G _ {l}, H _ {l}\right), \tag {1} +$$ + +taking as input the node features and $k$ -NN graph at level $l$ and producing the selected edge subsets $E_{l}^{\prime}$ . As a result, the graph $G_{l}^{\prime} = \{V_{l},E_{l}^{\prime}\}$ is split into multiple connected components. We define the set of connected components in $G_{l}^{\prime}$ as $\{c_i^{(l)}\}_{i = 1}^{|V_{l + 1}|}$ , where $c_{i}^{(l)}$ is the $i$ -th element. + +In order to generate $G_{l + 1}$ , we obtain $V_{l + 1}$ , $H_{l + 1}$ and $E_{l + 1}$ as follows. First, we define the $i$ -th node in $G_{l + 1}$ , $v_{i}^{(l + 1)}$ , as an entity representing the connected component $c_{i}^{(l)}$ . Next, we generate the new node feature vectors through an aggregation function $\psi$ , which performs + +$$ +H _ {l + 1} = \psi \left(H _ {l}, G _ {l} ^ {\prime}\right), \tag {2} +$$ + +It aggregates the node features in each connected component $c_{i}^{(l)}$ into a single feature vector respectively. Finally, we obtain $E_{l + 1}$ by searching for $k$ -nearest-neighbors on $H_{l + 1}$ and connecting each node to its $k$ neighbors. + +The generation converges when no more new edges are added, i.e., $E_{l}^{\prime} = \emptyset$ . We define $L$ to be the length of the converged sequence. For the final cluster assignment, starting with $G_{L}$ , we assign cluster identity (ID) $i$ to the connected component $c_{i}^{(L)}$ , which propagates the ID $i$ to all its nodes $\{v_{j}^{(L)}|v_{j}^{(L)}\in c_{i}^{(L)}\}$ . Then, each $v_{i}^{(L)}$ propagates its label to the corresponding connected component $c_{i}^{(L - 1)}$ of the previous iteration. This ID propagation process eventually assigns a cluster ID to every node in $V_{1}$ , and this assignment is used as the final predicted clustering. + +In the following sections, we describe the design of the base cluster function $\phi$ , the aggregation function $\psi$ and how we learn the overall Hi-LANDER model with a metatraining set. We refer LANDER to our underlying single-level model, akin to a single iteration of Hi-LANDER. + +# 3.3. Realizing the Cluster Function $\phi$ + +To achieve high accuracy, we design $\phi$ as a learnable GNN model for clustering in a supervised setting to deal with complex cluster structures, where each node $v_{i}$ in $V$ comes with a cluster label $y_{i}$ , but only in the meta-training set. Unlike unsupervised clustering methods, we do not engineer an explicit grouping criterion but learn it from data. State-of-art supervised clustering methods [51, 56] show that density and linkage information are effective supervision signal to learn the GNN model and we use both of them. However, unlike prior work, to improve both efficiency and accuracy, we jointly predict these two quantities + +Algorithm 1: Hi-LANDER Clustering +Input $N,F,k$ $l\gets 1$ $H_{1}\leftarrow F$ +while not converged do + $G_{l}\gets k$ -nearest-neighbor $(H_l,k)$ . $E_l^{\prime}\gets \phi (G_l,H_l)$ //LANDER $G_{l}^{\prime}\gets$ connected-components $(E_l^{\prime})$ . $H_{l + 1}\gets \psi (H_l,G_l^{\prime})$ . $l\gets l + 1$ +end +ID $\leftarrow$ id-propagation({ $G_{l}\}$ , $\{G_l^{\prime}\}$ ); +Return ID + +using the embeddings produced by a single graph encoder. The linkage and density estimates are then passed through a graph decoding step for determining edge connectivity and thus cluster prediction. Below details our LANDER design. + +Graph Encoding For each node $v_{i}$ with corresponding input feature $h_{i}$ , a stack of Graph Attention Network (GAT) [45] layers encode each $h_{i}$ as the new feature or embedding $h_{i}'$ . In general though, we found that alternative encoders (e.g., vanilla graph convolutional network layers), produce similar performance (see supplementary). + +Joint prediction for density and linkage For each edge $(v_{i}, v_{j})$ in $E$ , we concatenate the source and destination node features obtained from the encoder as $[h_{i}', h_{j}']$ , where $[\cdot, \cdot]$ is the concatenation operator. Then, we feed it into a Multi Layer Perceptron (MLP) layer followed by a softmax transformation to produce the linkage probabilities $p_{ij} = P(y_{i} = y_{j})$ , i.e., an estimate of the probability that this edge is linking two nodes sharing the same label. We also use this value to predict a node pseudo-density estimate $\hat{d}_{i}$ , which measures the similarity-weighted proportion of same-class nodes in its neighborhood. + +For this purpose, we first quantify the similarity $a_{ij}$ between nodes $v_{i}$ and $v_{j}$ as the inner product of their respective node features, i.e., $a_{ij} = \langle h_i,h_j\rangle$ . Subsequently, we compute corresponding edge coefficients as $\hat{e}_{ij}$ as + +$$ +\hat {e} _ {i j} = P \left(y _ {i} = y _ {j}\right) - P \left(y _ {i} \neq y _ {j}\right) \tag {3} +$$ + +where $j$ indexes the $k$ nearest neighbors of $v_{i}$ . We may then define $\hat{d}_i$ as + +$$ +\hat {d} _ {i} = \frac {1}{k} \sum_ {j = 1} ^ {k} \hat {e} _ {i j} \cdot a _ {i j}. \tag {4} +$$ + +This estimator is designed to approximate the ground-truth pseudo-density $d_{i}$ , which is obtained by simply replacing $\hat{e}_{ij}$ in Eq. 4 with $e_{ij} = \mathbb{1}(y_i = y_j) - \mathbb{1}(y_i \neq y_j)$ using + +the ground-truth class labels, where $\mathbb{1}$ is the indicator function. By construction, $d_{i}$ is large whenever the most similar neighbors have shared labels; otherwise, it is small. And importantly, by approximating $d_{i}$ in terms of $\hat{e}_{ij}$ via $p_{ij}$ , the resulting joint prediction mechanism reduces parameters for the prediction head during training (see Section 3.5 below), allowing the two tasks to benefit from one another. + +Graph Decoding Once we obtain the linkage probabilities and node density estimates, we convert them into final clusters via the following decoding process. Prior methods rely on an analogous decoding step [3, 56]; however, herein we tailor this process to incorporate our joint density and linkage estimates. Initially we start with $E' = \emptyset$ . Given $\hat{e}_{ij}$ , $\hat{d}_i$ , $p_{ij}$ and an edge connection threshold $p_\tau$ , we first define a candidate edge set $\mathcal{E}(i)$ for node $v_i$ as + +$$ +\mathcal {E} (i) = \left\{j \mid \left(v _ {i}, v _ {j}\right) \in E \text {a n d} \hat {d} _ {i} \leq \hat {d} _ {j} \text {a n d} p _ {i j} \geq p _ {\tau} \right\}. \tag {5} +$$ + +For any $i$ , if $\mathcal{E}(i)$ is not empty, we pick + +$$ +j = \underset {j \in \mathcal {E} (i)} {\operatorname {a r g m a x}} \hat {e} _ {i j} \tag {6} +$$ + +and add $(v_{i}, v_{j})$ to $E'$ . We emphasize that the selection of the edge connection threshold $p_{\tau}$ is a hyper-parameter tuning process only on the validation set split from the meta-training set. It stays fixed after meta-training. This is different from the arbitrary parameter selection in unsupervised agglomerative clustering where the selection criteria will likely need to change across different test sets. + +Additionally, the definition of $\mathcal{E}(i)$ ensures that each node $v_{i}$ with a non-empty $\mathcal{E}(i)$ adds exactly one edge to $E^{\prime}$ . On the other hand, each node with an empty $\mathcal{E}(i)$ becomes a peak node with no outgoing edges. Meanwhile, the condition $d_{i} \leq d_{j}$ introduces an inductive bias in establishing connections. As nodes with low density tend to be those ones having a neighborhood that overlaps with other classes, or nodes on the boundary among multiple classes, connections to such nodes are often undesirable. After a full pass over every node, $E^{\prime}$ forms a set of connected components $G^{\prime}$ , which serve as the designated clusters. + +# 3.4. Realizing the Aggregation Function $\psi$ + +Recall that we denote $c_{i}^{(l)}$ to be the $i$ -th connected component in $G_{l}^{\prime}$ . To build $G_{l + 1} = \{V_{l + 1},E_{l + 1}\}$ , we first convert $c_{i}^{(l)}$ in $G_{l}$ to node $v_{i}^{(l + 1)}$ in $V_{l + 1}$ . We define two node feature vectors for the new node, namely the identity feature $\tilde{h}_i^{(l + 1)}$ and the average feature $\bar{h}_i^{(l + 1)}$ as + +$$ +\tilde {h} _ {i} ^ {(l + 1)} = \tilde {h} _ {m _ {i}} ^ {(l)} \quad \text {a n d} \quad \bar {h} _ {i} ^ {(l + 1)} = \frac {1}{\left| c _ {i} ^ {(l)} \right|} \sum_ {j \in c _ {i} ^ {(l)}} \tilde {h} _ {j} ^ {(l)}, \tag {7} +$$ + +where $m_{i} = \operatorname{argmax}_{j\in c_{i}^{(l)}}\hat{d}_{j}^{(l)}$ , represents the peak node index of the connected component $c_{i}^{(l)}$ . Additionally, in the + +first level, $\tilde{h}_i^{(0)} = \bar{h}_i^{(0)} = f_i$ , where $f_{i}$ is the visual embedding feature. + +The next-level input feature for the base cluster function $\phi$ of node $v_{i}^{(l + 1)}$ is the concatenation of the peak feature and average feature, i.e., $h_i^{l + 1} = [\tilde{h}_i^{(l + 1)},\bar{h}_i^{(l + 1)}]$ . We empirically found that directly using one of the features produces similar performances as the concatenation on some validation sets and we left this as a hyper-parameter. The identity feature $\tilde{h}_i^{(l)}$ can be used to identify similar nodes across hierarchies, while the average feature $\bar{h}_i^{(l)}$ provides an overview of the information for all nodes in the cluster. + +# 3.5. Hi-LANDER Learning + +Because the merged features for super nodes, $\tilde{h}_i^{(l + 1)}$ and $\bar{h}_i^{(l + 1)}$ , always lie within the same visual embedding space as the node features $h^{(l)}$ of the previous level, the same GNN model parameters can be shared across multiple levels of the hierarchy structure in learning the natural granularity of the cluster distribution of the meta-training set. + +Hierarchical Training Strategy Given $k$ and the ground truth labels, we can determine the level $L$ at which the hierarchical aggolemeration converges. Thus, we build the sequence of graphs $\{G_l\}$ with respect to the algorithm depicted in Algorithm 1, the only difference being that we use the ground-truth edge connections $\{E_l'^gt\}$ at all levels and thus ground-truth intermediate clusters $\{G_l'^gt\}$ for graph constructions. We initialize LANDER, and train it on all intermediate graphs $\{G_l\}$ . In one epoch, we loop through each $G_l$ , perform a forward pass on graph $\{G_l\}$ , compute the loss as will be defined next, and then update the model parameters with backpropagation. + +Training Loss The Hi-LANDER model is trained using the composite loss function given by + +$$ +\mathcal {L} = \mathcal {L} _ {\text {c o n n}} + \mathcal {L} _ {\text {d e n}}. \tag {8} +$$ + +The first term $\mathcal{L}_{conn}$ provides supervision on pair-wise linkage prediction via the average per-edge connectivity loss + +$$ +\mathcal {L} _ {\text {c o n n}} = - \frac {1}{| E |} \sum_ {(v _ {i}, v _ {j}) \in E} l _ {i j}, \tag {9} +$$ + +where $l_{ij}$ is the per-edge loss in the form + +$$ +l _ {i j} = \left\{ \begin{array}{l l} q _ {i j} \log p _ {i j} + (1 - q _ {i j}) \log (1 - p _ {i j}), & \text {i f} d _ {i} \leq d _ {j} \\ 0, & \text {o t h e r w i s e} \end{array} . \right. \tag {10} +$$ + +Here the ground truth label $q_{ij} = \mathbb{1}(y_i = y_j)$ indicates whether the two nodes connected by the edge belong to the same cluster, and can be computed across all levels as described previously (similarly for the ground-truth $d_i$ derived from the $q_{ij}$ values). Meanwhile, the second term $\mathcal{L}_{den}$ rep + +resents the neighborhood density average loss given by + +$$ +\mathcal {L} _ {d e n} = \frac {1}{| V |} \sum_ {i = 1} ^ {| V |} \left\| d _ {i} - \hat {d} _ {i} \right\| _ {2} ^ {2}. \tag {11} +$$ + +During training, both $\mathcal{L}_{conn}$ and $\mathcal{L}_{den}$ are averaged across data from all levels. Note that prior work has used conceptually related loss functions for training GNN-based encoders [56]; however, ours is the only end-to-end framework to do so in a composite manner without introducing a separate network or additional parameters. + +# 4. Experimental Results + +We evaluate Hi-LANDER across clustering benchmarks involving image faces, video faces, and natural species datasets. First, we show the sensitivity of our method to early-stopping and illustrate that it is only used to reduce complexity without affecting accuracy. We also illustrate ablation experiments over the model components. We then evaluate clustering performance under both settings of same train-test and unknown test-distributions. We further show the advantage of Hi-LANDER via a semi-supervised face recognition task with pseudo label training. Finally, we analyze the runtime cost. + +We compare with the following baselines. The unsupervised methods include DB-SCAN [14], ARO [35], HAC [41], H-DBSCAN [8], Graclus [13] and FINCH [39], where the latter four are hierarchical baselines. The supervised baselines include L-GCN [51], GCN-V [56] and GCN-E [56]. Hyperparameters for the baselines are tuned to report their best performances respectively. For example, we tune the optimal MinPts parameter for H-DBSCAN. Supervised GNN baselines have their best parameters tuned with the validation sets (part of the meta-training set), e.g., we tune the optimal $k$ -NN $k$ and $\tau$ parameters for GCN-V/E. + +# 4.1. Evaluation Protocols + +Datasets For face clustering, we use the large-scale image dataset TrillionPairs [2] and randomly choose one-tenth (660K faces) for training. For testing, we use IMDB (images, 1.2 million faces) [48] and Hannah (video-frames, 200K faces) [36]. Hannah has no overlapping person identities with the TrillionPairs training set, whereas IMDB has a small overlap (less than $2\%$ ). Features for all face datasets are extracted from a state-of-the-art embedding model [49] trained on TrillionPairs. The average cluster size of TrillionPairs, IMDB, and Hannah are 37, 25 and 800 respectively. For species clustering, we use iNaturalist2018 [43]. We follow the open-set train-test split for image retrieval as in [7], where the training (320K instances) and testing (130K instances) classes are disjoint. Both splits have similar cluster size distributions with an average of 56 instances per class. Features are extracted from a ResNet50 pretrained + +object retrieval model from [7]. Table 6 of the supplementary shows detailed statistics of all datasets. For all clustering training sets, we reserve $20\%$ for validation and hyperparameter tuning. When finalized, we re-train on the entire training split with fixed hyper-parameters. We use Deepglint and IMDB datasets for pseudo label training for face recognition and evaluate using the openset IJBC [30] benchmark. + +Evaluation Metrics For clustering, we report the Normalized Mutual Information (NMI) [46] capturing both homogeneity and completeness. We also report the pairwise and bicubed F-score which are two types of harmonic mean of the precision and recall of clustering prediction, denoted by $F_{p}$ and $F_{b}$ . We report the standard face recognition metrics, including False Non Match Rate (FNMR) @ various False Match Rate (FMR) for verification and False Negative Identification Rate (FNIR) @ different False Positive Identification Rate (FPIR) for identification. + +# 4.2. Implementation Details + +We use the validation sets to choose our optimal meta-training hyper-parameters. $k$ is set to 10 for $k$ -NN graph building and is fixed for inference for all settings and testsets. $p_{\tau}$ is set to 0.9 for face clustering and 0.1 for species. Both face and species clustering use the identity feature aggregation (detailed in Section 3.4). All validation sets are part of the meta-training sets and we have no access to any test information during hyper-parameter tuning. Due to space limitations, sensitivity analysis to these hyperparameters and additional details are included in the supplementary. + +# 4.3. Ablation Experiments + +Sensitivity to Early-stopping The proposed agglomeration process converges when there are no more new edges added. Though this convergence is reached without an explicit termination criterion, we observe that the process can be terminated early without affecting much the final clustering accuracy. Figure 2 shows the model sensitivity to early-stopping. The two dotted vertical yellow lines indicate the iterations at which the early-stopping and final convergence criteria are met. Clustering performance (Fp/Fb/NMI) plateaus after the iteration of early-stopping and there is no significant difference in accuracy and cluster numbers predicted compared to the final convergence. Therefore, simply for computational complexity considerations, we terminate the agglomeration early if computational cost is a concern. This choice is neither an arbitrary termination criterion nor a complexity / accuracy trade-off, rather, it is merely a computational expedient. Since there is no performance loss at early-stopping, we report performances with early-stopping in all subsequent sections. + +Our early stopping criteria is based on the following observation. In the case where all clusters are $k$ -ary trees, the number of new edges created at one level should be $\leq 1 / k$ of the number of edges created in the previous level. This matches the behavior in the early hierarchies when multiple intermediate clusters are merged. In the last couple of iterations, the model adds very few number of edges for several levels before an exact convergence. Therefore, if at any level the new edges created is more than $1 / k$ of the previous one, one can choose to early stop the agglomeration. + +![](images/531ab125781abf2239caebf78a65efbcd0fd7f6a85c5738877cd9d1e9c1fa491.jpg) +Figure 2. Sensitivity to early-stopping. The two dotted vertical yellow lines indicate the iterations at which the early-stopping and final convergence criteria are met. Left y-axis shows the accuracy of clustering prediction and right y-axis shows the predicted number of clusters (log-scale). The early-stopping is used to reduce further iterations after the model is close to convergence. + +![](images/25c231d2ef3ab15c72a6723799b1efa41c6b15190f5d043fe3c9e7f896589088.jpg) + +
MethodHannahRuntime
FpFbNMIsec
GCN-V+E [56]0.0620.2240.640256.2
LANDER0.0650.2340.64444.9
Hi-LANDER0.7140.6770.79736.9
+ +Value of Joint Inference We examine the effect of joint inference in our single level LANDER model compared to a prior GNN [56] that uses two-separate models in Table 1. The joint model outperforms the baseline, with a $5\%$ boost in F-scores, while reducing the runtime by five-fold. + +Value of Hierarchy Design We examine the effect of the hierarchical design in Hi-LANDER in Table 1. Comparing row two and three, combining LANDER with our hierarchical approach resulting in Hi-LANDER brings significant gains in F-scores from 0.234 to 0.677 and increase in NMI from 0.644 to 0.810 via modeling the data granularity using a disjoint meta-training set with a learnt convergence. + +# 4.4. Clustering Performance + +Here, we compare Hi-LANDER with state-of-art unsupervised and supervised methods under the setting where the cluster size distributions of train and test data are similar. For face, we sample a subset of IMDB to match the training distribution of Deepglint, and name this sub-sampled testset as IMDB-Test-SameDist. For species, we use iNat2018-Train and iNat2018-Test for training and testing since they follow the same cluster size distribution. Table 2 shows the + +Table 1. Ablation experiments:1) value of joint prediction compared to inference with two-separate models 2) value of hierarchy. + +
MethodIMDB-Test-SameDistiNat2018-Test
FpFbNMIFpFbNMI
DBSCAN [14]0.0640.0920.8220.1000.1160.753
ARO [35]0.0120.0790.8210.0070.0620.747
HAC [41]0.5980.5910.9040.1170.2450.732
H-DBSCAN [8]0.4230.6280.8950.1780.2410.754
Graclus [13]0.0140.0990.8290.0030.0500.735
FINCH [39]0.0010.0010.1550.0140.0140.283
LGCN [51]0.6950.7790.9400.0690.1250.755
GCN-V [56]0.7220.7530.9360.3000.3600.719
GCN-V+E [56]0.3450.5670.8640.2730.3530.719
Hi-LANDER0.7560.7920.9450.3300.3500.774
+ +results. Hi-LANDER consistently outperforms prior SOTA unsupervised and supervised GNN baselines. Supervised baselines perform better than unsupervised ones in this setting. We hypothesize this is due to the domain specialization in dealing with complex cluster structure through GNN training on label-annotated datasets. + +Table 2. Same train-test distribution clustering performance. First six rows show the unsupervised baselines (latter four are hierarchical based) and the last four rows show the supervised GNN based methods (including ours). Hi-LANDER outperforms both prior SOTA unsupervised and supervised GNN methods, with an average improvement of $35\%$ and $3\%$ in F-scores, respectively. + +
MethodHannahIMDBiNat2018-Test
FpFbNMIFpFbNMIFpFbNMI
DBSCAN [14]0.0410.1280.5460.0570.1180.8510.1000.1160.753
ARO [35]0.0010.0180.4830.0120.1030.8490.0070.0620.747
HAC [41]0.1970.4750.5210.5920.6240.9230.1170.2450.732
H-DBSCAN [8]0.1120.2960.5260.3950.6410.9120.1780.2410.754
Graclus [13]0.0010.0040.4520.0180.1310.8570.0030.0500.735
FINCH [39]0.2650.2580.3380.0010.0010.0890.0140.0140.283
LGCN [51]0.0020.0980.4550.6650.7710.9460.0300.0760.747
GCN-V [56]0.0560.2180.6370.6340.7680.9480.2690.3520.719
GCN-V+E [56]0.0620.2240.6400.5890.7320.9400.2520.3380.719
Hi-LANDER0.7140.6770.7970.6980.7780.9480.2940.3520.764
+ +Table 3. Clustering with unseen test data distribution. Supervised methods for iNat2018-Test are trained on iNat2018-Train-DifferentDist. Hi-LANDER outperforms SOTA GNN supervised and unsupervised methods, with an average F-score boost of $49\%$ and $47\%$ . On Hannah, where the test-distribution is very different from that in meta-training, we improve the F-score from 0.224 to 0.677 and NMI from 0.640 to 0.797 over prior GNN methods. + +# 4.5. Clustering with Unseen Test Data Distribution + +We also report clustering performance under the setting where test-time distribution is unknown and different from that of meta-training. Namely, parameters (such as $\tau$ and $k$ -NN $k$ in GCN-V/E and max cluster size in L-GCN) cannot be adjusted in advance using test-time information. For face clustering, we train with TrillionPairs-Train and test on Hannah and IMDB. For species, we sample a subset of the iNat2018-Train to attain a drastically different train-time cluster size distribution as iNat2018-Test, and name it iNat2018-Train-DifferentDist. Table 3 illustrates the results. Hi-LANDER outperforms prior supervised methods by a large margin over Hannah, where distribution of cluster sizes is long-tail (varying from 1-20K). This is due to Hi-LANDER's ability to perform dynamic inference and adapt to clusters with largely varying sizes during test (as shown + +in supplementary Figure 1). Some unsupervised baselines such as H-DBSCAN and HAC outperform the supervised ones over Hannah, showing better generalization capability. Despite being a supervised method, Hi-LANDER outperforms all unsupervised baselines, owing to the strong expressive power of our unified GNN LANDER model. + +
MethodIJBC 1:1 FNMR@FMRIJBC 1:N FNIR@FPIR
1e-31e-41e-11e-2
Graclus [13]0.2900.4610.4670.620
FINCH [39]0.1330.2300.2400.375
H-DBSCAN [39]0.1110.2000.1960.312
GCN-V [56]0.1070.1810.1810.270
GCN-V+E [56]0.1100.1870.1910.291
Hi-LANDER0.0910.1590.1620.250
Fully-supervised0.0720.1360.1360.235
+ +Table 4. Face recognition on IJBC[30]. Hi-LANDER outperforms all baselines and improves over the best result from prior-arts with a $14\%$ error reduction. Models trained with pseudo labels generated by Hi-LANDER brings the performance (0.159) closer to the lower bound with fully supervised training (0.136). + +# 4.6. Representation Learning with Pseudo-Labels + +We follow a setting similar to that of [59, 38, 57] for face recognition with pseudo label training. Starting with an initial representation learned through some labeled datasets, we utilize the clustering methods to generate pseudo labels for unlabeled datasets and train with these pseudo labels to better learn a representation. $^{5}$ The face recognition experiment involves the following steps: 1) Start with an initial face recognition model learnt on TrillionPairs. 2) Train a clustering model on the TrillionPairs or use an unsupervised clustering method with the initial face representations. 3) Generate pseudo label on IMDB (overlapping identities with TrillionPairs removed). 4) Train face recognition models on IMDB via the pseudo labels. 5) Evaluate the learned face representation on the open-set IJBC benchmark. Table 4 shows the results. We also report the lower bound from fully supervised training on IMDB with human labeled data. Hi-LANDER achieves a $14\%$ error reduction compared to the best baseline. Interestingly, pseudo label training with Hi-LANDER brings the performance to 0.159 (verification FNMR@FPIR1e-4), closer to the lower bound of fully supervised training at 0.136 than any of the baselines. + +# 4.7. Runtime Analysis + +We compare the runtime (seconds) of Hi-LANDER with all baselines (Table 5). The hardware and software specifications are included in the supplementary. The complexity + +
Method\DatasetHannahIMDBiNat2018-Test
DBSCAN [14]480.210,358.0592.6
ARO [35]184.41,349.3223.9
HAC [41]446.8183,311.86,730.5
H-DBSCAN [8]9,865.3390,360.0121,821.0
Graclus [13]38.3176.647.4
FINCH [39]74.7300.446.2
LGCN [51]3,342.133,211.13,057.4
GCN-V [56]41.7204.853.4
GCN-V+E [56]256.23,283.3197.5
Hi-LANDER36.9511.067.4
+ +Table 5. Runtime comparison on all benchmarks in Table 3 (secs). + +numbers above are from Hi-LANDER with early-stopping. Our method is faster than most baselines and is comparable with GCN-V[56], FINCH[39] and Graclus[13]. The multiple hierarchical levels introduced do not bring in additional overhead since Hi-LANDER runs faster level by level, with fewer number of nodes remaining after each level. + +# 5. Discussion + +The proposed clustering method aims at providing a rich representation of unlabeled data using induction from an annotated training set. GNNs represent a natural tool, for they allow training from a disjoint dataset a model that outputs a graph structure. Since the clustering problem is intrinsically ill-posed, for there is no unique "true" cluster, we aim to provide a rich hierarchical representation that gives the user more control - in the spirit of agglomerative hierarchical clustering. To tackle the computational challenge in replicating the basic graph operations across levels of the hierarchy, we have proposed enhancements of current GNN-based methods that improve efficiency. Though the complexity of our method is $\mathbb{O}(kN)$ , the same as the vanilla flat-version of GNN clustering, the full-graph inference is a natural parallelization and significantly reduces the runtime compared to prior GNNs with sub-graph inference. + +Hi-LANDER is subject to the usual failure modes of all inductive methods, when the distribution of test data is extremely different from that in training. In addition, the current node feature aggregation takes the form of averaging while there might be more sophisticated methods such as learnable attention for more informative aggregation. + +Even so, our goal is to reduce the number of arbitrary choices as much as possible and defer to the data the most critical design decisions. One is the choice of clustering criterion. This is inherited by the training set, through the simple classification loss. So is the level of granularity of the partition of the data. Though we use early stopping, we do so only after verifying that the method, when iterated to convergence, settles on a solution that is not substantially different from that obtained in earlier iteration. Therefore early stopping is not chosen as a design parameter or an inductive bias, but merely as a way to reduce computation. + +# References + +[1] https://cs.nyu.edu/media/publications/choma_nicholas.pdf.2 +[2] http://trillionpairs deepglint.com/overview.6 +[3] Mihael Ankerst, Markus M Breunig, Hans-Peter Kriegel, and Jörg Sander. Optics: ordering points to identify the clustering structure. ACM Sigmoid record, 28(2):49-60, 1999. 2, 3, 5 +[4] Filippo Maria Bianchi, Daniele Grattarola, Lorenzo Livi, and Cesare Alippi. Hierarchical representation learning in graph neural networks with node decimation pooling. arXiv preprint arXiv:1910.11436, 2019. 2 +[5] Thomas Bonald, Bertrand Charpentier, Alexis Galland, and Alexandre Hollocou. Hierarchical graph clustering using node pair sampling. arXiv preprint arXiv:1806.01664, 2018. 2 +[6] Guillem Brasó and Laura Leal-Taixe. Learning a neural solver for multiple object tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6247-6257, 2020. 2 +[7] Andrew Brown, Weidi Xie, Vicky Kalogeiton, and Andrew Zisserman. Smooth-AP: Smoothing the path towards largescale image retrieval. arXiv preprint arXiv:2007.12163, 2020. 6 +[8] Ricardo JGB Campello, Davoud Moulavi, and Jörg Sander. Density-based clustering based on hierarchical density estimates. In Pacific-Asia conference on knowledge discovery and data mining, pages 160–172. Springer, 2013. 2, 3, 6, 7, 8 +[9] Haochen Chen, Bryan Perozzi, Yifan Hu, and Steven Skiena. Harp: Hierarchical representation learning for networks. arXiv preprint arXiv:1706.07845, 2017. 2 +[10] Jie Chen, Tengfei Ma, and Cao Xiao. Fastgen: fast learning with graph convolutional networks via importance sampling. arXiv preprint arXiv:1801.10247, 2018. 2 +[11] Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Yan Shuicheng, Jiashi Feng, and Yannis Kalantidis. Graph-based global reasoning networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 433-442, 2019. 2 +[12] Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in neural information processing systems, pages 3844-3852, 2016. 2 +[13] Inderjit S Dhillon, Yuqiang Guan, and Brian Kulis. Weighted graph cuts without eigenvectors a multilevel approach. IEEE transactions on pattern analysis and machine intelligence, 29(11):1944-1957, 2007. 2, 6, 7, 8 +[14] Martin Ester, Hans-Peter Kriegel, Jörg Sander, Xiaowei Xu, et al. A density-based algorithm for discovering clusters in large spatial databases with noise. 2, 3, 6, 7, 8 +[15] Mohammed E Fathy, Quoc-Huy Tran, M Zeeshan Zia, Paul Vernaza, and Manmohan Chandraker. Hierarchical metric learning and matching for 2d and 3d geometric correspondences. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803-819, 2018. 2 + +[16] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pages 1024-1034, 2017. 2 +[17] J. Ho, Ming-Husang Yang, Jongwoo Lim, Kuang-Chih Lee, and D. Kriegman. Clustering appearances of objects under varying illumination conditions. In 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2003. Proceedings., volume 1, pages I-I, 2003. 2 +[18] Fenyu Hu, Yanqiao Zhu, Shu Wu, Liang Wang, and Tieniu Tan. Hierarchical graph convolutional networks for semi-supervised node classification. arXiv preprint arXiv:1902.06667, 2019. 2 +[19] Jingjia Huang, Zhangheng Li, Nannan Li, Shan Liu, and Ge Li. Attpool: Towards hierarchical feature representation in graph convolutional networks via attention mechanism. In Proceedings of the IEEE International Conference on Computer Vision, pages 6480-6489, 2019. 2 +[20] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. 2 +[21] Tian Lan, Tsung-Chuan Chen, and Silvio Savarese. A hierarchical representation for future action prediction. In European Conference on Computer Vision, pages 689-704. Springer, 2014. 2 +[22] Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 2 +[23] Wei-An Lin, Jun-Cheng Chen, Carlos D Castillo, and Rama Chellappa. Deep density clustering of unconstrained faces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8128-8137, 2018. 2 +[24] Wei-An Lin, Jun-Cheng Chen, and Rama Chellappa. A proximity-aware hierarchical clustering of faces. In 2017 12th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2017), pages 294-301. IEEE, 2017. 2 +[25] Alex Lipov and Pietro Liò. A multiscale graph convolutional network using hierarchical clustering. arXiv preprint arXiv:2006.12542, 2020. 2 +[26] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherical face: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 212-220, 2017. 1 +[27] Stuart Lloyd. Least squares quantization in lcm. IEEE transactions on information theory, 28(2):129-137, 1982. 2 +[28] Hans Lobel, René Vidal, and Alvaro Soto. Hierarchical joint max-margin learning of mid and top level representations for visual recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 1697-1704, 2013. 2 +[29] Chao Ma, Jia-Bin Huang, Xiaokang Yang, and Ming-Hsuan Yang. Hierarchical convolutional features for visual tracking. In Proceedings of the IEEE international conference on computer vision, pages 3074-3082, 2015. 2 + +[30] Brianna Maze, Jocelyn Adams, James A Duncan, Nathan Kalka, Tim Miller, Charles Otto, Anil K Jain, W Tyler Niggel, Janet Anderson, Jordan Cheney, et al. Iarpa janus benchmark-c: Face dataset and protocol. In 2018 International Conference on Biometrics (ICB), pages 158-165. IEEE, 2018. 6, 8 +[31] Li Mi and Zhenzhong Chen. Hierarchical graph attention network for visual relationship detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13886-13895, 2020. 2 +[32] Mark EJ Newman. Fast algorithm for detecting community structure in networks. Physical review E, 69(6):066133, 2004. 2 +[33] Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pages 849-856, 2002. 2 +[34] Duy-Kien Nguyen and Takayuki Okatani. Multi-task learning of hierarchical vision-language representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10492-10501, 2019. 2 +[35] Charles Otto, Dayong Wang, and Anil K Jain. Clustering millions of faces by identity. IEEE transactions on pattern analysis and machine intelligence, 40(2):289-303, 2017. 3, 6, 7, 8 +[36] Alexey Ozerov, Jean-Ronan Vigouroux, Louis Chevallier, and Patrick Pérez. On evaluating face tracks in movies. In 2013 IEEE International Conference on Image Processing, pages 3003-3007. IEEE, 2013. 6 +[37] Pascal Pons and Matthieu Latapy. Computing communities in large networks using random walks. In International symposium on computer and information sciences, pages 284-293. Springer, 2005. 2 +[38] Aruni RoyChowdhury, Xiang Yu, Kihyuk Sohn, Erik Learned-Miller, and Manmohan Chandraker. Improving face recognition by clustering unlabeled faces in the wild. In European Conference on Computer Vision, pages 119-136. Springer, 2020. 8 +[39] Saquib Sarfraz, Vivek Sharma, and Rainer Stiefelhagen. Efficient parameter-free clustering using first neighbor relations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8934-8943, 2019. 2, 3, 6, 7, 8 +[40] Walter J Scheirer, Anderson de Rezende Rocha, Archana Sapkota, and Terrance E Boult. Toward open set recognition. IEEE transactions on pattern analysis and machine intelligence, 35(7):1757-1772, 2012. 1 +[41] Robin Sibson. Slink: an optimally efficient algorithm for the single-link cluster method. The computer journal, 16(1):30-34, 1973. 1, 2, 6, 7, 8 +[42] Noam Slonim and Naftali Tishby. Agglomerative information bottleneck. In NIPS, volume 4, 1999. 1 +[43] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8769-8778, 2018. 6 + +[44] Andrea Vedaldi and Stefano Soatto. Quick shift and kernel methods for mode seeking. In European conference on computer vision, pages 705-718. Springer, 2008. 1 +[45] Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. 2, 4 +[46] Nguyen Xuan Vinh, Julien Epps, and James Bailey. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. The Journal of Machine Learning Research, 11:2837-2854, 2010. 6 +[47] Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395-416, 2007. 2 +[48] Fei Wang, Liren Chen, Cheng Li, Shiyao Huang, Yanjie Chen, Chen Qian, and Chen Change Loy. The devil of face recognition is in the noise. arXiv preprint arXiv:1807.11649, 2018. 6 +[49] Feng Wang, Jian Cheng, Weiyang Liu, and Hajun Liu. Additive margin softmax for face verification. IEEE Signal Processing Letters, 25(7):926-930, 2018. 6 +[50] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. Acm Transactions On Graphics (tog), 38(5):1-12, 2019. 2, 3 +[51] Z. Wang, L. Zheng, Y. Li, and S. Wang. Linkage based face clustering via graph convolution network. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1117-1125, 2019. 1, 2, 3, 4, 6, 7, 8 +[52] Xinshuo Weng, Yongxin Wang, Yunze Man, and Kris Kitani. Gnn3dmot: Graph neural network for 3d multi-object tracking with multi-feature learning. arXiv preprint arXiv:2006.07327, 2020. 2 +[53] Lingxi Xie, Qi Tian, Richang Hong, Shuicheng Yan, and Bo Zhang. Hierarchical part matching for fine-grained visual categorization. In Proceedings of the IEEE International Conference on Computer Vision, pages 1641-1648, 2013. 2 +[54] Sijie Yan, Zhizhong Li, Yuanjun Xiong, Huahan Yan, and Dahua Lin. Convolutional sequence generation for skeleton-based action synthesis. In Proceedings of the IEEE International Conference on Computer Vision, pages 4394-4402, 2019. 2 +[55] Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. arXiv preprint arXiv:1801.07455, 2018. 2 +[56] Lei Yang, Dapeng Chen, Xiaohang Zhan, Rui Zhao, Chen Change Loy, and Dahua Lin. Learning to cluster faces via confidence and connectivity estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13369-13378, 2020. 1, 2, 3, 4, 5, 6, 7, 8 +[57] Lei Yang, Xiaohang Zhan, Dapeng Chen, Junjie Yan, Chen Change Loy, and Dahua Lin. Learning to cluster faces on an affinity graph. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2298-2306, 2019. 1, 2, 3, 8 + +[58] Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in neural information processing systems, pages 4800–4810, 2018. 2 +[59] Xiaohang Zhan, Ziwei Liu, Junjie Yan, Dahua Lin, and Chen Change Loy. Consensus-driven propagation in massive unlabeled data for face recognition. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. 2, 8 +[60] Chunhui Zhu, Fang Wen, and Jian Sun. A rank-order distance based clustering algorithm for face tagging. In CVPR 2011, pages 481-488. IEEE, 2011. 2 +[61] Afra Zomorodian and Gunnar Carlsson. Computing persistent homology. Discrete & Computational Geometry, 33(2):249-274, 2005. 2 \ No newline at end of file diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/images.zip b/learninghierarchicalgraphneuralnetworksforimageclustering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1230c5d47cf4810b6385e74811fc056160789510 --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e4a34a6957ba6b5506c892d80eff70a14998d275a3493fa2c4e796713b1809d +size 347993 diff --git a/learninghierarchicalgraphneuralnetworksforimageclustering/layout.json b/learninghierarchicalgraphneuralnetworksforimageclustering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..af14a995eee993a0ab866deb4b3b29281df7685d --- /dev/null +++ b/learninghierarchicalgraphneuralnetworksforimageclustering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e091afbfbbf033f6fa94980202224faa31bd27a45263727a535bf32a7bbe3fe8 +size 501890 diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_content_list.json b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f3f9c502470bec9e9ffaf636112b0f37c9caec6 --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68c81941c07188d092f326619ee2f24385114a7d70a0b11d08a87b71d05415cd +size 89628 diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_model.json b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c96faf2ce0a57ad5c636769c0cb0640be6491572 --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4ee60f82eee2251b3a4406a983db32262e0f7d53efe30c9599b9fad4eff537d +size 107122 diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_origin.pdf b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f0eb986984e7a98648ba86882a92787e154cac02 --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/9d9fc0c5-342b-4801-9ea0-ebd11f766fef_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c6f4667e5c3cbeac298400d6b3d6421a7464131348c97bee770f1b1b711c2f9 +size 6801320 diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/full.md b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5be1bbc7d72ce12970bb7b610734b680569b3ccc --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/full.md @@ -0,0 +1,442 @@ +# Learning High-Fidelity Face Texture Completion without Complete Face Texture + +Jongyoo Kim, Jiaolong Yang, Xin Tong +Microsoft Research Asia + +{jongk, jiaoyan, xtong}@microsoft.com + +![](images/703de54891fcaa21125cb06a8fb3e1bc6bb625dd9d25d8eb29113b995d8092fc.jpg) +(a) Input +(b) Inferred texture +(c) Zoom-in of (b) +Figure 1: Examples of single-image face texture completion results. Our neural network, trained in an unsupervised manner without any complete face texture, can generate high-fidelity results with natural skin details and facial hair. + +![](images/6c8373cb4d2aac4c99460d5b5602eb561ab61e693c8036a982be5e1be1c53bb6.jpg) +(d) Rendered image + +![](images/3efb4cb0476ff776e6df8380f0d8ebdb61d3065c96bf836fbd223b881f6515ce.jpg) +(e) Zoom-in of (d) + +# Abstract + +For face texture completion, previous methods typically use some complete textures captured by multiview imaging systems or 3D scanners for supervised learning. This paper deals with a new challenging problem - learning to complete invisible texture in a single face image without using any complete texture. We simply leverage a large corpus of face images of different subjects (e.g., $FFHQ$ ) to train a texture completion model in an unsupervised manner. To achieve this, we propose DSD-GAN, a novel deep neural network based method that applies two discriminators in UV map space and image space. These two discriminators work in a complementary manner to learn both facial structures and texture details. We show that their combination is essential to obtain high-fidelity results. Despite the network never sees any complete facial appearance, it is able to generate compelling full textures from single images. + +# 1. Introduction + +Human face analysis and digitization are among the most popular topics in computer vision and graphics. Most face photos we take do not represent a full view of a face due to occlusion by the face itself or other objects. In fact, self-occlusion is ubiquitous for face images in the wild as shown by the examples in Fig. 1, leading to invisible texture content. The task of face texture completion is to infer the invisible face content and recover full-face appearance. It has a wide variety of applications ranging from 3D avatar creation [14, 20], 3D morphable model construction [2, 31], and face image manipulation [13, 36], to high-level vision tasks such as face recognition [13, 6]. This work is devoted to texture completion learning using deep neural networks for single face images. + +However, learning face texture completion is not + +straightforward due to the difficulty of collecting labeled training data. For single images, obtaining complete texture by manually labeling or painting is not a viable option. Using multi-view images to obtain high-resolution and high-quality textures is also not a trivial task, which necessitates sophisticated face image capture and processing pipelines. Previous works often use some special devices placed in controlled environments for training data capture, such as a multi-view DSLR capturing system or a 3D scanning system [4, 37, 6, 20]. Most datasets from these works are not publicly available. Note that most of them capture face albedo which is different from the texture we consider in this paper, but the requirements for face scanning, registration, and stitching are similar for obtaining both. + +To step aside from the effort for labeled data collection, we propose using a large collection of high-resolution face photos captured in unconstrained settings to train a face texture completion model. Although this would eliminate the need for complete texture acquisition, it poses new challenges for the learning task, since, for each input face image, there's no image of the same person that can be used for supervision. + +To this end, we propose a novel generative adversarial learning method called Dual-Space-Discriminator Generative Adversarial Network (DSD-GAN) to learn face texture completion in an unsupervised fashion. To make full use of the partially visible face appearance, we apply two discriminators designed differently in the UV texture space and image space. Our key observation is that the former is more suitable to learn texture details, whereas the latter is more important to learn facial structure. + +In the UV texture space, a discriminator takes small local patches as input to focus on detailed textural patterns. Real and fake patches are obtained on one image according to their visibility. Since the discriminator focuses on local patches, it may get stuck into local minima and ignore global textural consistency. Therefore, we make the local discriminator conditioned on the patch coordinates and train it to regress these coordinates. On the other hand, we employ a differentiable mesh renderer [10] to convert the generated UV texture into the image space and apply a discriminator taking the full image as input. The goal here is to capture the general face structure, core semantic components, and overall color gradient caused by different illumination conditions. The raw face photos are used as real samples, which naturally provide reliable training signals. To make the discriminator focus more on missing regions and avoid confusing it when missing regions are small, we apply spatially-varying labels for more effective training. We show that our dual space discriminators are very effective for the unsupervised learning task and the trained generator can produce high-fidelity face texture completion results. + +# 2. Related Work + +Deep image completion. Image completion with a deep neural network has been actively studied in the past few years. Pathak et al. proposed a context-encoder architecture, which employs adversarial and pixel-wise reconstruction losses [29]. To efficiently enlarge receptive field, Iizuka et al. [15] deployed a dilated convolution for image completion. Later, to deal with irregular hole shapes, a partial convolutional (PCONV) was proposed by Liu et al. [25] where a mask is used to consider only valid pixels and valid regions are gradually grown through a network. + +On the other hand, many methods adopt both a local and global discriminator to enhance image quality [15, 41, 6]. The local discriminator is applied for some fixed regions like facial center [6] or regions with generated content [15, 41]. Compared to these methods, our discriminators are designed in two different spaces to learn texture completion without any complete texture. + +3D face geometry and texture. Face UV texture is closely related to the 3D geometry of human faces. The 3D Morphable Model (3DMM) [2, 30] has been one of the most popular tool for 3D face reconstruction. The model is generally built based on a set of real captured data, then PCA is applied to form a parametric model. Many works employed the analysis-by-synthesis approach for 3D reconstruction. Recently, deep neural networks are employed for 3D face reconstruction using synthetic data for training [8, 12, 32] or trained in a weakly-supervised way [7, 10, 34]. + +Parametric facial texture models were also proposed in the past [3, 9]. Booth et al. [3] used a robust principal component analysis to build a model from incomplete "in-the-wild" textures. This method has an implicit texture completion during the construction of a texture model but loses fine details. In [9], a GAN-based texture model is proposed where 10,000 high-resolution complete UV data were used. However, for texture inference, the generated results are limited to their parametric model space. Contrarily, our approach generates a complete texture while preserving the visible pixels and details from the input. Lin et al. [24] proposed to generate fine-detail-textures based on a reconstructed texture using a parametric model. Their model only focuses on the visible part and does not handle the naturalness of the self-occluded textures. + +Similar to our approach, there have been a few methods proposed for texture completion based on 3D geometry [33, 37, 6]. Saito et al. [33] proposed a DNN to extract features from the partial images and used multi-scale detail analysis. Though it could generate plausible results, it requires heavy computation resources. Yamaguchi et al. [37] employed GAN for albedo prediction, face texture completion, and super-resolution of face texture. Deng et al.[6] proposed a GAN-based UV texture completion using hy + +![](images/2ce4a94dcf0f62827a59c38dd768ef78941380c4a50eac62bb5c80f16fd94177.jpg) +Figure 2: Overview of the proposed framework. The image-space discriminator is trained to learn coarse structure while the texture-space discriminator learns detailed textures. + +brid discriminators. However, both methods heavily depend on high-quality and high-resolution training data. + +On the other hand, SG-NN proposed a self-supervised completion model for 3D structure [5] without complete data. However, while SG-NN utilizes direct supervision by imposing artificial masks, DSD-GAN learns the distribution of the partial textural information using discriminators. + +# 3. Method + +We have two key goals: (1) learning face texture completion without complete texture data and (2) generating high-resolution and high-quality textures. To achieve both, we carefully designed our framework to fully make use of visible pixels in the training data. The overview of the framework is demonstrated in Fig. 2. A generator infers complete texture from an incomplete input texture and its visibility mask. Then, the texture is fed into two discriminators working in two different spaces: UV-atlas texture space and rendered image space. Since there is no full ground-truth in texture space, we crop the inferred textures to form several real and fake patches, which are fed into the texture-space discriminator. In the case of image space, the original image itself is regarded as real data while the rendered image is fake data as the inputs to the discriminator. The detailed processes are described in the following sections. + +# 3.1. Data Preparation + +In this work, we leverage a large collection of face images for the texture completion training task. We use two face image datasets: Flickr-Faces-HQ (FFHQ) [18] and CelebA-HQ [17]. FFHQ consists of 70K high-resolution face images and CelebA-HQ has about 30K. + +![](images/d3139aee0a78bbcb3653e26d7b4f95df8c17e5ff98f59dbf1dd986187e2a0d15.jpg) +Figure 3: Samples in the generated training dataset. + +To obtain UV textures and generate our training data, we developed an automated pipeline which consists of three steps: (1) DNN-based 3D face reconstruction, (2) optimization-based refinement, and (3) data cleaning. For the first step, we employ an off-the-shelf algorithm from [7] to obtain the initial 3D reconstruction results. To further improve the alignment accuracy, we then apply an offline optimization with losses similar to [7]. With the recovered 3D geometry, face textures and visibility maps cab be extracted. Finally, we refine the textures to remove bad samples: we first simplify the visibility mask boundary by using simple morphological operations, and then remove background (non-face) pixels introduced in texture space using the face parsing information [23]. If there are too many background pixels in a texture, we simply discard it. + +Some example textures generated from our pipeline are presented in Fig. 3. In our experiment, the resolutions of UV texture data and image space data are $512 \times 512$ and $448 \times 448$ , respectively. + +# 3.2. Generator + +Motivated from [35], our generator consists of down-sampling, residual blocks, and upsampling layers. Between each residual block, we add dilated convolutions [39] to enlarge the receptive field, which we found to be important + +especially for high-resolution images. For the input of the generator, we first concatenate a texture with a Gaussian random noise image where noise appears only in the hole regions of the texture map, then we flip the data horizontally and concatenate it with the original one to impose a weak symmetric consistency as used in previous studies [6, 37]. + +We denote the input texture as $T_{\mathrm{inc}}$ , visibility mask as $M_{\mathrm{tex}}$ , and the inferred texture as $T_{\mathrm{pred}}$ . For $M_{\mathrm{tex}}$ , valid and hole regions are indicated with 1 and 0 respectively. The output of the generator is used to calculate the self-reconstruction loss for the valid pixels as + +$$ +\mathcal {L} _ {\mathrm {r e c}} = \frac {1}{\sum_ {(i , j)} M _ {\mathrm {t e x}} ^ {\prime}} \sum_ {(i, j)} | \left(T _ {\mathrm {i n c}} - T _ {\mathrm {p r e d}}\right) \odot M _ {\mathrm {t e x}} ^ {\prime} | \tag {1} +$$ + +where $M_{\mathrm{tex}}^{\prime}$ is the inverse of $M_{\mathrm{tex}}$ and $\odot$ is a Hadamard product. Detailed network architectures are explained in the suppl. material. + +# 3.3. Discriminators + +Texture-space discriminator. From the inferred face texture $T_{\mathrm{pred}}$ , we extract local patches to represent real and fake labels for the discriminator. To make the selection process simpler and faster, we first define discrete candidate locations with the stride of $stride_c$ and cropping size $width_c$ . Then, using each visibility mask, we calculate the ratio of the number of valid pixels over that of total pixels in each cropping region and classify them into three categories: a hole patch (ratio $< 0.65$ ), a valid patch (ratio $> 0.9$ ), and the rest. Among them, only the hole patches $C_{\mathrm{hol}}$ and valid patches $C_{\mathrm{val}}$ are used for training. The optimal cropping size, $width_c$ is chosen based on experiments. If $width_c$ is too small, the model is less likely to catch important textural patterns, while large cropping results in fewer possible candidates. In the experiment, we set $stride_c = width_I / 32$ and $width_c = stride_c \times 2$ . + +To calculate the adversarial loss, we deploy a least square GAN [26] as + +$$ +\mathcal {L} _ {\mathrm {l o c}} = \underset {C _ {\mathrm {v a l}}} {\mathbb {E}} \left[ \left(D _ {T} \left(C _ {\mathrm {v a l}}\right) - 1\right) ^ {2} \right] - \underset {C _ {\mathrm {h o l}, z}} {\mathbb {E}} \left[ D _ {T} \left(C _ {\mathrm {h o l}}\right) ^ {2} \right] \tag {2} +$$ + +where $D_T(\cdot)$ indicates the texture-space discriminator, and $z$ is the random noise of the input. + +Face texture has a canonical structure, and there is a strong relationship between texture patterns and locations. For example, beard exists only around the mouth and chin, while cheeks usually have homogeneous textures. Therefore, we consolidate the positional information of the patches into their textural information to generate semantically correct details. Specifically, we train a conditional discriminator by regressing the coordinates of the input patches in the original full texture. We add a subbranch at the end of the convolutional layers in the discriminator as a + +![](images/07e63a42dea30efe4cb462389e0db775e0956ad3951c77e9425abe423d7d831f.jpg) +Figure 4: Illustration of local patch selection. Blue squares are real patches and green squares are fake patches. + +regressor like AC-GAN [22, 27]. The coordinate regression loss is calculated as + +$$ +\mathcal {L} _ {\text {c o o r d}} = \frac {1}{K} (\operatorname {R e g} (C) - \operatorname {p o s} _ {C}) ^ {2} \tag {3} +$$ + +where $\operatorname{Reg}(C)$ indicates the predicted coordinate by the regressor, $\mathrm{pos}_C$ is the normalized coordinate of $C$ , and $K$ is the total number of patches. For the coordinate normalization, values are rescaled to range between [0, 1]. + +Image-space discriminator. To learn the global structural information, we consider another discriminator defined in image space. Different from texture-space data, natural faces images in image space are faultless as themselves, that is, they can be regarded as real data for adversarial learning. Besides, image space data is less sensitive to alignment accuracy and it is easy to collect a large corpus of face images. + +Using a differentiable mesh renderer [10], we render the inferred texture $T_{\mathrm{pred}}$ to multiple face images $I_{\mathrm{pred}}$ . In this stage, choosing proper face poses to be rendered is important. We choose the new poses at random but ensure they are sufficiently far from the original face pose. For the real data, we simply apply the face boundary mask to the raw images, which we denote by $I_{\mathrm{raw}}$ . + +Our image-space discriminator takes a whole image as input and outputs a $14 \times 14$ fake/real label predictions. The receptive field size for each output point is $286 \times 286$ , which is large enough to capture the facial structural information. For the $14 \times 14$ predictions, we propose spatially-varying labels for the adversarial learning to deal with highly unbalanced real and fake pixels. Generally, in a rendered image $I_{\mathrm{pred}}$ , the number of hole pixels is smaller compared to the whole face region. The rest pixels are from the original valid face texture. If we naively handle these valid pixels as fake data, it could potentially confuse the discriminator. Therefore, different from the PatchGAN discriminator [16] where the whole patches in one image have a uniform label, our labels are spatially-varying. The individual labels are generated using the rendered visibility mask $M_{\mathrm{img}} = \mathrm{DR}(M_{\mathrm{tex}}, \mathbf{p})$ where $\mathrm{DR}(\cdot)$ is the differentiable mesh renderer, and $\mathbf{p}$ is the new pose. We resize $M_{\mathrm{img}}$ to form the label map having the same size as the output of the image-space discriminator, and binarize it with the threshold of 0.9. More details can be found in the suppl. material. + +The loss function for our image-space discriminator can + +![](images/d63f72d0f193a5dae05d5aa8caf4fb9563c5b6ec2ab828de41f2d799c4deb7e2.jpg) +Input texture +(1) w/o img. DSC & c.r. (2) w/o img. DSC +(3) w/o tex. DSC +(4) Full DSD-GAN +Figure 5: Comparison of completion results with different modules. (Best viewed with zoom) + +![](images/1ff0a5a3745ad3a72b2606511c957adb65708537373b2f4b62109eddbc14deb4.jpg) +(a) FFHQ +Figure 6: (a) and (b) are the yaw angle distributions of FFHQ and CelebA-HQ; and (c) is the average of visibility maps (darker means less number of visible pixels). + +![](images/8ba013a6dc69d362e322d442a5a42b95dd283451ab7c28deb2c5e16b44b5301e.jpg) +(b) CelebA-HQ + +![](images/2c9b9c4d95f4ee633133c6b6ebedc7d4faf44e316de00a808c1f6692d882e9d1.jpg) +(c) + +be written as + +$$ +\mathcal {L} _ {\mathrm {i m g}} = \underset {I _ {\mathrm {g t}}} {\mathbb {E}} \left[ \left(D _ {I} \left(I _ {\mathrm {g t}}\right) - 1\right) ^ {2} \right] - \underset {I _ {\text {p r e d}}, z} {\mathbb {E}} \left[ \left(D _ {I} \left(I _ {\text {p r e d}}\right) - \mathbf {l} _ {\mathrm {i m g}}\right) ^ {2} \right] \tag {4} +$$ + +$$ +I _ {\text {p r e d}} = \mathrm {D R} \left(T _ {\text {p r e d}}, \mathbf {p}\right) \tag {5} +$$ + +where $D_I(\cdot)$ is the image space discriminator, and $\mathbf{l}_{\mathrm{img}}$ is the spacially-varying label. + +# 3.4. Overcoming Data Bias + +FFHQ and CelebA-HQ are highly biased to front faces as shown in Fig. 6 (a) and (b). To mitigate the bias issue, we applied several workarounds in data sampling. + +Sampling pose to render. If we choose too far poses from its original, most of $I_{\mathrm{pred}}$ become profile faces, while the majority of $I_{\mathrm{raw}}$ is near-front faces. This can make the discriminator sensitive to pose rather than textural quality. Thus, the new pose was randomly sampled from the normal distribution with the estimated mean and covariance of FFHQ and CelebA-HQ. To guarantee the rendered face includes hole pixels, sampling was repeated until the new yaw meets two conditions: $(1) > 20^{\circ}$ difference from the original (2) opposite side based on front angle. This leads to slightly broader distribution then real, but the model less suffered from the bias issue. We will add details in the revision. + +Sampling local patches. Due to the biased pose distribution, the distribution of valid/hole patches in the UV space along the vertical direction is highly biased to upper/ lower + +![](images/146b35919c850872739d1bd70a7b949ff06685f6cde1b68d3268fb5d2781fe4f.jpg) +Figure 7: Pose invariance test. More visual results can be found in suppl. material. + +regions, as depicted in Fig. 6 (c). Naive random patch sampling from the valid/hole patch pool will result in imbalanced training data. To avoid this issue, we first uniformly and independently sampling a row index, then uniformly sampled a column index. This way, the training path distribution along the vertical direction will be made uniform. + +# 4. Experiments + +Implementation details. Our method is implemented using Tensorflow [1]. We use Adam optimizer [19] and learning rate $1e - 4$ to train all the models. We use four GPUs for training where the batch size of each GPU was 4. More details can be found in the supp. material. + +# 4.1. Ablation Study + +Effect of each proposed module. To validate the efficacy of each module, we conduct experiments with different submodules. We compare the four different settings: (1) DSD-GAN with only texture-space discriminator without coordinate regression, (2) DSD-GAN with only texture-space discriminator, (3) DSD-GAN with only image-space discriminator, and (1) full DSD-GAN. Each result is shown in Fig. 5. For models (1), (2), and (3), the self-reconstruction loss was used for training with a small weight. + +As seen in Fig. 5, model (2) works well for near-front faces with natural textures. However, significant artifacts appear for a large-posed, especially when a large part of the core facial component is missing. The inferred texture has + +
SSIMPerceptual similarity
-60°-30°0°30°60°Avg.-60°-30°0°30°60°Avg.
DeepFillv20.59740.69880.76960.68390.57590.66510.57830.69430.72320.66880.54450.6418
PICNet0.63320.72640.77110.71680.62300.69410.60540.74820.75440.73200.57240.6825
RFRNet0.62370.71200.77470.70340.61290.68530.57380.70640.72450.68920.55460.6497
Base-MPIE0.65210.71530.74500.71080.64200.69300.67870.75750.77990.74830.64850.7226
Base-BFM0.71150.75610.77690.75610.71640.74340.71700.78720.79340.77880.71800.7589
w/o img. DSC. & c. r.0.67310.67800.66770.68230.67800.67580.63730.60780.59540.66030.64450.6290
w/o img. DSC.0.68200.68810.68840.69130.69410.68880.62500.67120.66630.68220.68700.6663
w/o tex. DSC.0.73230.77320.78730.76350.73470.75820.72770.79220.79870.78050.74190.7682
DSD-GAN0.75310.77550.78760.77360.75220.76840.75000.79140.79850.78390.75940.7767
+ +Table 1: Comparison of SSIM (↑) and perceptual similarity (↑) under different input poses on the FaceScape dataset. (red and blue indicate the best and second-best models.) + +
DeepFillv2PICNetRFRNetBase-MPIEBase-BFMw/o img. dsc. & c. r.w/o img. dsc.w/o tex. dsc.DSD-GAN
24.386140.386344.924830.354617.212156.422343.05609.96783.3124
+ +Table 2: Comparison of FID scores (↓) on the FaceScape dataset. (red and blue indicate the best and second-best models.) + +high-frequency details but they are not consistent with valid regions. For model (4) where the coordinate regression is additionally excluded, the overall facial structure is collapsed. On the other hand, the image-space discriminator (model (3)) can capture the overall structure well, but the textural detail is poor compared to model (4). We can observe weird stripe patterns in the inferred region and a more noticeable seam when zoomed in. Comparing (3) and (4) in Fig. 5, it is obvious that incorporating coordinate helps the texture-space discriminator learn the structural information indirectly. Our full model takes advantage of each module and can generate high-fidelity textures as shown in (b). + +For quantitative evaluation, we use the FaceScape dataset [38] which contains complete face textures of 938 people. For each texture, we applied 5 different masks with input yaw rotations of $[-60^{\circ}, -30^{\circ}, 0^{\circ}, 30^{\circ}, 60^{\circ}]$ , then infer complete face texture on them. Each inferred texture is rendered to image space again for evaluation, with all these five poses but the input one. We calculate SSIM [43] and perceptual similarity between these generated face images and the ground truth, where perceptual similarity is computed as the cosine similarity of embedded features from VGGface [28]. We further compute the Fréchet inception distance (FID) to assess the quality of the generated faces. Table 1 and Table 2 again show the effectiveness of different modules. Removing any of them will lead to a significant performance drop. + +Invariance to input pose. In Fig. 7, the image in the first column shows the ground-truth full texture, and the others are inferred images by DSD-GAN with three different visibility masks corresponding to different poses. It can be observed that DSD-GAN can deal with various poses from frontal ones to large pose angles, producing natural and perceptually stable results. The numerical results in Table 1 also show the more stable performance of DSD-GAN compared to others. + +# 4.2. Method Comparison + +In this section, we evaluate the performance of our DSDGAN and compare it with other methods. We consider three groups of method for comparison: + +- Fully-supervised baselines. We train two baseline models with accessible complete face texture dataset: Multi-PIE face textures constructed by [6] as their (partial) training data, and BFM textures from [30]. We compare our model trained without any complete data with these two baselines. +- State-of-the-art methods. We compare DSD-GAN to prior art including two face texture completion methods of UV-GAN [6] and Yamaguchi et al. [37], and a state-of-the-art texture model GANFIT [9]. Note that all the three method leveraged complete face texture for learning. Unfortunately, none of them provide their trained models or full training datasets, making the comparison very difficult. Therefore, we run our method on relevant image samples from their papers and visually compare with their results. +- Image inpainting algorithms. To check the advantage of DSD-GAN over existing image inpainting approaches, we further compare with three deep inpainting models: DeepFill v2 [40], PICNet [42], and RFR-Net [21], all trained on face images from CelebA-HQ. Unlike ours, these methods are trained in image space using full supervision. + +# 4.2.1 Comparison to fully-supervised baselines + +To obtain strong baselines, we carefully augmented the face texture data and designed the training scheme. The Multi-PIE dataset contains 2,387 complete face textures of 337 subjects constructed from Multi-PIE database [11]. For BFM textures, we randomly sampled 500 textures from the + +![](images/d0b90ea340772cf50dc3ca484f72ef35fcba01a3eb6e4ed5a74775f8984aef88.jpg) +(a) Input + +![](images/74483e0dc62175ddeaf8a2ec880fadd04cc5d448a5b55a8786c7ecd57b931ab3.jpg) +(b) Input texture + +![](images/7902549894775922a175d20ddd88ff1775e8476ce4ccd935b55ab943c7d9f3ab.jpg) +(c) Base-MPIE + +![](images/6ffd3d501ec10dc6a3be9e02e58fc9ce628500a72d2d89c710003e285bde84e9.jpg) +(d) Base-BFM + +![](images/8d4499166bd6b19b9f2a49161c336807f2070c9a4f2f02d09e87d11276efd8f4.jpg) + +![](images/59e102b38caf62c535989702e6d2ad7f80c34138c6d21f7671f1822e08c3a7f3.jpg) +(e) DSD-GAN + +![](images/9836522aa701938b90c74972a6fedf71d1cd2c0fd5713823032b343e1c7c7dfc.jpg) + +![](images/801a3220d0b8519f9099436f583ec45eaaee84c2ae5feba6582536956652250e.jpg) + +![](images/e8111bcb3ceccd5256b4b0b45fb9b337e5493fd26b8c9989144c14c02a21a146.jpg) + +![](images/482cb751648bd75daf4ff7520c3b6593a5f1c0920aa7fc74dda9975a609075d6.jpg) + +![](images/f3a1d0a5bcf7971edc52993cf1a1c937ef9ca8a98502da7d05bb62e89d50bd9a.jpg) + +![](images/03184eebc3ebda67fbe3a2d30af94301e45dbce02454b5cd6adaec8fe4099e5f.jpg) + +![](images/121e22a4b8bb5b0c56dc97a20bd9688abbc5a5fa4a145518243fefb93e09054a.jpg) + +![](images/eb1a1885fb95cddb344f1b19c504258cfe8998442144e2369fcd5d5913a6f256.jpg) + +![](images/6122706c6121db6740a73585108e8ec7b06db21137313921f203b3479af9a433.jpg) + +![](images/fcf92a26f4cd353d7f4f894682953d55b5de3b53077ef9833842e9499ed3f112.jpg) + +![](images/4aca4dba731104ef17acbd5ab13f136bd6e6f4049bcf1935013ecb6f75acec47.jpg) + +![](images/c1928a6d4bb09f8c85e2e64facab8403548a604af9c368331c7d22d3c575784b.jpg) +Figure 8: Comparison of texture completion results with two supervised baseline methods. (Best viewed with zoom) + +![](images/b69f080e9d6db4b4f9d5a78d9b725c58d27d5a2dd83ce401e6c1094e159c8065.jpg) + +![](images/ce801daeedb0f2f86f8caf0c765a20616528cfe761d4d0df2cc1f8df1729868b.jpg) + +![](images/8c41b859e59eab6aa5c3b6723f7756127f37dcb5bd4949b391d1b773d9b66435.jpg) + +BFM model and augmented them by changing skin tones, resulting in 6,500 samples for training. For both, we applied visibility masks with random shapes and poses sampled online for training. Random lighting was applied to the BFM textures by using Spherical harmonics (SH) lighting [7]. Both baseline models consist of a generator and discriminator in the texture space with architectures identical to DSD-GAN. To train them, $L_{1}$ ground-truth reconstruction loss and adversarial loss were combined with their weights properly tuned. We refer to the two trained models as 'Base-MPIE' and 'Base-BFM', respectively. + +Figure 8 compares the qualitative results of different methods on the testing data from FFHQ. From the top row to the bottom row, the yaw angle of the face poses gradually increases. Baseline models generate reasonable results for the near-front faces. However, they clearly lack high-frequency details, especially under large poses. Our DSDGAN yields the best quality for both near-frontal and large poses with rich high-frequency details generated. + +Table 1 and 2 compare the quantitative results on the FaceScape dataset. As can be seen, our results are significantly more accurate than the baselines under all metrics. + +# 4.2.2 Comparison to state-of-the-art models + +Comparison to UV-GAN [6]. UV-GAN is trained with 77K complete face textures in a supervised fashion and infers up to $256 \times 256$ resolution. In contrast, our method learns to infer $512 \times 512$ textures without any complete tex + +ture. Figure 9 (left) compares the two methods using images from UV-GAN paper. As can be seen, both methods produce decent results, and UV-GAN handles a larger texture area than ours. However, our completed textures contain richer details. The re-rendered face images appear more realistic and better preserve the appearance of the raw input images. For large-pose faces, it seems that UV-GAN discarded the raw texture details visible in the input face (eyebrows, gaze, etc.) and regenerated the whole content, as can be observed from the third sample in Fig. 9 (left). + +Comparison to Yamaguchi et al. [37]. The method of Yamaguchi et al. learns to infer complete UV albedo using 329 production-level full 3D face scans. Figure 9 (right) compares our result with theirs. Since [37] generates albedo texture, we ignore the shading difference in the comparison. As shown in the figure, our texture map covers a larger facial region. By a closer look, the result of [37] may contain some seam artifacts on the boundary between visible and self-occluded parts (marked with green arrows), whereas ours look more natural. + +Comparison to GANFIT [9]. GANFIT is a state-of-the-art statistical parametric model of facial albedo texture that can be used for high-fidelity 3D face reconstruction. It is trained with $\sim 10\mathrm{K}$ complete and high-quality albedo UV maps from [4]. In Fig. 10, we compare our results with GANFIT. Again we should ignore the shading difference here for a fair comparison. It can be seen that the results of GANFIT are of high quality and appear natural in general. + +![](images/8b691bbceeac631e8bb27cd35aa00ec90b1673a8aae517dc0f9b0d374c1da9b7.jpg) +Inputs: + +![](images/2677c968152f14420a0f9197165488cf17a2bccc35d69aac30740a9fc2d48feb.jpg) + +![](images/ebbc32d4c061411c02dfd70df133ad8d5a38570f5c1ab096134ebc2a110b1869.jpg) + +![](images/a90cd49e33062f96baa886eadad2901a8bc9e5127af345759ea39e0113d18fcd.jpg) +(a) DSD-GAN +Figure 9: Comparison with UV-GAN [6] and Yamaguchi et al. [37]. The results of [6] and [37] are from their papers, and a full comparison can be found in the suppl. material. Green arrows indicate seam artifacts. (Best viewed with zoom) + +![](images/c219b76119e392603fbc3dfc6be2a0a4031afc0ff50403d61caebe044fffe982.jpg) + +![](images/4f84863c811f3c7f7727e426571a1081a84e3cd6b0f0e18678449b9883600190.jpg) + +![](images/5aedc0eb15efac08b990f249f2e376e8ae8456954e55f38d47ad98b54466006f.jpg) +(b) UV-GAN [5] + +![](images/0bd372f8b6db1f3166b15b7f8ecf8bd919a16300e5d5898f23bfdf80c10ce0bf.jpg) + +![](images/10260dd1207d3838e42abadbfe65c3fe8e175605a4155578f158a2adbab89616.jpg) + +![](images/9631c73a23b5240ae1e7dc292cbe5b1e37e39a2d04d4352263e586f69dcdf65b.jpg) + +![](images/5d68e505f7721eb71fc2533953dfd4affaebf7373f29877afee3f538e0a65a4e.jpg) + +![](images/1e067eda7483261e4eeb9f65608641b2cd478f27974735497b57cc91851aaa97.jpg) + +![](images/a88a7d36b85847770947bbd56f990a49c43aff63bd8b03512ec143f593ab9e98.jpg) +Inputs: + +![](images/d59733e2b7f4fcc5e240815490c243bf5b908f5eec9a37dcf5bf189c9f3fde12.jpg) + +![](images/5066d76d242a5457b9cd4fbeb66e96ecc88c9f51519c04d7a2ae8e30107b86e9.jpg) + +![](images/291e868b8861f878589e8ea2cd00681db483774e5a8525d76a07fbfc279562c2.jpg) +(c) DSD-GAN + +![](images/6221ec30ed9c0e88b835e1e6a4953167c9f950d1dd91d93f39361d215f4e850b.jpg) + +![](images/1f2912677bf881d19c1aad3d5622d60f2bb4d1ca564db8fe55233b0b317ddef4.jpg) +(d) Y + +![](images/2ecc46d9958e5479338f162bd3e774bcf69f8aebd7a3209cd196ec86887a7561.jpg) + +![](images/afecc5b0510d1be53d66a17177188e6b7861111a3a3b1255f1430e4f0f61f371.jpg) +(d) Yamaguchi et al. [36] + +![](images/4a35c0e0140881dd173afa113e9ae51a828c7d8368aeeeb65b1b159a46f1b1a1.jpg) + +![](images/542148d56f0615567f7036d13864a1fd6a4d5b252f8ffa3e5c3f3e83ac511e8a.jpg) + +![](images/7d4ac677cf93c1b37ebc09541ce9bdf49ecd794c95085977dddfcb44497ae2ef.jpg) + +![](images/f2f1d3f415221f47e17d4997b98c5635da5440ce7a32a98ba5514ec0e9ce0fca.jpg) +Input + +![](images/3d4de8661d4ccc5945c23784f7db40ff8fdbad70cb950f8a24b0f584272cca05.jpg) + +![](images/2d3eb609235bec1e8a7aa54e08abfa96acaa50811bcb0adaa1683a0feee4fbd7.jpg) + +![](images/8b628ed2c1a1d59ec7d67d388efc7c014238b9176bc863a31f73c83223031a8e.jpg) + +![](images/50e1f4e183263caea1e3a4df30e57b463af09c7abe79365b108b5ee0086b68b6.jpg) +GANFIT [8] + +![](images/01885a351bae1a9862003f44c1edaf675aa367c8c3259c32a9230e64f72da04f.jpg) + +![](images/0f50548a0261f5e49ceda16d1b1ba41ee329e5010d7b426ca70ed1ca6a332edd.jpg) + +![](images/b03663ce77a8be04477c15cc5a6602471f58d90020fceaa993b203cadc9db304.jpg) + +![](images/cc98e007ee7601cb88d13587a6f17fcb4a4ffd21ce1981597f050b6a27a8fb5c.jpg) +DSD-GAN + +![](images/9a26628f1277587124d4a9ae54982cc7904407ce2a5fa9598d9cc93d190a9b7f.jpg) + +![](images/ae6fa6799128712381e444dd8706c0f0cfb676abb8f9f25c9eaf9b2ec22a68ba.jpg) + +![](images/cb6fd6df93228c739fc95941e549ec372cde271139dd952b2b2b10addb90a9b6.jpg) + +OSD-GAN + +![](images/5f95dd33304fb6aa3747c7c9bc591413713fe8cfc41c8ef9c886f3a4e3d55a3a.jpg) +Figure 10: Comparison with GANFIT [9]. The results of [9] are from their paper, and a full comparison can be found in the suppl. material. + +![](images/725635ef3d13c092016152222a1c842334bf60a10249b909fa8d3608ec7908bf.jpg) + +![](images/b04c9f020051abe77cfacdd10811aee9d7f60c983e01bb69de32b1c40649d720.jpg) + +![](images/e6cb5f21a86be4aadec6b144ea1bd66e99dc7322b29acb15b5ec00759316da9f.jpg) + +![](images/21d8ce75158f28590c4c0229fd53decb28a0a8cd3ed950ef03a38c83df0c00a5.jpg) +(a) Input +(b) DeepFill v2 + +![](images/30e5ce3fcf377e2a44123911fc8fa1bd13482bce705fedfe77fba41e8b1d5098.jpg) + +![](images/a5d4bc00905dbf5fa9d8515d7fa0416b2b9666347c6b9ae99a7cf7603b01fe88.jpg) +(c) PICNet + +![](images/aa642f1469eb7c2ff3775f3411a13eb944b538b932f6acfd5975b47dac2c7bb2.jpg) +(d) RFRNet +(e) DSD-GAN + +![](images/9a26ee348e5f8228ecf0f79e9d8c8c744256d0e45a386c82cd52a4bfb23162af.jpg) + +![](images/32e8b94663c23b93c18a24ec33374c1ec229cf9e4e4b6e24048663d531cf63e5.jpg) +Figure 11: Inpainting results in texture space (top) and image (bottom) space. Our result in image space is obtained by unwarpping the image to texture space for completion then re-rendering back to image space. + +![](images/29ccbc79e73a371ae5d1b079435133961107f5448e7bdc106f4508fd5e370307.jpg) + +![](images/7466ef3c1829a5ed8a07d341671a0a8ba51588cea16f9c51005b2b89394d25b4.jpg) + +![](images/2bfa0ab708dd1c5706c73f2c6a5d6c54d7f17a5d28e812c9292eaf01bc0acb55.jpg) + +![](images/d794d2b41a3ff89a3b8e083efa6624987225bf4f64bc76a709519ba7701a156c.jpg) + +However, it may not be the best way to preserve texture details of the inputs. Our method works consistently well + +for all these image samples. + +Due to space constraint, more visual results including a comparison to another approach from Lin et al. [24] are presented in the suppl. material. + +# 4.2.3 Comparison to inpainting models + +In Fig 11, we compare with three image inpainting algorithms: DeepFill v2 [40], PICNet [42], and RFRNet [21]. For these methods, we use the models released by the authors which were all trained using face images from CelebA-HQ. We test them in both UV texture space and image space. Since they are not trained with texture-space data, it is expected that they may generate significant artifacts on UV texture. Their inpainting results in image space also suffer from obvious artifacts given large holes. We also quantitatively evaluate their inpainting performance in image space using the FaceScape dataset, and Table 1 and 2 show that their results less accurate than ours. + +# 5. Conclusion + +We presented a face texture completion framework that does not require any complete face textures, where dualspace discriminators work in a complementary manner. Our learned network could generate high-fidelity complete textures as shown in thorough experiments. DSD-GAN can be applied to various vision tasks. As shown by [7], generating synthetic data with largely different poses is a critical application to support the training of face-vision tasks. Improved texture quality will lead to a reduced domain gap between real and synthetic data. Furthermore, DSD-GAN can be used for free-view relighting with the combination of a simple albedo inference model (e.g. img2img translation). In addition, high-fidelity UV facial texture is applicable for realistic facial avatar generation for virtual reality. + +# References + +[1] Martin Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, and Zhifeng Chen et al. TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems. 2015. 5 +[2] Volker Blanz and Thomas Vetter. A Morphable Model for the Synthesis of 3D Faces. In ACM Siggraph, SIGGRAPH '99, pages 187-194, New York, NY, USA, 1999. ACM Press/Addison-Wesley Publishing Co. 1, 2 +[3] James Booth, Epameinondas Antonakos, Stylianos Ploumpis, George Trigeorgis, Yannis Panagakis, and Stefanos Zafeiriou. 3D Face Morphable Models "In-The-Wild". In IEEE Conference on Computer Vision and Pattern Recognition, pages 48-57, 2017. 2 +[4] James Booth, Anastasios Roussos, Stefanos Zafeiriou, Allan Ponniah, and David Dunaway. A 3D Morphable Model Learned From 10,000 Faces. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5543-5552, 2016. 2, 7 +[5] Angela Dai, Christian Diller, and Matthias Nießner. SG-NN: Sparse Generative Neural Networks for Self-Supervised Scene Completion of RGB-D Scans. In IEEE Conference on Computer Vision and Pattern Recognition, 2020. 3 +[6] Jiankang Deng, Shiyang Cheng, Niannan Xue, Yuxiang Zhou, and Stefanos Zafeiriou. UV-GAN: Adversarial Facial UV Map Completion for Pose-Invariant Face Recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 7093-7102, 2018. 1, 2, 4, 6, 7, 8 +[7] Yu Deng, Jiaolong Yang, Sicheng Xu, Dong Chen, Yunde Jia, and Xin Tong. Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 0–0, Mar. 2019. 2, 3, 7, 8 +[8] Yao Feng, Fan Wu, Xiaohu Shao, Yanfeng Wang, and Xi Zhou. Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network. In European Conference on Computer Vision, Mar. 2018. 2 +[9] Baris Gecer, Stylianos Ploumpis, Irene Kotsia, and Stefanos Zafeiriou. GANFIT: Generative Adversarial Network Fitting for High Fidelity 3D Face Reconstruction. In IEEE Conference on Computer Vision and Pattern Recognition, Feb. 2019. 2, 6, 7, 8 +[10] Kyle Genova, Forrester Cole, Aaron Maschinot, Aaron Sarna, Daniel Vlasic, and William T. Freeman. Unsupervised Training for 3D Morphable Model Regression. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8377-8386, June 2018. 2, 4 +[11] Ralph Gross, Iain Matthews, Jeffrey Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image and vision computing, 28(5):807-813, 2010. 6 +[12] Yudong Guo, Juyong Zhang, Jianfei Cai, Boyi Jiang, and Jianmin Zheng. CNN-based Real-time Dense Face Reconstruction with Inverse-rendered Photo-realistic Face Images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41:1294-1307, 2018. 2 +[13] Tal Hassner, Shai Harel, Eran Paz, and Roee Enbar. Effective Face Frontalization in Unconstrained Images. In IEEE Con- + +ference on Computer Vision and Pattern Recognition, pages 4295-4304, 2015. 1 +[14] Alexandru Eugen Ichim, Sofien Bouaziz, and Mark Pauly. Dynamic 3D Avatar Creation from Hand-Held Video Input. ACM Transactions on Graphics, 34(4):1-14, 2015. 1 +[15] Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and Locally Consistent Image Completion. ACM Transactions on Graphics, 36(4):107, July 2017. 2 +[16] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-Image Translation with Conditional Adversarial Networks. In IEEE Conference on Computer Vision and Pattern Recognition, pages 1125–1134, 2017. 4 +[17] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive Growing of GANs for Improved Quality, Stability, and Variation. In International Conference on Learning Representations, 2018. 3 +[18] Tero Karras, Samuli Laine, and Timo Aila. A Style-Based Generator Architecture for Generative Adversarial Networks. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4401-4410, 2019. 3 +[19] Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In International Conference on Learning Representations, 2015. 5 +[20] Alexandros Lattas, Stylianos Moschoglou, Baris Gecer, Stylianos Ploumpis, Vasileios Triantafyllou, Abhijeeet Ghosh, and Stefanos Zafeiriou. AvatarMe: Realistically renderable 3D facial reconstruction. In IEEE Conference on Computer Vision and Pattern Recognition, pages 760-769, 2020. 1, 2 +[21] Jingyuan Li, Ning Wang, Lefei Zhang, Bo Du, and Dacheng Tao. Recurrent Feature Reasoning for Image Inpainting. In IEEE International Conference on Computer Vision, pages 7760-7768, 2020. 6, 8 +[22] Chieh Hubert Lin, Chia-Che Chang, Yu-Sheng Chen, Da-Cheng Juan, Wei Wei, and Hwann-Tzong Chen. COCOGAN: Generation by Parts via Conditional Coordinating. In IEEE International Conference on Computer Vision, Mar. 2019. 4 +[23] Jinpeng Lin, Hao Yang, Dong Chen, Ming Zeng, Fang Wen, and Lu Yuan. Face Parsing with RoI Tanh-Warping. In IEEE Conference on Computer Vision and Pattern Recognition, June 2019. 3 +[24] Jiangke Lin, Yi Yuan, Tianjia Shao, and Kun Zhou. Towards High-Fidelity 3D Face Reconstruction from In-the-Wild Images Using Graph Convolutional Networks. In IEEE Conference on Computer Vision and Pattern Recognition, Mar. 2020. 2, 8 +[25] Guilin Liu, Fitsum A. Reda, Kevin J. Shih, Ting-Chun Wang, Andrew Tao, and Bryan Catanzaro. Image Inpainting for Irregular Holes Using Partial Convolutions. In European Conference on Computer Vision, pages 85-100, 2018. 2 +[26] Xudong Mao, Qing Li, Haoran Xie, Raymond Y. K. Lau, Zhen Wang, and Stephen Paul Smolley. Least Squares Generative Adversarial Networks. In IEEE International Conference on Computer Vision, Apr. 2017. 4 +[27] Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional Image Synthesis With Auxiliary Classifier + +GANs. In International Conference on Machine Learning, July 2017. 4 +[28] Omkar M. Parkhi, Andrea Vedaldi, and Andrew Zisserman. Deep Face Recognition. In Xianghua Xie, Mark W. Jones, and Gary K. L. Tam, editors, British Machine Vision Conference, pages 41.1-41.12. BMVA Press, Sept. 2015. 6 +[29] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2536-2544, 2016. 2 +[30] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, and T. Vetter. A 3D Face Model for Pose and Illumination Invariant Face Recognition. In IEEE International Conference on Advanced Video and Signal Based Surveillance, pages 296-301, Sept. 2009. 2, 6 +[31] Stylianos Ploumpis, Haoyang Wang, Nick Pears, William A. P. Smith, and Stefanos Zafeiriou. Combining 3D Morphable Models: A Large scale Face-and-Head Model. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 1 +[32] E. Richardson, M. Sela, and R. Kimmel. 3D Face Reconstruction by Learning from Synthetic Data. In International Conference on 3D Vision, pages 460-469, Oct. 2016. 2 +[33] Shunsuke Saito, Lingyu Wei, Liwen Hu, Koki Nagano, and Hao Li. Photorealistic Facial Texture Inference Using Deep Neural Networks. In IEEE Conference on Computer Vision and Pattern Recognition, Dec. 2016. 2 +[34] Soumyadip Sengupta, Angjoo Kanazawa, Carlos D. Castillo, and David Jacobs. SfSNet: Learning Shape, Reflectance and Illuminance of Faces in the Wild. In IEEE Conference on Computer Vision and Pattern Recognition, pages 6296-6305, 2018. 2 +[35] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8798–8807, 2018. 3 +[36] Sicheng Xu, Jiaolong Yang, Dong Chen, Fang Wen, Yu Deng, Yunde Jia, and Xin Tong. Deep 3D Portrait from a Single Image. In IEEE Conference on Computer Vision and Pattern Recognition, pages 7710-7720, 2020. 1 +[37] Shuco Yamaguchi, Shunsuke Saito, Koki Nagano, Yajie Zhao, Weikai Chen, Kyle Olszewski, Shigeo Morishima, and Hao Li. High-Fidelity Facial Reflectance and Geometry Inference from an Unconstrained Image. ACM Transactions on Graphics, 37(4):162, 2018. 2, 4, 6, 7, 8 +[38] Haotian Yang, Hao Zhu, Yanru Wang, Mingkai Huang, Qiu Shen, Ruigang Yang, and Xun Cao. FaceScape: A Large-scale High Quality 3D Face Dataset and Detailed Riggable 3D Face Prediction. In IEEE International Conference on Computer Vision, Apr. 2020. 6 +[39] Fisher Yu and Vladlen Koltun. Multi-Scale Context Aggregation by Dilated Convolutions. In International Conference on Learning Representations, Apr. 2016. 3 +[40] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S. Huang. Free-Form Image Inpainting with Gated Convolution. In IEEE International Conference on Computer Vision, June 2018. 6, 8 + +[41] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative Image Inpainting with Contextual Attention. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5505-5514, 2018. 2 +[42] Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. Pluralistic Image Completion. In IEEE Conference on Computer Vision and Pattern Recognition, Apr. 2019. 6, 8 +[43] Zhou Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli. Image Quality Assessment: From Error Visibility to Structural Similarity. IEEE Transactions on Image Processing, 13(4):600-612, Apr. 2004. 6 \ No newline at end of file diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/images.zip b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..603c8c1b80c0d2daf7cbe51a5d56a29113563b16 --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0080633f26d1a93d231e5464a8ff2edc353ad2e7c7f665a9490a29b640cb12b3 +size 823689 diff --git a/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/layout.json b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d45e80d2521b4ad2051627f8afa075432938a42a --- /dev/null +++ b/learninghighfidelityfacetexturecompletionwithoutcompletefacetexture/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f65019b381cc33f1c040dbe740c70d97b6b9ce755a05c3de469f467be008c08e +size 479795 diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_content_list.json b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..32b2dd2ff9b5a4896ee0b1f605882b4212f624c2 --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90d066c6246bd09348f81c148a410f6aa85307bbf557c754af6194265f332c00 +size 77504 diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_model.json b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..abf1c0716b8fe1cd340fc1001499fe02cd5e2e73 --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:236f0b4e0c05bceb2bce955d41d718570396a3282a02df0b0167f105507dba0f +size 101362 diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_origin.pdf b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..964ba9ce5688625f7675ae9e8cf0ecea7632f6db --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/c269059f-c792-444c-be9d-8144c11202c9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36d5c8480548fb1e18f68d1366d3f909ac10fce581bb3db38947f9d1a9e20aab +size 6095086 diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/full.md b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0a68a7fdf599551f2ca2a0a9613a8b5b9a0b8470 --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/full.md @@ -0,0 +1,347 @@ +# Learning Icosahedral Spherical Probability Map Based on Bingham Mixture Model for Vanishing Point Estimation + +Haoang Li $^{1,*}$ Kai Chen $^{1,*}$ Pyojin Kim $^{2}$ Kuk-Jin Yoon $^{3}$ Zhe Liu $^{4}$ Kyungdon Joo $^{5,\dagger}$ Yun-Hui Liu $^{1,\dagger}$ + +1The Chinese University of Hong Kong, Hong Kong, China 2Sookmyung Women's University, South Korea + +$^{3}$ KAIST, South Korea $^{4}$ University of Cambridge, United Kingdom $^{5}$ UNIST, South Korea + +# Abstract + +Existing vanishing point (VP) estimation methods rely on pre-extracted image lines and/or prior knowledge of the number of VPs. However, in practice, this information may be insufficient or unavailable. To solve this problem, we propose a network that treats a perspective image as input and predicts a spherical probability map of VP. Based on this map, we can detect all the VPs. Our method is reliable thanks to four technical novelties. First, we leverage the icosahedral spherical representation to express our probability map. This representation provides uniform pixel distribution, and thus facilitates estimating arbitrary positions of VPs. Second, we design a loss function that enforces the antipodal symmetry and sparsity of our spherical probability map to prevent over-fitting. Third, we generate the ground truth probability map that reasonably expresses the locations and uncertainties of VPs. This map unnecessarily peaks at noisy annotated VPs, and also exhibits various anisotropic dispersions. Fourth, given a predicted probability map, we detect VPs by fitting a Bingham mixture model. This strategy can robustly handle close VPs and provide the confidence level of VP useful for practical applications. Experiments showed that our method achieves the best compromise between generality, accuracy, and efficiency, compared with state-of-the-art approaches. + +# 1. Introduction + +Vanishing point (VP) is the intersection of two image lines whose corresponding 3D lines are parallel. VP has various applications such as scene understanding [12], camera orientation estimation [14] and 3D reconstruction [13]. While VP estimation has been widely studied, existing approaches have two main limitations. First, numerous methods [25, 24, 22, 33, 1, 18] rely on pre-extracted image lines, but they are sensitive to the number and quality of lines. For example, given a small number of lines, a method may ne + +![](images/2013e4615299b92e23110d560bcb7d54f92027b25677bf84425b40d25cec39ca.jpg) +(a) Ground Truth (b) Result of [22] (c) Result of [33] (d) Result of [25] + +![](images/2e0adffe37d0683997f619a171aa359464559a87848e8cdff834b3bcfd36b354.jpg) +(e) Our Input Image +(f) Our Output Map and DDs +Figure 1. (a) Four ground truth VPs are associated with red, green, blue and yellow line clusters, respectively (we have filtered out short lines). (b) [22] neglects a VP associated with dotted cyan lines due to insufficient lines. (c) [33] mistakenly detects a VP associated with solid cyan outliers. (d) [25] neglects a VP associated with dotted cyan lines due to the assumption of three orthogonal VPs. (e, f) We reformulate VP estimation as DD computation. Given a perspective image, our network predicts a spherical probability map of DD. Based on this map, we can detect all the DDs. + +glect some VPs (see Figs. 1(a) and 1(b)). Moreover, given several lines corrupted by outliers, e.g., shadow boundaries, a method may mistakenly detect VPs (see Figs. 1(a) and 1(c)). Second, many methods [4, 39, 25, 24, 41] rely on prior knowledge of the number of VPs. They typically assume three orthogonal VPs in Manhattan world [9], and thus neglect partial VPs or result in redundant detection in non-Manhattan scenes [30, 38] (see Figs. 1(a) and 1(d)). While recent approaches [15, 22, 23, 18] can automatically determine the number of VPs, they rely on image lines. + +To overcome the above limitations, we propose the first VP estimation method that is independent of image lines and also can automatically determine the number of VPs. Specifically, as shown in Fig. 1(e), the connection between a VP and camera center is aligned to a dominant direction (DD). Compared with VP that may be extremely far from + +the image center, unit DD starting at the camera center is enclosed by a unit sphere. We thus follow [41, 22] to reformulate VP estimation as DD computation, i.e., we aim to determine which positions on the sphere correspond to DDs. To achieve this goal, we propose a network that treats a perspective image as input and predicts a spherical probability map of DD. Based on this map, we can detect all the DDs, regardless of the number of DDs. + +Our method is reliable thanks to four technical novelties. First, as shown in Fig. 1(f), we leverage the icosahedral spherical representation [2] to express our probability map. $^{1}$ This representation provides a more uniform pixel distribution than the widely-used equi-angular discretization on the sphere (see Fig. 2(a)). Accordingly, it facilitates estimating arbitrary orientations of DDs. Second, we design a loss function that not only is effective in fitting data, but also enforces the antipodal symmetry and sparsity of our spherical probability map for regularization. Third, we generate the ground truth map that reasonably expresses the locations and uncertainties of DDs. This map unnecessarily peaks at noisy annotated DDs and also exhibits various anisotropic dispersions (see Fig. 6(d)). We train our network by minimizing the difference between the predicted and ground truth probability maps. Fourth, given a predicted probability map, we detect DDs by fitting a Bingham mixture model [6] (see Fig. 1(f)). This strategy is free of threshold, and thus can handle close DDs more robustly than non-maximum suppression [27]. Moreover, it can provide the confidence level of DD useful for practical applications. Our main contributions are: + +- Our method is independent of image lines and also can automatically determine the number of DDs. +- We leverage the icosahedral spherical representation to express our probability map. This representation facilitates estimating arbitrary orientations of DDs. +- We design a loss function that enforces the antipodal symmetry and sparsity of our spherical probability map to prevent over-fitting. +- We introduce a strategy to generate the ground truth probability map that reasonably expresses the locations and uncertainties of DDs. +- We detect DDs by fitting a Bingham mixture model on a predicted map. This strategy is free of threshold and can provide the confidence level of DD. + +# 2. Related Work + +We classify existing VP estimation methods into two categories, i.e., traditional and deep learning-based ones. + +Traditional Methods. Most traditional methods rely on pre-extracted image lines, i.e., they cluster these lines by unknown-but-sought VPs. Representative approaches [28, 3, 39, 33, 4, 5, 25, 24] assume three orthogonal VPs in Manhattan world. Among them, the sampling-based methods [3, 39] hypothesize several candidate VP triplets and select the optimal one that maximizes the number of inlier lines. They lead to unsatisfactory accuracy since some sampled lines may be affected by noise. The search-based methods [4, 5] search in a parameter space related to rotation and find the optimal parameters that maximize the number of inlier lines. They are accurate but inefficient due to numerous rounds of space sub-division and time-consuming bound computation. A method hybridizing the sampling and search [25] achieves a balance between accuracy and efficiency. Due to the assumption of three VPs, the above methods are prone to neglecting partial VPs or resulting in redundant detection in non-Manhattan scenes. In contrast, recent approaches [15, 22, 23] can automatically determine the number of VPs. However, they lead to unsatisfactory efficiency since their parameter spaces are high-dimensional and their cost functions are highly non-linear. + +Deep Learning-based Methods. Earlier method [38] requires pre-extracted image lines. It first uses a network to predict several candidate horizons, and then finds the optimal VPs that maximize the number of inlier lines. Recently, some approaches that do not rely on image lines are proposed [8, 41]. They directly treat an image as input. For example, Chang et al. [8] formulated VP estimation as a classification problem. However, this method can only detect VPs within the image. Zhou et al. [41] adopted a coarse-to-fine strategy to sample points on the sphere. For each sampled point, they used a network to predict the probability of VP. Then they selected the points with top $K$ probabilities ( $K$ is the number of VPs). While this method can handle VPs outside the image, it is sensitive to the sampling resolution and also requires prior knowledge of the number of VPs. In addition, an approach for multi-model fitting [18] can automatically determine the number of VPs. However, it requires image lines as input. + +# 3. Predicting Spherical Probability Map + +Given a perspective image, our network predicts a spherical probability map of DD. In Section 3.1, we introduce the icosahedral spherical representation that makes our network reliably handle arbitrary orientations of DDs. In Section 3.2, we introduce our network architecture. In Section 3.3, we design a novel loss function that exploits the characteristic of spherical map for regularization. + +# 3.1. Icosahedral Spherical Representation + +As shown in Fig. 2(a), the widely-used equi-angular discretization on the sphere [15, 22] results in non-uniform + +![](images/4da3b34cc0e0bccb557942f5fff727d7239e653f5dff74382f56c7c2982abe80.jpg) +(a) + +![](images/f46f74602b162c25ccfa1b68a064a06c7435c6372b306b8f4289ef1362799c87.jpg) +(b) + +![](images/c95f9bf8ff117ba8d50d372ce523b6d69b3fd26d42edcefcfbcbac0622486d13.jpg) +(c) +Figure 2. (a) Red and blue faces of the equi-angular discretization on the sphere have different areas. (b) Red triangle is a basic face of icosahedron. Sub-faces obtained by the first and second rounds of sub-divisions are shown in green and blue, respectively. (c) Sub-faces of icosahedral spherical representation are defined by the extruded vertices (e.g., the cyan one) and have similar areas. + +pixel distribution. Accordingly, our experiments show that a baseline method using this representation cannot handle arbitrary orientations of DDs, especially DDs near two poles (see Fig. 8(a)). To solve this problem, we propose to use a novel icosahedral spherical representation [2]. As shown in Fig. 2(b), an icosahedron consists of 20 basic faces with the same area. We sub-divide each face into 4 sub-faces. After $N$ rounds of sub-division, we obtain $20 \times 4^{N}$ sub-faces. We empirically set $N$ as 5, which leads to reliable DD estimation in our experiments. As shown in Fig. 2(c), we extrude all the vertices of icosahedron sub-faces to the unit sphere, obtaining the icosahedral spherical representation. We use this representation to express our spherical probability map. Specifically, a sub-face of this representation defines a pixel of spherical map. We associate each pixel with the probability that a DD passes through this pixel (see Fig. 1(f)). + +In addition, as shown in Fig. 1(f), a DD $\mathbf{d}$ is up to sign, i.e., $\mathbf{d}$ and $-\mathbf{d}$ are equivalent in DD estimation [32]. Accordingly, antipodal pixels of our spherical map should be associated with the same probability of DD. Despite this antipodal symmetry, we do not use the hemisphere to express the probability map. The reason is that a dividing line of sphere, i.e., a great circle (see Fig. 9(a)) may split a probability distribution on the map and further affects the network training, as will be shown in the experiments. + +# 3.2. Network Architecture + +As shown in Fig. 3(a), our network is based on encoder-decoder architecture. Our encoder works on the image domain. Given a perspective image, we follow the encoder of well-known DCGAN [29] to obtain a 1024-channel 1D code whose length is $20 \times 4^2$ . The reason why we choose DCGAN (instead of the other networks) is that DCGAN provides higher reliability in practice. Details are available in the supplementary material. The length of our code equals to the resolution of the icosahedral spherical representation based on two rounds of sub-division. Our decoder works on the sphere domain, and treats our code as the input spherical map. Based on the spherical convolution and upsampling [20], we alternately extract features (by convolu + +![](images/8dbbf353e6f48a1c572c63d96ff2e9565f90be10e69224136f1e656865deb1b3.jpg) +(a) Our Network Architecture + +![](images/f686e11c7f6f0017429709241e7ed19919dad63fa2cf55a533e1190f8f360ae2.jpg) +(b) Convolution +Figure 3. (a) Our network is based on encoder-decoder architecture. "S" and "C" denote the image size and the number of channels, respectively. (b) A pixel and its nine gray neighbors define the shape of convolution kernel. (c) For up-sampling, we transfer a pixel $\mathbf{p}$ in the lower-resolution map to a pixel $\mathbf{p}'$ in the higher-resolution map, and then pad three gray neighbors of $\mathbf{p}'$ with 0. + +![](images/e69f5a57118d83b3aebb216e98eb212a57f1e900fc38c3c93455e0f7a7445838.jpg) +(c) Up-sampling + +tion) and increase the map resolution (by up-sampling). We introduce these operations in the next paragraph. In addition, each spherical convolution is followed by bias adding, batch normalization, and leaky ReLU function. For the one-channel output whose resolution is $20 \times 4^5$ , we normalize it as a probability map (see Fig. 1(f)) by Sigmoid function. + +We consider a pixel of the icosahedral spherical map to illustrate the spherical convolution and up-sampling. As shown in Fig. 3(b), except for the shape of kernel, spherical convolution is similar to image convolution. By setting the stride as 1, convolution does not change the resolution of sphere. As shown in Fig. 3(c), except for the number of neighbors in the higher-resolution map, spherical up-sampling is similar to image up-sampling. + +# 3.3. Loss Function + +Our loss function is the combination of three sub-losses. First, we follow [37] to use the pixel-wise mean squared error (MSE) loss. This loss encodes the difference between the predicted and ground truth probability maps. We will introduce how we generate the ground truth map in Section 4. MSE loss is effective in fitting training data. To prevent over-fitting, we exploit the characteristic of probability map for regularization. Specifically, as introduced in Section 3.1, our spherical probability map should exhibit antipodal symmetry. To enforce this constraint, we propose an antipodal symmetry (AS) loss. We define it by the average of the squared differences between all pairs of antipodal pixels on a predicted map. In addition, as shown in Fig. 1(f), many pixels of our probability map should be associated with the probability of 0. To enforce this constraint, we exploit $L_{0}$ loss [7] to reduce the number of non-zero pixels. Based on the above sub-losses, we define our total loss by + +![](images/6674476a9023ba1a318d21d078096ab359ba23b591dbafcb32450395722e855e.jpg) +(a) + +![](images/0fb3a4ba8b08743a9ff0ea6c60e350261daae7c1759fc62b4902eb8b77442158.jpg) +(b) +Figure 4. Baselines to generate ground truth maps. (a) Map of Binary. (b) Maps of Unrefined and Refined both follow Watson mixture model [36] whose components exhibit isotropic dispersions. Components of Unrefined peak at noisy annotated DDs, while components of Refined peak at the refined DDs. + +$$ +L = \lambda_ {\mathrm {M S E}} \cdot L _ {\mathrm {M S E}} + \lambda_ {\mathrm {A S}} \cdot L _ {\mathrm {A S}} + \lambda_ {1} \cdot L _ {0}. \tag {1} +$$ + +We empirically set the coefficients $\lambda_{\mathrm{MSE}}$ , $\lambda_{\mathrm{AS}}$ and $\lambda_{1}$ as 2, 0.5 and 0.1, respectively. Our experiments demonstrate the effectiveness of all three sub-losses. + +# 4. Generating Ground Truth Probability Map + +Given several annotated $\mathrm{DDs}^2$ , we aim to generate the ground truth probability map used in Section 3.2. In the field of VP estimation, a method for spherical ground truth map generation does not exist. We first design various baselines and then propose a reliable method. + +# 4.1. Baselines and Their Limitations + +Binary Map (denoted by Binary). We design this baseline by analogy with [40]. Given several annotated DDs, we generate a spherical binary ground truth map. As shown in Fig. 4(a), we assign 1 to the pixels passed by the annotated DDs, and 0 to the other pixels. However, as will be shown in the experiments, due to too high sparsity of this map, the trained network is inaccurate. + +Unrefined Watson Mixture Model-based Map (denoted by Unrefined). We design this baseline by analogy with [37]. As shown in Fig. 4(b), we apply Watson distributions [36] with the same isotropic dispersion on pixels passed by the annotated DDs. We choose Watson distribution since its antipodal symmetry is suitable to express DDs (see Section 3.1). This baseline improves the accuracy of the above baseline by reducing the sparsity, as will be shown in the experiments. However, it does consider the noise of annotated DDs, which affects the accuracy. Specifically, on many VP datasets [42, 22, 18], a VP is annotated by computing the intersection of a small number of image lines with the same (manually obtained) labels. It is known that this VP may be unreliable [33, 39], especially when the intersected lines are nearly parallel. + +![](images/9a4e731ab17af66105b34cf887c579d61ff1e3690243f1ac638feb97fb467830.jpg) +Figure 5. Intersections of all pairs of image lines with the same label constitute a cluster exhibiting anisotropic dispersion. Moreover, dispersions of clusters are different. The cluster generated by green lines is far from the image center and not presented. + +Refined Watson Mixture Model-based Map (denoted by Refined). We first follow [33] to alternately refine annotated DDs and update cluster labels of image lines. Then we apply Watson distributions on pixels passed by the refined DDs (see Fig. 4(b)). While this baseline reliably expresses the locations of DDs, it fails to appropriately express the uncertainties of DDs. Specifically, [19] studied the uncertainties of VPs in the image by computing the intersections of all pairs of image lines with the same label. As shown in Fig. 5, the uncertainties of VPs should be expressed by the distributions with various anisotropic dispersions. Similarly, as will be shown in the next section, the uncertainties of DDs should be expressed by the distributions with various anisotropic dispersions. However, Watson distributions used by this baseline exhibit the same isotropic dispersion. + +# 4.2. Map Based on Various Anisotropic Dispersions + +To overcome the limitations of the above baselines, we propose a ground truth probability map that appropriately expresses both locations and uncertainties of DDs. First, we follow [33] to alternately refine annotated DDs and update cluster labels of image lines. Then as shown in Fig. 6(a), we map an image line into a great circle on the sphere. As shown in Fig. 6(b), we associate great circles with the updated cluster labels of image lines. As shown in Fig. 6(c), we compute the intersections of all pairs of great circles with the same label. These intersections constitute an antipodally symmetric cluster on the sphere. For all the clusters, their density peaks and various anisotropic dispersions encode the locations and uncertainties of DDs, respectively. Intuitively, a cluster with high-level anisotropic dispersion corresponds to a VP far from the image center. + +Based on the intersections computed above, we generate our ground truth probability map. We first define an icosahedral sphere with $20 \times 4^5$ sub-faces (see Section 3.1). Then we compute a frequency histogram of intersections over sub-faces of the icosahedral sphere. Specifically, if an intersection lies within a sub-face, we increase the frequency associated with this sub-face by one. Finally, we normalize the frequencies into $[0,1]$ . As shown in Fig. 6(d), we treat the spherical histogram with normalized frequencies as our ground truth probability map. Our map effectively expresses the distribution pattern of intersections. + +![](images/3b8bd63eafcd04f8f3513353fe3c23ff23120232ba6aed332f4b2190bfb1391f.jpg) +(a) + +![](images/df66be51c5dbf323692a3d481f461ea910b5b3fab749b5f9064bbd00d3ff8e4f.jpg) +(b) + +![](images/3df200baa9d6e83627da0280729bf24f3be6cbe22bf7f22b857f2613141455b5.jpg) +(c) + +![](images/305aa6d2f47080e7695a4b2f7f6b6f3bb334b40ace6d110078ba920e76c5ca7e.jpg) +(d) +Figure 6. (a) An image line and camera center define a projection plane. This plane intersects with the sphere, generating a great circle. (b) We generate four sets of great circles by the image lines in Fig. 5. (c) Intersections of all pairs of circles with the same label constitute an antipodally symmetric cluster exhibiting anisotropic dispersion. Moreover, dispersions of four clusters are different. (d) We generate a ground truth map by intersections. + +# 5. Detecting DDs Based on Predicted Map + +Given a probability map predicted by our network in Section 3.2, we aim to detect DDs. A straightforward way is to use the non-maximum suppression [27]. Briefly, we first select the pixels with high probabilities. Each selected pixel corresponds to a candidate DD. Based on a threshold of angle between two DDs, we sequentially select distinct DDs from candidates in a greedy manner. However, this strategy is relatively sensitive to the above threshold, and thus may result in under- or over-detection (see Figs. 12(d, e)). Moreover, directly selecting a distinct DD without considering its neighbors may result in unsatisfactory accuracy due to the effect of noise. To solve these problems, we propose to detected DDs by fitting a Bingham mixture model [6]. + +Algorithm Overview. As shown in Fig. 1(f), on our predicted map, there are several antipodally symmetric clusters of non-zero pixels. These clusters exhibit various anisotropic dispersions. Bingham mixture model is suitable to express this pattern. Accordingly, we treat our predicted map as a discrete probability density function of Bingham mixture model and use it to interpolate/fit a model (details are introduced in the next paragraphs). Given a fitted model, we treat the peaks of components as the detected DDs, and treat the concentrations of components as the confidence levels of DDs. These confidence levels are useful for practical applications, e.g., visual SLAM [16] (see the supplementary material). Our method can automatically determine the number of DDs and also robustly handle close DDs, as will be shown in the experiments. + +Details of Model Fitting. We first introduce basic knowl + +edge of Bingham mixture model. For a point $\mathbf{g}$ on the sphere, the probability density function of Bingham distribution is given by + +$$ +\mathcal {B} (\mathbf {g} | \mathbf {V}, \mathbf {k}) = \frac {1}{f (\mathbf {k})} \exp \left(\sum_ {i = 1} ^ {2} k _ {i} \left(\mathbf {g} ^ {\top} \mathbf {v} _ {i}\right) ^ {2}\right), \tag {2} +$$ + +where $\mathbf{v}_1$ and $\mathbf{v}_2$ are basis vectors, and $\mathbf{V} = [\mathbf{v}_1,\mathbf{v}_2]$ ; $k_{1}$ and $k_{2}$ are concentration parameters, and $\mathbf{k} = [k_1,k_2]^\top$ . A large magnitude of $k_{i}$ represents that Eq. (2) highly peaks along $\mathbf{v}_i$ . To express $M$ Bingham distributions ( $M$ represents the unknown-but-sought number of DDs in our context), we use a Bingham mixture model, i.e., + +$$ +\mathcal {M} (\mathbf {g}) = \sum_ {m = 1} ^ {M} c _ {m} \cdot \mathcal {B} (\mathbf {g} \mid \mathbf {V} _ {m}, \mathbf {k} _ {m}), \tag {3} +$$ + +where $c_{m}$ denotes the mixture coefficient of the $m$ -th component, and satisfies $c_{m} > 0$ and $\sum_{m=1}^{M} c_{m} = 1$ . + +In the following, we introduce the model fitting. We first follow [38] to sample scatters on the sphere based on the predicted probability map. Intuitively, for a pixel associated with large probability, we sample a large number of scatters within this pixel. Given $N$ sampled scatters $\{\mathbf{g}_n\}_{n=1}^N$ , we aim to cluster them by an unknown-but-sought Bingham mixture model in Eq. (3). To achieve this goal, we maximize a log-likelihood $D$ , i.e., + +$$ +\max _ {M, \underbrace {\left\{\mathbf {V} _ {m} , \mathbf {k} _ {m} , c _ {m} \right\} _ {m = 1} ^ {M}} _ {\text {M o d e l P a r a m e t e r s .}}} \underbrace {\log \prod_ {n = 1} ^ {N} \mathcal {M} \left(\mathbf {g} _ {n}\right)} _ {D}. \tag {4} +$$ + +We solve Eq. (4) based on a self-adaptive expectation-maximization algorithm [11]. It can automatically determine the number of DDs $M$ . Specifically, we search $M$ in a reasonable range of the number of DDs, e.g., [1, 6]. Given a tentative value $i \in [1, 6]$ of $M$ , we alternately update the cluster labels of scatters and model parameters. Then we back-substitute the estimated parameters into Eq. (4), obtaining the log-likelihood $D_{i}$ . In addition, we evaluate the complexity of a model with $i$ components by the complexity function $F(i)$ [11]. A small value of $F(i)$ corresponds to low model complexity. By considering both log-likelihood $D_{i}$ and function $F(i)$ , we find the optimal value $i$ based on the minimum message length criterion [35], i.e., + +$$ +\min _ {i} \left(- D _ {i} + F (i)\right). \tag {5} +$$ + +This criterion controls the trade-off between fitting quality and model complexity. For algorithm initialization, we assign adjacent scatters with the same cluster labels. Experiments show that our algorithm can robustly converge. + +# 6. Experiments + +Datasets. Our experiments are on both real-world [10, 22, 18, 31] and synthetic [41] datasets: + +Figure 7. Generality ("G"), accuracy ("A") and efficiency ("E") comparisons on three representative images. "↑", "−" and "↓" represent high, middle and low, respectively. We use image lines to compute $F_{1}$ -score and consistency error, regardless of whether a method requires image lines for VP estimation. In the 3-rd to 7-th columns, a dotted line in the image represents the connection between the midpoint of a clustered image line and an estimated VP. A triplet of numbers below an image represents $F_{1}$ -score, consistency error, and run time. Additional comparisons are available in the supplementary material. +![](images/9a6db58108ba22564b51de6da11d738fed495e34c189ea0e0d7525c6835799c4.jpg) +G:↓,A:↑,E:↑ +G: -, A: ↑, E: ↓ +G:↓,A:-,E:- +G: -, A: -, E: - +G:↑,A:-,E:↑ + +Table 1. Generality and accuracy comparisons on various datasets. + +
DatasetsTR-L-3 [25]TR-L-auto [22]DL-nL-3 [41]DL-L-auto [18]DL-nL-auto (our)
F1-scoreCons. ErrorF1-scoreCons. ErrorF1-scoreCons. ErrorF1-scoreCons. ErrorF1-scoreCons. Error
YUD+ [10]79.55%0.795 pix.84.18%0.682 pix.78.03%1.832 pix.87.34%1.757 pix.89.43%1.589 pix.
VSD [22]75.36%0.873 pix.91.02%0.769 pix.70.47%2.008 pix.88.34%1.802 pix.90.76%1.660 pix.
NYU-VP [31]80.20%0.951 pix.85.73%0.782 pix.76.34%2.078 pix.86.59%1.914 pix.87.88%1.851 pix.
SU3 [41]94.88%0.782 pix.96.26%0.598 pix.94.37%1.662 pix.93.89%1.429 pix.94.93%1.478 pix.
+ +- YUD+ [10, 18] consists of 102 outdoor and indoor images with $3 \sim 6$ vertical, horizontal and/or sloping VPs. +- VSD [22] consists of 97 outdoor images with $4 \sim 6$ vertical and horizontal VPs. +- NYU-VP [31, 18] consists of 1449 indoor images with $1 \sim 6$ vertical, horizontal and/or sloping VPs. +- SU3 dataset [41] consists of 23,000 outdoor images with $3 \sim 4$ vertical, horizontal and/or sloping VPs. + +We extract image lines by LSD [34] to estimate VPs and/or evaluate accuracy. For deep learning-based methods, we treat $80\%$ and $20\%$ of images of each dataset as training and testing images, respectively. We follow [26] to combine all the training images to train a single network. Then we test this network on testing images of each dataset independently. For traditional methods, we test it using the above testing images of each dataset independently. Additional information is available in the supplementary material. + +Evaluation Criteria. In our context, high generality represents that a method can detect various VPs, e.g., non-orthogonal horizontal VPs and sloping VPs (see Fig. 7). We follow [22, 21] to evaluate generality by $F_{1}$ -score that considers both precision and recall of image line clustering. In addition, for accuracy evaluation, we choose the widely-used consistency error [33, 39, 25, 22]. Consistency error in the image is more reasonable than angle evaluation in 3D [41] since uncertainty originates from the image [39]. Specifically, an estimated VP and midpoint of an image line $l$ associated with this VP define a virtual line $v$ . Consistency error represents the distance from an endpoint of the line $l$ to the virtual line $v$ . Additional illustrations are available in the supplementary material. On multiple images of a dataset, we report the mean of each metric. + +Implementation Details. We use Adam [17] to minimize our loss. Our learning rate is $10^{-4}$ , batch size is 16, and number of epochs is 30. We implement our method with TensorFlow and conduct tests on a computer equipped with + +Table 2. Efficiency comparisons on various datasets. + +
YUD+ [10]VSD [22]NYU-VP [31]SU3 [41]
TR-L-3 [25]0.202 s0.235 s0.216 s0.143 s
TR-L-auto [22]2.547 s3.106 s2.985 s2.367 s
DL-nL-3 [41]0.359 s0.371 s0.364 s0.343 s
DL-L-auto [18]0.383 s0.477 s0.401 s0.268 s
DL-nL-auto (our)0.268 s0.279 s0.284 s0.271 s
+ +TITAN Xp GPU and Xeon E5-2680 v4 CPU. + +# 6.1. Comparison with State-of-the-art Approaches + +We denote our deep learning-based method that does not rely on image lines and also can automatically determine the number of DDs by DL-nL-auto. We compare it with the state-of-the-art approaches introduced in Section 2: + +- The traditional method [25] relies on image lines and also assumes 3 mutually orthogonal VPs. We denote it by TR-L-3. +- The traditional method [22] relies on image lines and also can automatically determine the number of DDs. We denote it by TR-L-auto. +- The deep learning-based method [41] does not rely on image lines and also requires prior knowledge of the number of VPs. It assumes 3 VPs when prior knowledge is unavailable. We denote it by DL-nL-3. +- The deep learning-based method [18] relies on image lines and also can automatically determine the number of DDs. We denote it by DL-L-auto. + +Generality and Accuracy. As shown in Fig. 7 and Table 1, TR-L-3 only works well in Manhattan world. On the images with non-orthogonal and sloping VPs, it leads to unsatisfactory recall, which affects the $F_{1}$ -score. TR-L-auto fails to handle sloping VPs and also is prone to neglecting some VPs associated with a small number of image lines. DL-nL-3 can find three non-orthogonal VPs, and thus is more general than TR-L-3. However, it still fails to avoid under- or over-detection of VPs due to the assumption of three VPs. DL-L-auto can hardly detect VPs associated with a small number of image lines due to high difficulty of valid sampling. In contrast, our DL-nL-auto can predict a reliable spherical probability map and detect all the DDs based on this map. In addition, traditional methods lead to smaller consistency error than deep learning-based approaches thanks to geometric constraints. Our DL-nL-auto is the most accurate deep learning-based method. + +Efficiency. As shown in Fig. 7 and Table 2, TR-L-3 is not very efficient in non-Manhattan worlds. It treats image lines associated with non-orthogonal VPs as outliers and thus leads to numerous iterations. TR-L-auto is time-consuming due to high-dimensional parameter space and highly nonlinear cost function. The efficiency of DL-nL-3 is moderate due to the simplification of its coarse-to-fine inference + +Table 3. Comparison between icosahedral spherical representation and equi-angular discretization on all the datasets. + +
F1-scoreCons. Error
Equi-angular79.41%2.984 pix.
Icosahedral90.75%1.644 pix.
+ +Table 4. Comparison between hemisphere and sphere on all the datasets. + +
F1-scoreCons. Error
Hemisphere88.04%1.813 pix.
Sphere90.75%1.644 pix.
+ +![](images/0087f9575dbedf204278af1cb7c84fcc3c21cc3b39626ffbb6c6fa5e1a1d1317.jpg) +(a) $72.55\%$ 4.361 pix. + +![](images/747b3a1323ca3e894365ba6f5a32524faf816cebfc6e2a407345aeecfc8baa80.jpg) +(b) $91.03\%$ 1.573 pix. + +![](images/e7e45392413576447776b3ccc0750fc449ab35c22d87ece3be334187ab104113.jpg) +3 DDs + +![](images/166596eca8f900b7dff2491c1d862e3fa2021d17b76c18362f9beef48573397b.jpg) +Figure 8. Comparison between (a) equi-angular discretization and (b) icosahedral spherical representation on a representative image. A pair of numbers below a sphere represents $F_{1}$ -score and consistency error. Icosahedral spherical representation is more accurate than equi-angular discretization, especially around two poles. +(a) $88.49\%$ 1.928 pix. +Figure 9. Comparison between (a) hemisphere and (b) sphere on a representative image. A pair of numbers below a sphere represents $F_{1}$ -score and consistency error. Sphere is more accurate than hemisphere, especially around the dividing line. + +![](images/752fbac4b9b3847bfc088d3e1ca515fc9a5eb6a89c1840b88d2616ff5c0e684b.jpg) +(b) $92.56\%$ , 1.360 pix. + +![](images/6315a285edfabcbd5c723441c866ed82bb4ba9f55c8d75d094f2a297697ecb0f.jpg) +3 DDs + +strategy. DL-L-auto provides unsatisfactory efficiency for a relatively large number of VPs. Its time cost is mainly caused by sequential computation of sampling weights. Our DL-nL-auto is relatively efficient thanks to concise network and moderate resolution of map. In addition, compared with image line-based methods, deep learning-based approaches lead to smaller variances of runtime. + +# 6.2. Ablation Studies + +Spherical Expression. We express our probability map based on icosahedral spherical representation (see Section 3.1). We compare our network based on this representation with a baseline based on the equi-angular discretization. We introduce the architecture of baseline in the supplementary material. For a fair comparison, we set the resolution of equi-angular discretization as $200 \times 100 = 20,000$ pixels (recall that the icosahedral spherical representation consists of $20 \times 4^5 = 20,480$ pixels). As shown in Table 3 and Fig. 8, icosahedral spherical representation is more accurate than equi-angular discretization. The reason is that this representation provides uniform pixel distribution, and + +![](images/664d26836d1472fe3be77d231694746e3cbff70cec184fd6ad2a6e0ea741f13a.jpg) +Figure 10. Comparison between various baselines and our method for ground truth map generation on all the datasets. + +![](images/c733872466472f7d75676fd59422f7b9df35d27e552ed008187da4f7af78195b.jpg) + +Table 5. Comparison between various combinations of MSE, AS, and $L_0$ loess on all the datasets. + +
Cons. Error F1-score
MSE1.828 pix.88.64%
MSE & AS1.698 pix.90.02%
MSE & L01.782 pix.89.37%
MSE & AS & L01.644 pix.90.75%
+ +![](images/9568ba689275b45d735ae9f984a2a30e3071e8fe0945cf27a3a6cb8a397afb74.jpg) +Figure 11. A predicted map obtained by only MSE loss. + +thus facilitates estimating arbitrary orientations of DDs. + +In addition, we express the probability map on the sphere instead of hemisphere (see Section 3.1). We use the ground truth maps expressed by sphere and hemisphere to train our network, respectively. Table 4 and Fig. 9 show that sphere leads to higher accuracy. The reason is that sphere can keep the integrity of probability distribution. In contrast, when generating hemisphere, a dividing line of sphere may split a probability distribution. Accordingly, hemisphere results in unreliable probability prediction around the dividing line. + +Ground Truth Probability Map. We design baselines Binary, Unrefined and Refined and our method (see Section 4). We use different ground truth maps generated by these methods to train our network. As shown in Fig. 10, Binary leads to low accuracy since too high sparsity of ground truth map affects network training. The accuracy of Unrefined is unsatisfactory since it neglects the noise of annotated DDs. Refined improves the accuracy to some extent. However, due to inappropriate expression of uncertainties of DDs, it can hardly handle VPs far from the image center. Our method provides the highest accuracy since it reasonably expresses both locations and uncertainties of DDs. + +Loss Function. Our loss function is the combination of MSE, AS, and $L_{0}$ sub-losses (see Section 3.3). We test our network trained by various combinations of sub-losses. Additional tests on coefficient variation are available in the supplementary material. As shown in Table 5 and Fig. 11, MSE loss is effective in fitting the probability maps, but the accuracy is limited by slight asymmetry and too wide dispersions of distributions. AS and $L_{0}$ losses both improve the accuracy. The reason is that they can align the peaks of distributions and compress small non-zero probabilities respectively, and thus effectively prevents over-fitting. + +DD Detection. We detect DDs by fitting a Bingham mix- + +![](images/dc5272f2b5a32e3f1cce5fc41574a0ca63451aafa4522a941349c885460a2762.jpg) +(a) + +![](images/f4adc1ac0b0975489d388eeda74b62bb20052f4fcc3fe6ef4d593972f3e1ee8e.jpg) +(b) 4 DDs + +![](images/f1da3eeeef84c5f2ffa54a1cc0eea0682c84e878f4f9230b1c82d36205098371.jpg) + +![](images/a61cbd7fd13c3d63d6d9014c7e786a14b78535e595a5cbafc9b3df1b65a9948e.jpg) +(d) $\frac{3}{3 + 1} = 75.00\%$ , $\frac{3}{3 + 1} = 75.00\%$ +Figure 12. Comparison between non-maximum suppression and our model fitting for DD detection. (a) Results on 156 images with close DDs whose angles are small than 30 degrees. (b) A representative image with two close DDs. (c) DDs detected by our model fitting. (d, e) DDs detected by non-maximum suppression. A pair of numbers below a sphere represents precision and recall of DD detection (except for this figure, precisions, recalls and $F_{1}$ -scores in the other figures and tables are about image line clustering). + +![](images/1dc58a7197831bb5787e0c0e4650e261b3a5cf1e82b94194610d9080381247b6.jpg) +(c) $\frac{4}{4 + 0} = 100\%$ , $\frac{4}{4 + 0} = 100\%$ +(e) $\frac{4}{4 + 3} = 57.14\%$ , $\frac{4}{4 + 0} = 100\%$ + +ture model instead of non-maximum suppression (see Section 5). Given the same predicted probability map, we compare these strategies. As shown in Fig. 12, non-maximum suppression is prone to resulting in under- or over-detection especially when two DDs are relatively close. In contrast, our method is robust since it is free of threshold. + +# 7. Conclusions + +The proposed VP estimation method is independent of image lines and also can automatically determine the number of VPs, providing high generality. Moreover, it achieves satisfactory accuracy and high efficiency thanks to novel spherical representation, loss function, ground truth map generation, and DD detection. Therefore, it is more practical than existing methods failing to simultaneously guarantee generality, accuracy, and efficiency. + +Acknowledgments. Yun-Hui Liu was supported by the Hong Kong Centre for Logistics Robotics, RGC via grant 14207320, the CUHK VC Discretionary Fund, and Shenzhen Municipal Government via the Shenzhen-HK Collaboration Zone Project. Kyungdon Joo was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2020-0-01336, Artificial Intelligence Graduate School Program (UNIST)) and the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. NRF-2021R1C1C1005723). Pyojin Kim was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2021R1F1A1061397). + +Kuk-Jin Yoon was supported by Institute of Information and Communications Technology Planning & Evaluation (IITP) Grant funded by Korea Government (MSIT) (No. 2020-0-00440, Development of Artificial Intelligence Technology that Continuously Improves Itself as the Situation Changes in the Real World). + +# References + +[1] Michel Antunes and Joao Barreto. A global approach for the detection of vanishing points and mutually orthogonal vanishing directions. In CVPR, 2013. 1 +[2] John Baumgardner and Paul Frederickson. Icosahedral discretization of the two-sphere. SIAM Journal on Numerical Analysis, 1985. 2, 3 +[3] Jean-Charles Bazin and Marc Pollefeys. 3-line RANSAC for orthogonal vanishing point detection. In IROS, 2012. 2 +[4] Jean-Charles Bazin, Yongduek Seo, Cedric Demonceaux, Pascal Vasseur, Katsushi Ikeuchi, Inso Kweon, and Marc Pollefeys. Globally optimal line clustering and vanishing point estimation in Manhattan world. In CVPR, 2012. 1, 2 +[5] Jean-Charles Bazin, Yongduek Seo, and Marc Pollefeys. Globally optimal consensus set maximization through rotation search. In ACCV, 2012. 2 +[6] Christopher Bingham. An antidopally symmetric distribution on the sphere. The Annals of Statistics, 1974. 2, 5 +[7] Christopher Bishop. Pattern recognition and machine learning. Springer, 2006. 3 +[8] Chin-Kai Chang, Jiaping Zhao, and Laurent Itti. DeepVP: Deep learning for vanishing point detection on 1 million street view images. In ICRA, 2018. 2 +[9] James Coughlan and Alan Yuille. Manhattan world: Compass direction from a single image by Bayesian inference. In ICCV, 1999. 1 +[10] Patrick Denis, James Elder, and Francisco Estrada. Efficient edge-based methods for estimating Manhattan frames in urban imagery. In ECCV, 2008. 5, 6, 7 +[11] Mario Figueiredo and Anil Jain. Unsupervised learning of finite mixture models. TPAMI, 2002. 5 +[12] Alex Flint, David Murray, and Ian Reid. Manhattan scene understanding using monocular, stereo, and 3D features. In ICCV, 2011. 1 +[13] Yuan Gao and Alan Yuille. Exploiting symmetry and/or Manhattan properties for 3D object structure estimation from single and multiple images. In CVPR, 2017. 1 +[14] Jeong-Kyun Lee and Kuk-Jin Yoon. Real-time joint estimation of camera orientation and vanishing points. In CVPR, 2015. 1 +[15] Kyungdon Joo, Tae-Hyun Oh, In So Kweon, and Jean-Charles Bazin. Globally optimal inlier set maximization for Atlanta world understanding. TPAMI, 2019. 1, 2 +[16] Pyojin Kim, Brian Coltin, and H Jin Kim. Low-drift visual odometry in structured environments by decoupling rotational and translational motion. In ICRA, 2018. 5 +[17] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 6 +[18] Florian Kluger, Eric Brachmann, Hanno Ackermann, Carsten Rother, Michael Ying Yang, and Bodo Rosenhahn. CONSAC: Robust multi-model fitting by conditional sample consensus. In CVPR, 2020. 1, 2, 4, 5, 6, 7 +[19] Jana Košecka and Wei Zhang. Video compass. In Anders Heyden, Gunnar Sparr, Mads Nielsen, and Peter Johansen, editors, ECCV, 2002. 4 + +[20] Yeonkun Lee, Jaeseok Jeong, Jongseob Yun, Wonjune Cho, and Kuk-Jin Yoon. SpherePHD: Applying CNNs on $360^{\circ}$ images with non-Euclidean spherical polyhedron representation. TPAMI, 2020. 3 +[21] Haoang Li, Kai Chen, Ji Zhao, Jiangliu Wang, Pyojin Kim, Zhe Liu, and Yun-Hui Liu. Learning to identify correct 2D-2D line correspondences on sphere. In CVPR, 2021. 6 +[22] Haoang Li, Pyojin Kim, Ji Zhao, Kyungdon Joo, Zhipeng Cai, Zhe Liu, and Yun-Hui Liu. Globally optimal and efficient vanishing point estimation in Atlanta world. In ECCV, 2020. 1, 2, 4, 5, 6, 7 +[23] Haoang Li, Yazhou Xing, Ji Zhao, Jean-Charles Bazin, Zhe Liu, and Yun-Hui Liu. Leveraging structural regularity of Atlanta world for monocular SLAM. In ICRA, 2019. 1, 2 +[24] Haoang Li, Ji Zhao, Jean-Charles Bazin, Wen Chen, Zhe Liu, and Yun-Hui Liu. Quasi-globally optimal and efficient vanishing point estimation in Manhattan world. In ICCV, 2019. 1, 2 +[25] Haoang Li, Ji Zhao, Jean-Charles Bazin, and Yun-Hui Liu. Quasi-globally optimal and near/true real-time vanishing point estimation in Manhattan world. TPAMI, 2020. 1, 2, 6, 7 +[26] Zhengfa Liang, Yulan Guo, Yiliu Feng, Wei Chen, Linbo Qiao, Li Zhou, Jianfeng Zhang, and Hengzhu Liu. Stereo matching using multi-level cost volume and multi-scale feature constancy. TPAMI, 2021. 6 +[27] Alexander Neubeck and Luc Van Gool. Efficient nonmaximum suppression. In ICPR, 2006. 2, 5 +[28] Long Quan and Roger Mohr. Determining perspective structures using hierarchical Hough transform. PRL, 1989. 2 +[29] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. 3 +[30] G. Schindler and F. Dellaert. Atlanta world: An expectation maximization framework for simultaneous low-level edge grouping and camera calibration in complex man-made environments. In CVPR, 2004. 1 +[31] Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from RGBD images. In ECCV, 2012. 5, 6, 7 +[32] Julian Straub, Oren Freifeld, Guy Rosman, John Leonard, and John Fisher. The Manhattan frame model—Manhattan world inference in the space of surface normals. TPAMI, 2018. 3 +[33] Jean-Philippe Tardif. Non-iterative approach for fast and accurate vanishing point detection. In ICCV, 2009. 1, 2, 4, 6 +[34] R. Grompone von Gioi, J. Jakubowicz, J. Morel, and G. Randall. LSD: A fast line segment detector with a false detection control. TPAMI, 2010. 6 +[35] Chris Wallace and David Boulton. An Information Measure for Classification. The Computer Journal, 1968. 5 +[36] Geoffrey Watson. The statistics of orientation data. The Journal of Geology, 1966. 4 +[37] Bin Xiao, Haiping Wu, and Yichen Wei. Simple baselines for human pose estimation and tracking. In ECCV, 2018. 3, 4 + +[38] Menghua Zhai, Scott Workman, and Nathan Jacobs. Detecting vanishing points using global image context in a Non-Manhattan world. In CVPR, 2016. 1, 2, 5 +[39] Lilian Zhang, Huimin Lu, Xiaoping Hu, and Reinhard Koch. Vanishing point estimation and line classification in a Manhattan world with a unifying camera model. IJCV, 2016. 1, 2, 4, 6 +[40] Ziheng Zhang, Zhengxin Li, Ning Bi, Jia Zheng, Jinlei Wang, Kun Huang, Weixin Luo, Yanyu Xu, and Shenghua Gao. PPGNet: Learning point-pair graph for line segment detection. In CVPR, 2019. 4 +[41] Yichao Zhou, Haozhi Qi, Jingwei Huang, and Yi Ma. NeurVPS: Neural vanishing point scanning via conic convolution. In NeurIPS, 2019. 1, 2, 5, 6, 7 +[42] Zihan Zhou, Farshid Farhat, and James Wang. Detecting dominant vanishing points in natural scenes with application to composition-sensitive image retrieval. TMM, 2017. 4 \ No newline at end of file diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/images.zip b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fa5e28392700340b8403ae7466d43a888c444c61 --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3becd4f04fdba45602868ce665325271af1f1c676aae28964e2640765eb04133 +size 730485 diff --git a/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/layout.json b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a8a7b18119dc5105ac595d19cda1fcd56394fb44 --- /dev/null +++ b/learningicosahedralsphericalprobabilitymapbasedonbinghammixturemodelforvanishingpointestimation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a092c1ea4a5307c5cb3e608045f20631742fd1bc37911435f728470a24cf3d52 +size 448018 diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_content_list.json b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ce466caa031b56afdc07ca7c2a1ae0faa1b46114 --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e689577059311c3ce88ab4d74b1e792c75f6f2b309a08570415103b28b08033 +size 86386 diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_model.json b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0b8da92e181744912faaed5e7ae5fda286b1b7e2 --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25560c32e26ed7c70ccc729817316946cf10a365f979a31a63f98e6629101334 +size 108571 diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_origin.pdf b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c21a8a3fdbc0d5423500eda7aea19b319ec1467c --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/11016a54-2429-48cf-808e-6a0ac6cd3509_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9473331d6f7497bfee722b643703bbd8acfd881fc1b537217c94583dd1c09ff4 +size 9018919 diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/full.md b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5e3d6b02fdc3d12e0f6685765782c48e4a7725be --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/full.md @@ -0,0 +1,404 @@ +# Learning Indoor Inverse Rendering with 3D Spatially-Varying Lighting + +Zian Wang $^{1,2,3}$ +Jonah Philion $^{1,2,3}$ +Sanja Fidler $^{1,2,3}$ +Jan Kautz $^{1}$ +NVIDIA $^{1}$ +University of Toronto $^{2}$ +Vector Institute $^{3}$ + +{zianw, jphilion, sfidler, jkautz}@nvidia.com + +# Abstract + +In this work, we address the problem of jointly estimating albedo, normals, depth and 3D spatially-varying lighting from a single image. Most existing methods formulate the task as image-to-image translation, ignoring the 3D properties of the scene. However, indoor scenes contain complex 3D light transport where a 2D representation is insufficient. In this paper, we propose a unified, learning-based inverse rendering framework that formulates 3D spatially-varying lighting. Inspired by classic volume rendering techniques, we propose a novel Volumetric Spherical Gaussian representation for lighting, which parameterizes the extant radiance of the 3D scene surfaces on a voxel grid. We design a physics-based differentiable renderer that utilizes our 3D lighting representation, and formulates the energy-conserving image formation process that enables joint training of all intrinsic properties with the re-rendering constraint. Our model ensures physically correct predictions and avoids the need for ground-truth HDR lighting which is not easily accessible. Experiments show that our method outperforms prior works both quantitatively and qualitatively, and is capable of producing photorealistic results for AR applications such as virtual object insertion even for highly specular objects. + +# 1. Introduction + +The task of inverse rendering, originally proposed by Barrow and Tenenbaum [3] in 1978, aims to reverse the rendering process by estimating reflectance, shape and lighting from a single image. Estimating these intrinsic properties enable downstream applications in augmented and mixed reality, such as realistic insertion of 3D objects into a given 2D image. Inverse rendering also facilitates semantic scene analysis such as object segmentation [5]. + +Given only observed pixel values, the problem of disambiguating reflectance, geometry and their complex interactions with lighting is challenging and ill-posed. Classic optimization-based methods leverage hand-crafted priors to constrain the ill-posed nature of the problem. However, these priors do not always hold for complex real world images and can lead to artifacts. Indoor scenes commonly encountered in AR applications are considered especially challenging due + +![](images/5a8706b0e416fc9dac1de066750e2e6ffa72c936ceea43a5e4f1717a359eb916.jpg) + +![](images/2c598991a660722af78ce855299d83a829a9790f6e5eb7c028cb390e05b97e73.jpg) + +![](images/4a2c0e40b014a86b600fda936cbfb0c8c3ea8e6e8bc9c43dff8563b7df708d49.jpg) + +![](images/9efe6dd2b244fa8c3e8730cb43cd96b102374a75f88964354356e7cfc78d8924.jpg) + +![](images/b13008315028e6416e25b3442bad944eba8aba90a631b0b7c36e0b393ad23655.jpg) + +![](images/b80dff8f37d6eb28f2eebb1136c4e4f9b92407f290b6c3ea7b075f46cf5172d5.jpg) +(a) Input image +(b) Albedo +(c) Normals +(f) Specular / Diffuse / Transparent Sphere Insertion + +![](images/a34a337636000e294df9ea52a8dfded8492d3726dfd9439d2b3a1dbc41210394.jpg) +(d) Depth +(e) Lighting +(g) Specular Object Insertion +Figure 1: From a single image, our model jointly estimates albedo, normals, depth, and the HDR lighting volume. Key to our method is inferring continuous HDR 3D spatially-varying lighting, which is critical in producing high quality virtual object insertion with realistic cast shadows and angular high-frequency details. + +to complex 3D light transport that occurs indoors. + +In this work, we address the problem of scene-level inverse rendering, focusing specifically on producing high dynamic range (HDR) 3D spatially-varying lighting with high-frequency details, as shown in Fig. 1. Estimating both HDR and 3D spatially-varying lighting is critical for photorealistic virtual object insertion; HDR enables realistic cast shadows and 3D spatially-varying lighting enables high-frequency details. We use the HDR lighting inferred by our model to insert highly specular objects and produce realistic cast shadows and high-frequency details, which were not possible in previous works [11, 22, 33, 38]. + +Existing learning-based methods usually exploit powerful 2D CNNs and formulate the inverse rendering problem as image-to-image translation. Lighting is usually represented with spherical lobes such as spherical Harmonics and spherical Gaussian [2, 41], and environment maps [10, 33], which ignores spatially-varying effects. Recent works attempt to predict 2D spatially-varying spherical lobes [11, 22], but still lack one degree of freedom (depth) and compromise in terms of angular high-frequency effects. As a consequence, the 2D representation of the scene lighting is not sufficiently performant for many downstream applications. + +In this paper, we propose a holistic inverse rendering framework for jointly estimating reflectance, shape and 3D + +spatially-varying lighting, by formulating the complete rendering process in an end-to-end trainable way with a 3D lighting representation. We propose a novel Volumetric Spherical Gaussian representation for lighting, which is a voxel representation for the scene surfaces. Spherical Gaussian parameters in each voxel control the emission direction and sharpness of the light source, which captures view-dependent effects and can handle strong directional lighting. Since ground-truth for HDR lighting is not easily available, we design a raytracing based differentiable renderer that leverages our lighting representation and formulates the energy-conserving image formation process. We use the renderer to jointly train all intrinsic properties by enforcing the re-rendering constraint, ensuring that predictions are physically correct. To the best of our knowledge, our approach is the first to estimate a complete continuous light field function from a single image, including both HDR and high-frequency spatial and angular details, despite being trained with only LDR images. + +We experimentally show that our approach outperforms existing state-of-the-art inverse rendering and lighting estimation methods. We demonstrate that our method learns to produce complex lighting effects of real-world indoor scenes and better disambiguates intrinsic properties. Our lighting representation enables realistic cast shadows and angular high-frequency details and is therefore capable of producing significantly more realistic object insertion results for AR applications that were not possible previously, most importantly including the insertion of highly specular objects. + +# 2. Related Work + +Inverse Rendering. The task of inverse rendering dates back to Barrow and Tenenbaum [4], with the goal of jointly estimating intrinsic properties of the scene, i.e. reflectance, shape and lighting. Classic approaches usually tackle subtasks of inverse rendering, such as intrinsic image decomposition [3, 8, 13, 18, 44] and shape from shading [32, 43]. These methods primarily defined hand-crafted priors over the content of a scene and formulate the task as a per-image energy minimization problem. Recently, SIRFS [2] proposed a statistical inference framework that jointly estimates the intrinsic properties. However, these methods rely on assumptions that are not always true for real scenes, leading to artifacts when applied on real-world images. The need to perform test-time optimization also raises the computational burden, limiting these approaches to offline applications. + +Recent works utilize 2D CNNs for learning data-driven priors from sparse human reflectance annotations [6], calibrated multi-view and multi-illumination data [24, 41], and most commonly, synthetic data [7, 22, 23, 25, 33] that comes with dense ground-truth labels. Among these works, [7, 25] are limited to single object inputs and do not address complex light transport. NIR [33] and Li et al. [22] are most + +similar to our work, and address general indoor scenes. Both formulate the task as image-to-image translation and train on synthetic datasets. NIR employs an environment map to represent lighting and introduces a non-interpretable neural renderer to account for spatially-varying lighting effects. Li et al. predicts a spherical Gaussian lighting for each pixel location to get 2D spatially-varying lighting, but it still lacks one degree of freedom and sacrifices angular frequency at each pixel location. In our work, we tackle a more challenging task of estimating 3D lighting in a holistic inverse rendering framework, and learn to disentangle complex lighting effects with a physics-based representation. + +Lighting Estimation is a sub-task of inverse rendering. Most existing works tackle simplified problem settings and ignore spatially-varying effects, such as outdoor scenes [16, 17, 42] and objects [7, 25, 40]. Prior works on indoor lighting estimation explored lighting representations such as environment maps [10, 20, 33], per-pixel spherical lobes [11, 22, 45] and light source parameters [9]. However, these methods either do not account for spatially-varying effects or do not preserve high-frequency details. Recent works explore 3D spatially-varying lighting [37, 38]. Neural Illumination [37] predicts an environment map with 2D CNNs given each queried 3D location, but it suffers from spatial instability. Lighthouse [38] tackles this problem from the perspective of view synthesis and confirms the necessity for a 3D lighting representation. However, it does not address HDR information, and there is no guarantee that the inpainted lighting is physically correct. In this work, we leverage a holistic inverse rendering framework to enable physically correct HDR lighting prediction, whereby we only train on the LDR ground-truth data as in Lighthouse. + +Neural Scene Representations. Efficient 3D representation is a rapid area of research, such as voxels [27, 35], point clouds [1, 29] and implicit functions [28, 30, 36, 39]. DeepVoxels [35] and NeuralVolumes [27] use neural networks to predict voxel representations of scenes, where each voxel grid contains neural features or RGB values respectively. Zhou et al. [46] proposed to use multi-plane images, which is an voxelized representation for the camera frustum. When combined with volume rendering, these works enable predicting 3D properties but require only 2D supervision. Recent methods also show promising results with neural implicit functions [28, 30, 36], which represent the scene as a continuous volumetric function and approximate with a neural network. Our proposed Volumetric Spherical Gaussian draws inspiration from 3D scene representations and augments the RGB representation with view-dependent effects to better handle directional lighting. + +# 3. Lighting Representation + +To invert the rendering process, we require a flexible, structured representation of 3D spatially-varying lighting. + +![](images/5a90cc713b75e6573bbcb698d45ce5befe221105b5461783eb2b351ec0b20eb5.jpg) +Figure 2: Model overview. Our model consists of 4 submodules (a-d). Direct Prediction Module (a) takes a single image as input and jointly predicts initial guess of intrinsic properties. Lighting Joint Prediction Module (b) consumes the initial prediction and predicts a 3D lighting volume. With Differentiable Re-rendering Module (c) re-renders the input image by raytracing, Joint Re-prediction Module (d) finally jointly refines the initial prediction. + +Ideally, a model of the light field should capture variation in radiance due to changes in both spatial location and viewing angle. Prior works [11, 22] represent lighting with the radiance incident at the visible surface, making the direct extension to 3D intractable. To address this issue, we propose to use Volumetric Spherical Gaussian (VSG) to represent the surface radiance extant from the full scene, including both visible surfaces and surfaces outside the FoV. Illumination at any spatial location and viewing angle can then be rendered using standard volume rendering techniques. + +VSG is a voxel-based representation of a scene. We assign an opacity $\alpha \in [0,1]$ to each voxel, as well as a set of spherical Gaussian parameters $\mathbf{c} \in \mathbb{R}^3$ , $\pmb{\mu} \in \mathbb{R}^3$ , $\sigma \in \mathbb{R}_+$ such that the radiance at a viewing angle $\pmb{v} \in \mathbb{R}^3$ is defined: + +$$ +G (\boldsymbol {v}; \boldsymbol {c}, \boldsymbol {\mu}, \sigma) = c e ^ {- (1 - \boldsymbol {v} \cdot \boldsymbol {\mu}) / \sigma^ {2}} \tag {1} +$$ + +Intuitively, every voxel is a light source, where $\pmb{c}$ represents HDR RGB intensity, $\pmb{\mu}$ is the lobe axis and $1 / \sigma^2$ indicates sharpness. For a voxel grid of size $X\times Y\times Z$ , VSG represents the lighting as an 8-channel tensor $L\in \mathbb{R}^{8\times X\times Y\times Z}$ . + +To calculate incident radiance for a point $\pmb{p} \in \mathbb{R}^3$ with direction $l \in \mathbb{R}^3$ in a VSG $L$ , we select $N$ equi-spaced points along the ray. We then calculate the radiance $\mathcal{R}(\pmb{p}, l, L) \in \mathbb{R}^3$ using alpha compositing + +$$ +\mathcal {R} (\boldsymbol {p}, \boldsymbol {l}, L) = \sum_ {k = 1} ^ {N} \prod_ {i = 1} ^ {k - 1} (1 - \alpha_ {i}) \alpha_ {k} G (- \boldsymbol {l}; \boldsymbol {c} _ {k}, \boldsymbol {\mu} _ {k}, \sigma_ {k}). \quad (2) +$$ + +where $c_k, \mu_k, \sigma_k$ and $\alpha_k$ are determined by indexing into the lighting volume $L$ . With $\alpha$ -channel indicating the opacity of voxels, we can also render "depth" with Eq. 2 by replacing the spherical Gaussian with the voxel depth values. + +Compared to recent works that use an $\mathrm{RGB}\alpha$ volume to render appearance [30, 38], the VSG lighting representation additionally controls the emission direction and sharpness of light sources, and thus can capture view-dependent effects and handle strong directional lighting. Note that for $\sigma \gg 1$ , our VSG reduces to an $\mathrm{RGB}\alpha$ representation. + +# 4. Method + +Our monocular inverse rendering model jointly estimates albedo, normals, depth and a 3D Volumetric Spherical Gaussian lighting representation. To jointly predict intrinsic prop + +erties and 3D VSG lighting from a single image, we split our pipeline into four submodules, with three neural network modules and one differentiable rendering module. The overall architecture is shown in Fig. 2. + +First, the Direct Prediction Module makes an initial prediction of the intrinsic properties and extracts a global lighting feature from an input image. The Joint Prediction Module lifts these properties into 3D and jointly predicts a lighting volume. Then, the Differentiable Re-rendering Module re-renders the input image using the current predicted intrinsics and lighting. Finally, the Joint Re-prediction Module conditions on the current prediction and re-rendering error, and jointly refines the initial predictions. + +We describe the architecture of each submodule in Sec. 4.1 and present our training scheme in Sec. 4.2. + +# 4.1. Model Design + +Direct Prediction Module. The purpose of the Direct Prediction Module is to make an initial prediction of the albedo, normal, depth and a global feature which encodes lighting information, given a single image as input. + +The backbone of the Direct Prediction Module is a multi-branch ResNet [14] $h_{\mathrm{DP}}$ that consumes a single linearized RGB image $I \in \mathbb{R}^{3 \times H \times W}$ and predicts albedo $\tilde{A} \in \mathbb{R}^{3 \times H \times W}$ , surface normals $\tilde{N} \in \mathbb{R}^{3 \times H \times W}$ , depth $\tilde{D} \in \mathbb{R}^{H \times W}$ and a global feature vector $\tilde{\mathbf{f}}_L \in \mathbb{R}^C$ that is used by the downstream Lighting Joint Prediction Module as a "Lighting Global Feature" + +$$ +\tilde {A}, \tilde {N}, \tilde {D}, \tilde {\mathbf {f}} _ {L} = h _ {\mathrm {D P}} (I; \Theta_ {\mathrm {D P}}). \tag {3} +$$ + +Lighting Joint Prediction Module. Unlike albedo, normals, and depth, our lighting representation as defined in Sec. 3 is volumetric: $\hat{L} \in \mathbb{R}^{8 \times X \times Y \times Z}$ . Our lighting decoding network is shown in Fig. 3 and described below. + +We extract features to predict the lighting volume from two different sources. The first source is the global feature vector $\tilde{\mathbf{f}}_L$ . We use an MLP decoder $h_{\mathrm{GFD}}$ to map the global feature into a Scene Global Feature Volume. Let $(x,y,z)$ be the center coordinates of a given voxel. The feature at the corresponding voxel is computed as: + +$$ +\boldsymbol {z} _ {g} = h _ {\mathrm {G F D}} (x, y, z, \tilde {\mathbf {f}} _ {L}). +$$ + +![](images/1645295a2f25753ba00091822a612c40cd01196a62d32f3173593e53934fb1dd.jpg) +Figure 3: Architecture of Lighting Joint Prediction Module. We fuse the unprojected visible FoV information (top) and global scene information (bottom), and process them with a 3D UNet. The output is the Volumetric Spherical Gaussian lighting. + +Compared to a sequence of 3D transpose convolution which can achieve similar functionality, this MLP module is more flexible and can naturally extend to multi-view input. We refer to Appendix for more implementation details. + +The other sources of features for the lighting volume are the properties within the visible FoV, including input image $I$ , predicted albedo $\tilde{A}$ , normal $\tilde{N}$ , and depth $\tilde{D}$ . We unproject this visible FoV information into a Visible Surface Lighting Volume and process it with a 3D UNet. Given camera intrinsics, let $(u_p, v_p)$ be the projection of the center point of the voxel onto the input image with depth $d_p$ , let $\tilde{D}_p, \tilde{N}_p, \tilde{A}_p$ be the depth, normal, and albedo predicted by $h_{\mathrm{DP}}$ at the pixel $(u_p, v_p)$ , and let $I_p$ be the RGB values of the input image at that pixel. For each voxel, we define its "local" features as: + +$$ +\boldsymbol {z} _ {l} = k I _ {p}, k \tilde {N} _ {p}, k \tilde {A} _ {p} \tag {4} +$$ + +where $k = e^{-\frac{(d_p - \bar{D}_p)^2}{2\sigma_d^2}}$ is the Gaussian distance of depth between the voxel and the corresponding pixel, and $\sigma_{d}$ is a hyper-parameter with units of length that we set to 0.15 meters. Intuitively, the factor $k$ zeros out local features for voxels that are far from 2D surface manifold as determined by the depth output from $h_{\mathrm{DP}}$ . + +We fuse the global features $\mathbf{z}_g\in \mathbb{R}^{C\times X_g\times Y_g\times Z_g}$ and local features of the visible FoV $\mathbf{z}_l\in \mathbb{R}^{9\times X\times Y\times Z}$ , and process them through a 3D CNN $h_{\mathrm{JP}}$ : + +$$ +\hat {L} = h _ {\mathrm {J P}} \left(\mathbf {z} _ {g}, \mathbf {z} _ {l}; \Theta_ {\mathrm {J P}}\right), \quad \hat {L} \in \mathbb {R} ^ {8 \times X \times Y \times Z} \tag {5} +$$ + +where $\hat{L}$ is the output VSG containing HDR intensity. + +Differentiable Re-rendering Module. A valuable source of supervision and inductive bias in inverse rendering comes from the fact that the input image should be retrieved if the predicted geometry and reflectance is re-rendered. + +We use the Lambertian reflectance model for re-rendering. For each pixel, let $\pmb{p} = (x_p, y_p, \tilde{D}_p)$ be the 3D location of the pixel $p$ with predicted depth $\tilde{D}_p$ . To compute lighting at each pixel, we choose $K$ equi-angular lighting directions $\{l\}_{K}$ on the upper hemisphere with Fibonacci lattice [12]. For each lighting direction $l$ , we query the lighting volume and compute the radiance along the ray $\mathcal{R}(\pmb{p}, l, \hat{L})$ with Eq. 2. + +Let $\tilde{A}_p$ and $\tilde{N}_p$ be albedo and normal predicted in pixel $p$ . We render LDR RGB values following Lambertian model: + +$$ +\tilde {I} _ {p} = \varphi \left(\sum_ {\boldsymbol {l} \in \{\boldsymbol {l} \} _ {K}} \frac {\tilde {A} _ {p}}{\pi} \odot \mathcal {R} (\boldsymbol {p}, \boldsymbol {l}, \hat {L}) \max (\boldsymbol {l} \cdot \tilde {N} _ {p}, 0) \Delta \Omega\right) \tag {6} +$$ + +where $\odot$ is an element-wise product, $\frac{1}{\pi}$ is the energy conservation ratio and $\Delta \Omega$ is the differential solid angle. Here, $\varphi$ is the function to clip the HDR lighting intensity values to LDR values within [0, 1]. To make this process differentiable, we use a soft clipping with the exponential function: + +$$ +\varphi (x) = \left\{ \begin{array}{l l} x & \text {i f} x \leq \tau \\ 1 - (1 - \tau) e ^ {- \frac {x - \tau}{1 - \tau}} & \text {i f} x > \tau \end{array} \right. \tag {7} +$$ + +We use $\tau = 0.9$ in our model. + +Joint Re-prediction Module. Reflectance, shape and lighting are inherently correlated through the rendering process. To refine albedo, normals, and depth, we use a fullyconvolutional network that takes as input the initial prediction $\tilde{A}$ , $\tilde{N}$ , $\tilde{D}$ , the rerendering error $\tilde{E} = I - \tilde{I}$ , and input image $I$ . To incorporate the predicted lighting $\hat{L}$ , we also concatenate shading $\tilde{S}$ , which indicates how albedo changes affect the re-rendered image, and the Jacobian of shading with respect to the normals $\frac{\partial\tilde{S}}{\partial\tilde{N}}$ , which indicates how the normals' change affect the output shading. At each pixel $p$ , $\tilde{S}$ and $\frac{\partial\tilde{S}}{\partial\tilde{N}}$ have values given by the analytic formulas + +$$ +\tilde {S} _ {p} = \sum_ {\boldsymbol {l} \in \{\boldsymbol {l} \} _ {K}} \mathcal {R} (\boldsymbol {p}, \boldsymbol {l}, \hat {L}) \max (\boldsymbol {l} \cdot \tilde {N} _ {p}, 0) \Delta \Omega +$$ + +$$ +\frac {\partial \tilde {S}}{\partial \tilde {N} _ {p}} = \sum_ {\boldsymbol {l} \in \{l \} _ {K}} \mathbb {1} _ {\boldsymbol {l} \cdot \tilde {N} _ {p} > 0} \mathcal {R} (\boldsymbol {p}, \boldsymbol {l}, \hat {L}) \otimes \boldsymbol {l} \Delta \Omega \tag {8} +$$ + +where $\otimes$ is the outer product. Note that much of the computation required for shading can be cached during Lambertian rendering given by Eq. 6. The fully-convolutional network predicts an updated albedo $\hat{A}$ , normals $\hat{N}$ , and depth $\hat{D}$ + +$$ +\hat {A}, \hat {N}, \hat {D} = h _ {\mathrm {J R}} (I, \tilde {E}, \tilde {A}, \tilde {N}, \tilde {D}, \tilde {S}, \frac {\partial \tilde {S}}{\partial \tilde {N}}). \tag {9} +$$ + +# 4.2. Training + +We train our model on synthetic data with groundtruth $\{I, A, N, D, \{I_{\mathrm{nv}}, P_{\mathrm{nv}}\}_N\}$ , where $A, N, D$ denote albedo, normals, depth, and $\{I_{\mathrm{nv}}, P_{\mathrm{nv}}\}_N$ are LDR panoramic images and camera poses from $N$ novel views. With a volumetric lighting representation, we not only eliminate the need for the densely rendered spherical lobe lighting GT used in past works [22, 26], but also improve angular frequency. + +The loss for training comes from two parts: (1) direct supervision, which directly enforces consistency with the synthetic groundtruth, and (2) re-rendering loss that encourages the re-rendered image to recover the input image. + +Direct Supervision for Reflectance and Shape. We use L2 loss for albedo. Since albedo is usually piecewise constant, we additionally penalize the gradient of albedo where groundtruth is locally constant. We define + +$$ +\mathcal {L} _ {\text {a l b e d o}} = \left\| A - \hat {A} \right\| _ {2} ^ {2} + \lambda_ {\text {l o c a l}} \left\| \nabla \hat {A} \odot M _ {\text {l o c a l}} \right\| _ {1} \tag {10} +$$ + +where $M_{\mathrm{local}} \in \mathbb{R}^{H \times W}$ is a mask indicating regions in the ground-truth albedo where the albedo is constant. + +For normals, the network output is normalized and we use L1 angular error as supervision: + +$$ +\mathcal {L} _ {\text {n o r m a l}} = \left| \left| \cos^ {- 1} \left(N \cdot \frac {\hat {N}}{| \hat {N} |}\right) \right| \right| _ {1}. \tag {11} +$$ + +Because depth is high dynamic range, we follow [22] and use log-encoded L2 loss. We also use scale invariant L2 loss to encourage relative consistency due to the inherent scale ambiguity of depth: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {d e p t h}} = \left| \left| \log (D + 1) - \log (\hat {D} + 1) \right| \right| _ {2} ^ {2} \tag {12} \\ + \lambda_ {\mathrm {s i}} | | D - c _ {\mathrm {s i}} \hat {D} | | _ {2} ^ {2} \\ \end{array} +$$ + +where $c_{\mathrm{si}} = \arg \min_c||D - c\hat{D} ||_2^2 = \frac{\sum_p\hat{D}_p\cdot D_p}{\sum_p\hat{D}_p\cdot\hat{D}_p}$ is a scale factor computed on-the-fly for each image. + +Direct Supervision for Lighting. Recall that the pixel values in LDR images reflect the HDR radiance along the corresponding camera ray, after intensity clipping. Thus, we can use photometric loss of LDR panoramic images $I_{\mathrm{nv}}$ to supervise the LDR part of the predicted lighting $\hat{L}$ . + +For each pixel $p$ , we use the camera pose $P_{\mathrm{nv}}$ and camera intrinsics to compute the corresponding camera ray starting from the camera center $c$ in the direction $r$ . To render the novel view $\hat{l}_{\mathrm{nv},p}$ using the predicted lighting volume $\hat{L}$ , we compute HDR radiance with Eq. 2, and convert to LDR using a soft clipping function $\varphi$ defined in Eq. 7: + +$$ +\hat {I} _ {\mathrm {n v}, p} = \varphi (\mathcal {R} (\boldsymbol {c}, \boldsymbol {r}, \hat {L})) \tag {13} +$$ + +We enforce this rendered novel view $\hat{I}_{\mathrm{nv}}$ to be consistent with groundtruth $I_{\mathrm{nv}}$ using L2 loss. To encourage realistic details, we also use the adversarial loss $\mathcal{L}_{\mathrm{adv}}$ with a discriminator $\mathcal{D}$ . + +$$ +\begin{array}{l} \mathcal {L} _ {\text {l i g h t}} = \mathcal {L} _ {\mathrm {n v}} + \lambda_ {\mathrm {a d v}} \mathcal {L} _ {\mathrm {a d v}} \tag {14} \\ = \left\| I _ {\mathrm {n v}} - \hat {I} _ {\mathrm {n v}} \right\| _ {2} ^ {2} - \lambda_ {\mathrm {a d v}} \mathcal {D} (\hat {I} _ {\mathrm {n v}}) \\ \end{array} +$$ + +The loss for the discriminator $\mathcal{D}$ is + +$$ +\mathcal {L} _ {\mathrm {D}} = \max (0, 1 - \mathcal {D} \left(I _ {\mathrm {n v}}\right)) + \max (0, 1 + \mathcal {D} \left(\hat {I} _ {\mathrm {n v}}\right)). \tag {15} +$$ + +Another source of supervision for lighting is consistency with visible FoV, i.e. the image $I$ and depth $D$ . We define $\mathcal{L}_{\mathrm{visible}}$ as the L2 loss between $I$ , $D$ and the rendered perspective RGB image and depth ( $\alpha$ -channel) from the lighting volume using Eq. 2. Since the surface is sparse in the scene, we also encourage the $\alpha$ -channel of the lighting volume to be either 0 or 1 with a regularization loss $\mathcal{L}_{\mathrm{reg}} = -\alpha \log(\alpha)$ . The training signal is fully differentiable and backpropagated to supervise the predicted VSG lighting parameters. + +Re-rendering Loss. We use the predicted albedo, normals and lighting to reconstruct an image $\hat{I}$ and enforce its consistency with the original input image $I$ . Specifically, we compute Lambertian re-rendered image in the energy conserved form defined in Eq. 6, and use L2 loss as the re-rendering loss $\mathcal{L}_{\mathrm{rerender}} = ||\hat{I} -\hat{I} ||_2^2$ + +The re-rendering loss encourages joint reasoning of albedo, geometry and lighting, and can be used for self-supervised training on real world images as discussed in prior works [33]. In our formulation, the re-rendering loss significantly improves lighting prediction by enforcing the model to learn physically correct lighting and to recover HDR information. This benefit comes from the formulation of the energy-conserving image formation process. Any physically incorrect lighting prediction, such as a LDR prediction or a uniform lighting, will lead to an error in the re-rendered image. In Eq. 14, we only supervise LDR lighting appearance with LDR images. With the complementary re-rendering loss, our model automatically learns to recover HDR lighting even when trained only with LDR images. + +Training Scheme. Our model is end-to-end trainable. We adopt a progressive training scheme to ensure the model components act as expected. We first pretrain albedo, normal and depth branches of our Direct Prediction Module. This is because our Lighting Joint Prediction Module (Fig. 3) depends on these properties, and pretraining these branches can make sure they produce reasonable values. Then we jointly train the Direct Prediction Module and Lighting Joint Prediction Module with the multi-task loss + +$$ +\begin{array}{l} \mathcal {L} = \lambda_ {A} \mathcal {L} _ {\text {a l b e d o}} + \lambda_ {N} \mathcal {L} _ {\text {n o r m a l}} + \lambda_ {D} \mathcal {L} _ {\text {d e p t h}} + \lambda_ {L} \mathcal {L} _ {\text {l i g h t}} \\ + \lambda_ {\text {v i s i b l e}} \mathcal {L} _ {\text {v i s i b l e}} + \lambda_ {\text {r e g}} \mathcal {L} _ {\text {r e g}} + \lambda_ {\text {r e r e n d e r}} \mathcal {L} _ {\text {r e r e n d e r}}. \tag {16} \\ \end{array} +$$ + +After the first two submodules are trained, we freeze their weights and train the Joint Re-prediction Module for albedo, normals and depth. Finally, we jointly finetune all three modules end-to-end with a multi-task loss on both the joint prediction $\hat{A},\hat{N},\hat{D},\hat{L}$ and intermediate output $\tilde{A},\tilde{N},\tilde{D}$ . + +# 5. Experiments + +We compare our method with prior methods both qualitatively and quantitatively, and validate the effectiveness of our unified inverse rendering framework. We also compare against prior methods on lighting estimation and showcase application on virtual object insertion, demonstrating our method's ability to create high-quality insertion results. + +# 5.1. Experiment Settings + +Implementation Details. The resolution of initialized visible surface volume and predicted VSG lighting is $128^{3}$ . Despite using a $128^{3}$ volume, our model is much lighter than Lighthouse [38] which contains six 3D UNet subnetworks. With a batch size of 1, our model consumes 7.5G + +
MethodAlbedo si-MSENormal Angular ErrorDepth si-MSE
SIRFS [2]0.045356.75°-
NIR [33]0.018820.35°-
Ours (w/o JR)0.019019.09°0.217
Ours (JR w/o lighting)0.017718.63°0.189
Ours0.017518.40°0.181
+ +Table 1: Evaluation of albedo, normals and depth on InteriorNet dataset. + +
MethodPSNR (dB)
NIR [33]15.39
Lighthouse* [38]17.29
Ours (Lalbedo, Lnormal, Ldepth, Llight only)16.43
+Lvisible17.06
+Lreg17.33
+Lrender17.37
Ours (w/o SG)16.94
+ +Table 2: Evaluation of lighting on InteriorNet dataset. * indicates use of a stereo pair as input. + +
MethodWHDR
SIRFS [2]31.4
NIR [33]18.5
Ours (w/o JR)18.7
Ours18.2
+ +Table 3: Evaluation of albedo on IIW dataset. + +
MethodNormal Angular ErrorDepth si-MSE
NIR [33]23.94°0.3216
Ours (w/o JR)23.89°0.3196
Ours22.95°0.2827
+ +Table 4: Evaluation of normals and depth on NYUv2 dataset. + +
Re-rendering MSE (×10-2)InteriorNet [21]NYUv2 [31]
NIR (env. map only) [33]2.364.02
NIR [33]0.992.61
Ours (w/o Re-render Loss)2.185.26
Ours (w/o SG)1.412.72
Ours0.892.33
Ours (w/ real-world tuning)0.921.98
+ +Table 5: Quantitative results of re-rendering error. + +GPU memory compared to Lighthouse's 15G during training. For Differentiable Re-rendering Module, we sample $K = 50$ rays per pixel and $N = 128$ points per ray. For each pixel, we share the rays of its 8-neighbors to get $K' = 450$ rays per pixel. The re-rendering is implemented considering parallelism. Resolution of re-rendering is 60x80 during training. Inference times of Direct Prediction, Lighting Joint Prediction, Differentiable Re-rendering and Joint Reprediction Modules are 20ms, 130ms, 140ms, 12ms respectively, clocked on a TITAN V GPU. + +Training Data. We train our model on the InteriorNet dataset [21], which contains realistic renderings of camera sequences in diverse indoor scenes. Each camera sequence contains 1000 rendered LDR perspective images with albedo, normals and depth groundtruth, and 1000 LDR panoramic images rendered in the corresponding viewpoint using path tracing. We use LDR perspective images as input and supervise albedo and geometry with paired GT. To supervise lighting, we sample adjacent panoramic images rendered at locations that are visible in the perspective input image. This makes the environment maps lie in our region of interest, i.e. in front of the camera. We follow the data split and preprocessing from [38]. We use $90\%$ (1472) of the scenes to train our model and reserve $10\%$ (162) for evaluation. + +When evaluating on real world data, we also finetune our model on IIW dataset [6] for albedo and NYUv2 dataset [31] for depth and normal. We also collected 120 indoor LDR panoramas from the internet and jointly train lighting on these panoramas. More details are included in the Appendix. + +Evaluation. We evaluate albedo, normals and depth prediction on InteriorNet [21] and real-world datasets IIW [6] and NYUv2 [31]. For quantitative comparison, we use scale-invariant MSE (si-MSE) for albedo and depth due to scale ambiguity. We use mean angular error for normals and + +PSNR for lighting. We report the re-rendering MSE between re-rendered image and input image, which indicates whether the prediction is physically correct. The most effective lighting evaluation is through qualitative results. We compare with prior works by visualizing object insertion results and the predicted environment map at a given location. + +Baselines. We quantitatively compare our methods with the state-of-the-art NIR [33] and the classic optimization-based method SIRFS [2]. In all experiment settings, we re-train NIR on the same data, i.e. InteriorNet, to ensure a fair comparison. Li et al. [22] requires dense per-pixel lighting supervision and cannot train on the same data sources, and thus we provide qualitative comparison on the lighting prediction. For lighting estimation, we also compare with current state-of-the-art method Lighthouse [38], which uses a stereo image pair as input instead of a monocular image. + +# 5.2. Evaluation of Albedo and Shape + +Evaluation on InteriorNet. We compare with baseline methods and ablate our model choices on InteriorNet. As shown in Table 1, the performance of SIRFS exemplifies the limits of optimization-based methods on images of complex scenes. Our method outperforms NIR, indicating that our method better disambiguates the intrinsic properties. We also ablate our method. Predicted output from Direct Prediction Module is shown as "Ours (w/o JR)". Results show that the Joint Re-prediction Module helps improve the performance with the benefits of joint reasoning over the initial prediction. By comparing "Ours" and "Ours (JR w/o lighting)", the quantitative evaluation shows that the properties related to lighting (Eq. 8) helps improve the overall performance. We provide qualitative results of albedo, normals and depth in Fig. 4. Results show that the Joint Re-prediction Module further disambiguates the intrinsic properties based on initial prediction and produces higher quality prediction. + +Evaluation on real-world data. We evaluate albedo prediction on the IIW dataset [6], which provides sparse pairwise human annotations. We use the official Weighted Human Disagreement Rate (WHDR) as the metric, which measures the error when albedo prediction disagrees with human perception, and the results are shown in Table 3. We also evaluate normal and depth prediction on the NYUv2 dataset in Table 4. Our method outperforms baselines and validates the effectiveness of our Joint Re-prediction Module. Similar to prior works [22, 33], we focus on the holistic inverse rendering framework and do not compete with state-of- + +![](images/192f0758bc6c43c17a7ca63cbef997ca0fa853b9d979fa5117d519db36054a2d.jpg) +Input image + +![](images/5802a682b7a9ae7ef81cddaf717372b48279f4a453a2bc6d0d103498b5ba49c0.jpg) +GT Albedo +Ours (w/o JR) +Ours + +![](images/65623d66ab20f25a1f9d7628b5ee63b02c3340936bc38af1ad7493e4805431fb.jpg) +GT Normal +Ours (w/o JR) + +![](images/40851b9cd444f830a0884e19f5790c56ceec9548dfe141d360f2c787076228e2.jpg) +Ours + +![](images/1ab3843d26a512c8af3193139248a806dd12be5226b761648206df728d17ed3f.jpg) +GT Depth +Ours (w/o JR) +Ours + +![](images/3752a7c768ab067b8da41e58c675fcda7ce6964f5df2678e14fd4b0a054eb864.jpg) +Figure 4: Qualitative results of predicted albedo, normals and depth. The results are GT, our model without Joint Re-prediction (JR) Module and our full model. Joint Re-prediction enables joint reasoning and obtains crisp and more accurate results. +Input image +NIR [33] +Ours +NIR [33] +Ours +NIR (env. map only) +NIR [33] +Ours +Figure 5: Qualitative comparison on predicted albedo, normals and re-rendered image. Our fully physics-based lighting representation and differentiable renderer can better disambiguate and reproduce complex lighting effects with less artifacts. + +the-art depth and normal estimation methods with specially designed architecture and other data sources [15, 19]. + +Evaluation of re-rendered images. We compare re-rendering error with baselines on InteriorNet and NYUv2 in Table 5. NIR uses environment map as lighting representation, and employs a non-interpretable neural renderer, named residual appearance renderer (RAR), to account for all other lighting effects. Our method outperforms NIR both with and without the neural rendering module. We also show qualitative results of re-rendered images in Fig. 5. Compared to the environment map re-rendering of NIR, we can handle 3D spatially-varying lighting and can re-render complex lighting effects, while NIR leaves these effects to the RAR module. Though addressing a more challenging task, our fully physics-based rendering process outperforms the RAR module which may easily produce artifacts and hurt the performance of other properties, such as artifacts in normals. + +We ablate our design choices in Table 5. The re-rendering loss, which enforces joint reasoning of different properties, is critical for physically correct predictions. By comparing our Volumetric Spherical Gaussian with $\mathrm{RGB}\alpha$ volume (Ours w/o SG), the results show that the spherical Gaussian volume increases the model capacity and leads to better re-rendering. We also tried jointly training on InteriorNet and 120 real-world LDR panoramas. We show that when evaluating on the real-world NYUv2 dataset, training on real-world LDR panoramas further improves performance. + +# 5.3. Evaluation of Lighting + +Quantitative Evaluation. We evaluate our lighting prediction on InteriorNet in Table 2. Our method significantly outperforms NIR [33] due to our 3D lighting representation that can handle spatially-varying lighting. Our method also outperforms Lighthouse [38], the current state-of-the-art + +method for lighting estimation. Note that Lighthouse uses stereo pairs as input, which provides more information about depth and visible surface than monocular image. For the ablation study, empirical results indicate that our loss design is key in achieving the best performance. Compared to RGB $\alpha$ volume, our Volumetric Spherical Gaussian is able to capture view-dependent effects and brings better performance. + +Qualitative Evaluation. We qualitatively compare the lighting estimation and virtual object insertion results with baselines in Fig. 6 on InteriorNet. Note that the inserted light probe is highly specular. NIR uses a single low-resolution environment map, which cannot handle spatially-varying effects and only recovers low frequency lighting, thus causing severe artifacts. Li et al. [22] employs 2D spatially-varying spherical Gaussian which can produce spatially-varying lighting, but the local lighting is still low frequency spherical lobes and cannot account for angular high-frequency details. These methods fail for inserting highly specular objects. Lighthouse [38] is using a volumetric RGB $\alpha$ lighting representation, which allows for 3D spatially-varying lighting. But the lighting volume in Lighthouse is learned with voxel inpainting from LDR panoramas, without supervision signal to make it physically correct, and cannot predict HDR lighting. We can observe Lighthouse's lighting prediction has significantly less intensity variation, and the predicted LDR lighting cannot produce realistic cast shadows. + +Our method, with the Volumetric Spherical Gaussian lighting, produces more visually pleasing results with more realistic details. The re-rendering loss in our method enables joint reasoning and ensures that the model predicts physically correct HDR outputs due to the energy constraints. Our method is the only one that both preserves angular details and predicts HDR output for realistic cast shadows. Note the predicted cast shadows by our method are consistent with + +![](images/a2c4afd13b42b877174248118a7cf33f0aeb0a7c180a21c7423ba23dd475da09.jpg) +Figure 6: Qualitative comparison of lighting estimation. We compare insertion of a purely specular sphere, and on the bottom-left of each example displays the estimated environment map at the inserted location. Our method produces both angular details (env. map) and realistic cast shadows with HDR, outperforming all competing methods. (* indicates use of a stereo pair as input. Best viewed zooming in.) + +![](images/811b3ad3802e45477577db4ce826f6ed12be1d7c05d9e0e52277ab91906f98c7.jpg) +Figure 7: Qualitative comparison of lighting estimation on real-world images. We compare purely specular object insertion on the left, and on the right is mostly diffuse object. The top row shows insertion on a solid surface while bottom row shows freely inserted objects in 3D. Our method produces more realistic results in both specular and diffuse settings and is spatially consistent. (Best viewed zooming in.) + +![](images/a77b0f4645b26f967e788ed1908e123961d3db4a1c7fc1c81fc8b6a2ca42ddf3.jpg) +Figure 8: Qualitative results of object insertion on real-world images. From left to right, we insert a bunny, kettle, cart and armchair. + +other visual cues in the scene (Top: lamp; Bottom: desk). + +We compare with prior works on real world data in Fig. 7. Here, we do not compare with Lighthouse as it requires stereo images. Comparing purely specular spheres on the left, our method preserves angular high-frequency details and is significantly more realistic. These benefits also apply to the diffuse spheres on the right. In the bottom row, spheres are from randomly sampled 3D locations. NIR [34] uses a single environment map and can hardly capture spatial variation. Li et al. [22] uses 2D lighting representation, which cannot produce spatially consistent lighting and also cannot handle locations far from the 2D surfaces, leading to severe artifacts. Our method produces spatially coherent lighting with correct HDR intensity. We also show real-world object insertion results in Fig. 8. Our method generalizes well to real-world images and consistently produces realistic shading and shadows. More results are included in the Appendix. + +# 6. Conclusion + +In this paper, we proposed a holistic monocular inverse rendering framework that jointly estimates albedo, normals, depth, and HDR light field. Our proposed Volumetric Spherical Gaussian representation nicely handles spatial and angular high-frequency details. With the physically based differentiable renderer, our method is capable of learning and reproducing the complex indoor lighting effects, and better disambiguate image inclusions. Benefiting from joint training with the re-rendering constraint, our model can predict physically correct HDR lighting, despite being trained with only LDR images. We experimentally demonstrate that our model outperforms prior work on standard benchmarks, and is able to realistically render virtual objects in images with realistic shadows and high-frequency details, even when the objects are highly specular. We believe that these results demonstrate great promise of our model for AR applications. + +# References + +[1] Kara-Ali Aliev, Dmitry Ulyanov, and Victor Lempitsky. Neural point-based graphics. arXiv preprint arXiv:1906.08240, 2(3):4, 2019. 2 +[2] Jonathan T Barron and Jitendra Malik. Shape, illumination, and reflectance from shading. IEEE transactions on pattern analysis and machine intelligence, 37(8):1670-1687, 2014. 1, 2, 6 +[3] Harry Barrow, J Tenenbaum, A Hanson, and E Riseman. Recovering intrinsic scene characteristics. Comput. Vis. Syst, 2:3-26, 1978. 1, 2 +[4] H. Barrow and J. M. Tenenbaum. Recovering intrinsic scene characteristics from images. 1978. 2 +[5] Anil S Baslamisli, Thomas T Groenestege, Partha Das, Hoang-An Le, Sezer Karaoglu, and Theo Gevers. Joint learning of intrinsic images and semantic segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 286-302, 2018. 1 +[6] Sean Bell, Kavita Bala, and Noah Snavely. Intrinsic images in the wild. ACM Transactions on Graphics (TOG), 33(4):159, 2014. 2, 6 +[7] Mark Boss, Varun Jampani, Kihwan Kim, Hendrik Lensch, and Jan Kautz. Two-shot spatially-varying brdf and shape estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3982-3991, 2020. 2 +[8] Adrien Bousseau, Sylvain Paris, and Frédo Durand. User-assisted intrinsic images. In ACM Transactions on Graphics (TOG), volume 28, page 130. ACM, 2009. 2 +[9] Marc-Andre Gardner, Yannick Hold-Geoffroy, Kalyan Sunkavalli, Christian Gagne, and Jean-François Lalonde. Deep parametric indoor lighting estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 7175–7183, 2019. 2 +[10] Marc-Andre Gardner, Kalyan Sunkavalli, Ersin Yumer, Xiaohui Shen, Emiliano Gambaretto, Christian Gagne, and Jean-François Lalonde. Learning to predict indoor illumination from a single image. arXiv preprint arXiv:1704.00090, 2017. 1, 2 +[11] Mathieu Garon, Kalyan Sunkavalli, Sunil Hadap, Nathan Carr, and Jean-François Lalonde. Fast spatially-varying indoor lighting estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6908-6917, 2019. 1, 2, 3 +[12] Álvaro González. Measurement of areas on a sphere using fibonacci and latitude-longitude lattices. Mathematical Geosciences, 42(1):49-64, 2010. 4 +[13] R. Grosse, M. K. Johnson, E. H. Adelson, and W. T. Freeman. Ground truth dataset and baseline evaluations for intrinsic image algorithms. In 2009 IEEE 12th International Conference on Computer Vision, pages 2335-2342, 2009. 2 +[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. 3 +[15] Steven Hickson, Karthik Raveendran, Alireza Fathi, Kevin Murphy, and Irfan Essa. Floors are flat: Leveraging semantics + +for real-time surface normal prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0-0, 2019. 7 +[16] Yannick Hold-Geoffroy, Akshaya Athawale, and Jean-François Lalonde. Deep sky modeling for single image outdoor lighting estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6927–6935, 2019. 2 +[17] Yannick Hold-Geoffroy, Kalyan Sunkavalli, Sunil Hadap, Emiliano Gambaretto, and Jean-François Lalonde. Deep outdoor illumination estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7312–7321, 2017. 2 +[18] Edwin H Land and John J McCann. Lightness and retina theory. Josa, 61(1):1-11, 1971. 2 +[19] Jin Han Lee, Myung-Kyu Han, Dong Wook Ko, and Il Hong Suh. From big to small: Multi-scale local planar guidance for monocular depth estimation. arXiv preprint arXiv:1907.10326, 2019. 7 +[20] Chloe LeGendre, Wan-Chun Ma, Graham Fyffe, John Flynn, Laurent Charbonnel, Jay Busch, and Paul Debevec. Deeplight: Learning illumination for unconstrained mobile mixed reality. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5918-5928, 2019. 2 +[21] Wenbin Li, Sajad Saeedi, John McCormac, Ronald Clark, Dimos Tzoumanikas, Qing Ye, Yuzhong Huang, Rui Tang, and Stefan Leutenegger. Interiornet: Mega-scale multi-sensor photo-realistic indoor scenes dataset. In British Machine Vision Conference (BMVC), 2018. 6 +[22] Zhengqin Li, Mohammad Shafiei, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Inverse rendering for complex indoor scenes: Shape, spatially-varying lighting and svbrdf from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2475-2484, 2020. 1, 2, 3, 4, 5, 6, 7, 8 +[23] Zhengqi Li and Noah Snavely. Cginintrinsics: Better intrinsic image decomposition through physically-based rendering. In Proceedings of the European Conference on Computer Vision (ECCV), pages 371-387, 2018. 2 +[24] Zhengqi Li and Noah Snavely. Learning intrinsic image decomposition from watching the world. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9039-9048, 2018. 2 +[25] Zhengqin Li, Zexiang Xu, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Learning to reconstruct shape and spatially-varying reflectance from a single image. ACM Transactions on Graphics (TOG), 37(6):1-11, 2018. 2 +[26] Zhengqin Li, Ting-Wei Yu, Shen Sang, Sarah Wang, Sai Bi, Zexiang Xu, Hong-Xing Yu, Kalyan Sunkavalli, Miloš Hasan, Ravi Ramamoorthi, et al. Openrooms: An end-to-end open framework for photorealistic indoor scene datasets. arXiv preprint arXiv:2007.12868, 2020. 4 +[27] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. arXiv preprint arXiv:1906.07751, 2019. 2 + +[28] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4460-4470, 2019. 2 +[29] Moustafa Meshry, Dan B Goldman, Sameh Khamis, Hugues Hoppe, Rohit Pandey, Noah Snavely, and Ricardo Martin-Brualla. Neural rerendering in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6878-6887, 2019. 2 +[30] Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. arXiv preprint arXiv:2003.08934, 2020. 2, 3 +[31] Pushmeet Kohli Nathan Silberman, Derek Hoiem and Rob Fergus. Indoor segmentation and support inference from rgbd images. In ECCV, 2012. 6 +[32] Geoffrey Oxholm and Ko Nishino. Shape and reflectance from natural illumination. In European Conference on Computer Vision, pages 528-541. Springer, 2012. 2 +[33] Soumyadip Sengupta, Jinwei Gu, Kihwan Kim, Guilin Liu, David W. Jacobs, and Jan Kautz. Neural inverse rendering of an indoor scene from a single image. In International Conference on Computer Vision (ICCV), 2019. 1, 2, 5, 6, 7, 8 +[34] Soumyadip Sengupta, Jinwei Gu, Kihwan Kim, Guilin Liu, David W. Jacobs, and Jan Kautz. Neural inverse rendering of an indoor scene from a single image. In ICCV, 2019. 8 +[35] Vincent Sitzmann, Justus Thies, Felix Heide, Matthias Nießner, Gordon Wetzstein, and Michael Zollhofer. Deepvoxels: Learning persistent 3d feature embeddings. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2437-2446, 2019. 2 +[36] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In Advances in Neural Information Processing Systems, pages 1121–1132, 2019. 2 +[37] Shuran Song and Thomas Funkhouser. Neural illumination: Lighting prediction for indoor environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6918-6926, 2019. 2 +[38] Pratul P Srinivasan, Ben Mildenhall, Matthew Tancik, Jonathan T Barron, Richard Tucker, and Noah Snively. Lighthouse: Predicting lighting volumes for spatially-coherent illumination. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8080-8089, 2020. 1, 2, 3, 5, 6, 7, 8 +[39] Towaki Takikawa, Joey Litalien, Kangxue Yin, Karsten Kreis, Charles Loop, Derek Nowrouzezahrai, Alec Jacobson, Morgan McGuire, and Sanja Fidler. Neural geometric level of detail: Real-time rendering with implicit 3D shapes. arXiv preprint arXiv:2101.10994, 2021. 2 +[40] Xin Wei, Guojun Chen, Yue Dong, Stephen Lin, and Xin Tong. Object-based illumination estimation with rendering-aware neural networks. arXiv preprint arXiv:2008.02514, 2020. 2 +[41] Ye Yu and William AP Smith. Inverserendernet: Learning single image inverse rendering. In Proceedings of the IEEE/CVF + +Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 +[42] Jinsong Zhang, Kalyan Sunkavalli, Yannick Hold-Geoffroy, Sunil Hadap, Jonathan Eisenman, and Jean-François Lalonde. All-weather deep outdoor lighting estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10158–10166, 2019. 2 +[43] Ruo Zhang, Ping-Sing Tsai, James Edwin Cryer, and Mubarak Shah. Shape-from-shading: a survey. IEEE transactions on pattern analysis and machine intelligence, 21(8):690-706, 1999. 2 +[44] Qi Zhao, Ping Tan, Qiang Dai, Li Shen, Enhua Wu, and Stephen Lin. A closed-form solution to retina with nonlocal texture constraints. IEEE transactions on pattern analysis and machine intelligence, 34(7):1437-1444, 2012. 2 +[45] Yiqin Zhao and Tian Guo. Pointar: Efficient lighting estimation for mobile augmented reality. arXiv preprint arXiv:2004.00006, 2020. 2 +[46] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. arXiv preprint arXiv:1805.09817, 2018. 2 \ No newline at end of file diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/images.zip b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c528323eeb3ab958946ff80a21d8a4a01701b493 --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee4e350bff34ee0f60a1afe41fc1b4c0a118ea06d183fbe67f91c3f590155c41 +size 581986 diff --git a/learningindoorinverserenderingwith3dspatiallyvaryinglighting/layout.json b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3651dd3588ead01a1fac792cc657f146b7daa888 --- /dev/null +++ b/learningindoorinverserenderingwith3dspatiallyvaryinglighting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2c548b43fe62f8e510a564bc2b6c50eabce93d09598d9b066a1b4bdb71dbf48 +size 473236 diff --git a/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_content_list.json b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf36b206140dbdaa5feffe7d73034399315eda9 --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f42e4b76a70302ca2dba4d695a071dbacf186ff13d39eb25fc549183ff1cdf96 +size 85815 diff --git a/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_model.json b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b2ce65f2522e15db0baf4a02e0255763f95a754c --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bb4328d359aaa237f79773ca112f82c080155303f3900c189879ae2ea1a2cf4 +size 106735 diff --git a/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_origin.pdf b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5280e463d5b7e385e504fae348592b215f8d4ba8 --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/691a6473-2304-4716-bb8b-d24295df8c5f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9f211b05a89f60e8bb4b7fc4b0284d35d973fdbd9014e4e4bc03da25ab7f6ba +size 890206 diff --git a/learninginnergrouprelationsonpointclouds/full.md b/learninginnergrouprelationsonpointclouds/full.md new file mode 100644 index 0000000000000000000000000000000000000000..47e15aba1f1caf3bd793bae1e664bea13e353609 --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/full.md @@ -0,0 +1,366 @@ +# Learning Inner-Group Relations on Point Clouds + +Haoxi Ran\* Wei Zhuo Jun Liu Li Lu\* Sichuan University Tencent {ranhaoxi, junsenselee}@gmail.com weizhuo@tencent.com luli@scu.edu.cn + +# Abstract + +The prevalence of relation networks in computer vision is in stark contrast to underexplored point-based methods. In this paper, we explore the possibilities of local relation operators and survey their feasibility. We propose a scalable and efficient module, called group relation aggregator. The module computes a feature of a group based on the aggregation of the features of the inner-group points weighted by geometric relations and semantic relations. We adopt this module to design our RPNet. We further verify the expandability of RPNet, in terms of both depth and width, on the tasks of classification and segmentation. Surprisingly, empirical results show that wider RPNet fits for classification, while deeper RPNet works better on segmentation. RPNet achieves state-of-the-art for classification and segmentation on challenging benchmarks. We also compare our local aggregator with PointNet++, with around $30\%$ parameters and $50\%$ computation saving. Finally, we conduct experiments to reveal the robustness of RPNet with regard to rigid transformation and noises. + +# 1. Introduction + +Point cloud processing has attracted considerable attention for its advantages in various applications, including autonomous driving, augmented reality, and robotics. Though easily accessible, unlike other visual elements (i.e., images), point clouds can be difficult to learn due to irregularity. + +To duplicate the success of convolutional networks on regular grids [24, 43], some prior works change point clouds into multi-view images [12, 10] or regular volumes [53, 12] before convolution. However, image-based projection and voxelization reduce the resolution of point clouds and result in the damage of internal geometric information. These explicit transformations also lead to complex preprocessing and significant computations. + +PointNet [38] diverts the attention to the methods of processing raw point clouds. To handle irregular points, it adopts point-wise multi-layer perceptrons (MLP) to learn + +on points independently and utilize a symmetric function to obtain the global information. For the ignorance of local structures, PointNet++ [40] further introduces set abstraction (SA) (shown in Fig. 1 left) as the local aggregator to build the hierarchical networks. However, this aggregator keeps learning on points independently, losing the sight of shape awareness. + +When a local aggregator independently learns on points, the shape ambiguity problem has been exposed: since no points inside the set react with others, the aggregator will be sensitive to the coordinates $S \in \mathbb{R}^{N \times 3}$ and be confused about the outline and the geometric information of the set. Here $N$ is the number of points inside the set. The shape ambiguity problem causes the damage to the robustness and generalization of an aggregator. + +In general, an excellent aggregator is underdeveloped for two reasons: it should discriminatively describe the underlying shape of point sets, and it should be robust to rigid transformation (i.e., translation, rotation) as well as noises. For a preliminary exploration, RS-CNN [33] computes a point feature from the aggregation of features weighted by predefined geometric relations (low-level relation) between the point $S_{i}$ and its neighbors $\mathcal{N}(S_i)$ (shown in Fig. 1 middle). Based on the low-level relations instead of coordinates only, RS-CNN is insensitive to coordinates and robust to rigid transformation. However, RS-CNN is insufficient to learn semantic relations (high-level relations) for the lack of interaction between features. + +In this case, self-attention [47] (shown in Fig. 1 right) may be a good instance as the supplement for high-level relations. Self-attention achieves great success on natural language processing. Recent work [64, 19] has shown that self-attention can be a viable alternative for convolution on images. However, self-attention can be depressing for significant computations as well as a large number of parameters. The goal of this work is to extend grid-based self-attention to irregular points with a high-efficiency strategy. + +To this end, we propose group relation aggregator (GRA) to learn from both low-level and high-level relations. Compared with self-attention and SA, our designed bottle + +![](images/e945c21105f023ad428c6fa55b7a5b31652870c06c32b4811f0e39f83cd41f41.jpg) +Figure 1. Comparison of some prior works. We input each module with one centroid (query) and its neighbors (keys) of features or coordinates. PointNet++ [40] (left) learns on points independently and lacks the interaction between points. RS-CNN [33] (middle) focuses on low-level relation learning, while self-attention (right) in Transformer [47] learns from high-level relations between features. Here the input group in self-attention is in the global scope. + +neck version of GRA is obviously efficient in terms of computation and the number of parameters. With bottleneck GRA, we construct the efficient point-based networks RPNet. + +Specifically, we construct each point set by taking a sampled point $S_{i}$ as the centroid and its neighbors $\mathcal{N}(S_i)$ , corresponding to features $\mathcal{F}_i$ and $\mathcal{N}(\mathcal{F}_i)$ respectively. To exploit a point set, we force GRA to learn attention of the set from both predefined geometric priors (i.e., Euclidean distance between $S_{i}$ and $\mathcal{N}(S_i)$ ) and feature-level interaction (i.e., mapping through a linear layer followed by matrix multiplication and scaled dot-product on $S_{i}$ and $\mathcal{N}(\mathcal{F}_i)$ ). By applying the attention to the transformed features $\mathcal{N}(\mathcal{F}_i)$ (i.e. mapping through a linear layer), the weighted features can reflect the geometric shape as well as semantic information of a point set. This proposed module benefits from the geometric priors in terms of shape awareness and robustness to rigid transformation, while the feature interaction enables the adaptation to content and the robustness to noises. + +Considering the efficiency of GRA, we introduce the bottleneck concept to this module. The output of the first linear layer has the identical channels to the input. We cut down its output channels with a specific factor. Though this behavior harms the model quality (discussed in [47]), we add a mapping after the relation operation. Cross-channel attention also helps the module to explore channel-wise. All the changes turn our module into a high-efficiency version. + +With our proposed module, we construct RPNet with respect to width (RPNet-W) and depth (RPNet-D). We then evaluate these two types of models on the datasets of classification (i.e., ModelNet40 [53]) and segmentation (i.e., ScanNet v2 [6], S3DIS [1]). The results show that our method outperforms point-based methods by a large margin, and even achieves comparable performance with all convolution-based methods in a state of high-efficiency. Interestingly, our model may obtain extra accuracy on classification by increasing the width, while deep model works + +better than wide model on segmentation in terms of efficiency and accuracy. + +Our key contributions are manifold: + +- A novel scalable local aggregator for point clouds is proposed. It encodes the geometric and semantic relations between points; +- An expandable and high-efficiency hierarchy RPNet is proposed. Equipped with the bottleneck version of our aggregator, extensive RPNet keeps efficient; +- Experiments on the challenging benchmarks of classification and segmentation, indicate that RPNet achieves state of the arts. + +# 2. Related Work + +# 2.1. Learning on Point Clouds + +Multi-view methods [10, 15, 54, 16, 39] describe a 3D object with multiple views from different viewpoints. Recent works have been proposed to recognize 3D shapes through convolutional neural networks, i.e., converting 3D shapes to 2D images [45] or lattice space [44]. However, this transformation results in the loss of shape information for self-occlusion, and a great number of views are required for decent performance. Voxel-based methods [53, 35, 12, 23, 5, 49, 42] apply volumetric CNN to recognize the 3D grids transformed from 3D shapes, i.e., the efficient submanifold sparse convolution [13]. The input 3D grid is limited to low resolution considering computational cost, leading to the loss of structural information. Different from multi-view and voxel-based methods, the goal of our work is to process point clouds directly. + +Point-based methods [25, 11, 26, 34, 36, 22] have attracted great attention for processing on raw point clouds recently. PointNet [38] learns from global information through pointwise multi-layer perceptrons and max-pooling operation. PointNet++ [40] introduces set abstraction to + +![](images/fe0438b33e855d00639ce34f49dbaee38da793e3f6ea958e8e0f6d440001ce57.jpg) +Figure 2. A simple analogy between image convolution and set abstraction. + +capture local features, and farthest point sampling to down-sample uniformly between two set abstractions. Likewise, recent works concentrate on effective local learning approaches or various sampling manners. Point2Sequence [31] learns the information from different local regions by attention mechanism. ShufflePointNet [4] goes wider in an efficient manner via group convolution and channel shuffling. RandLA-Net [21] aggregates the local region with spatial encoding followed by attentive pooling. Convolution-based methods [57, 52, 17, 46, 33, 32, 63, 30, 29, 65, 50, 52] are another branch for local aggregation, using dynamic strategies of transformation to support the normal work of convolution on point clouds. PointCNN [28] applies traditional convolution on point clouds after transforming neighboring points to the canonical order. GridGCN [56] captures local geometry by graph instead of point set. However, these intuitively predefined transformations for the followed convolution operation may also cause a loss of structural information of the original point clouds, and the model may be sensitive to rigid transformation for convolution. In this paper, we focus on the relation learning based on MLP for a robust learning. + +# 2.2. Relation Learning + +Relation learning (i.e., self-attention [47]) has generally revolutionized natural language processing [8, 9]. It inspires applications in different computer vision fields, including image recognition [7, 48, 20, 19, 2, 41, 59, 64], image synthesis [61, 37], object detection [18, 14], and video understanding [51]. Wang et al. [51] uses non-local operation to model the relation between two pixels in an image, capturing long-range dependencies. DETR [3] adopts transformer encoder-decoder architecture for a competitive end-to-end detector. + +Recent work proves the practicability of relation learning on point clouds. PointASNL [58] adopts the non-local operation to capture long-range dependencies of point clouds. ShapeContextNet [55] applies self-attention-like operator to + +learn the global feature of a point cloud. Though effective, these methods focus on global relation learning, leading to loss of local information. RS-CNN [33] learns the relations within a local region by a predefined geometric priors, but the low-level relation cannot fully represent the relation between two points. In this paper, we aim to design a local aggregator to model the relation between two points on both geometric level and semantic level. + +# 3. Relation Learning on Point Clouds + +In this section, we first review PointNet++ [40], and the relation-based modules RS-CNN [33] and self-attention [47]. Next, we propose a general operator to learn inner-group relations and its instances. Then we design its bottleneck version as the building block, and finally, we implement the network architectures, Inner-Group Relation Point-based Networks (named RPNet) with this block. + +# 3.1. Background + +Most point-based blocks come from SA (shown in Fig. 1 left) in PointNet++ [40] to aggregate local features. It achieves point downsampling as well as feature transformation. Denote one input point as $x_{i} \in \mathbb{R}^{3 \times N}$ , its neighbors as $x_{i}$ , its feature as $\mathbf{f}(x_{i}) \in \mathbb{R}^{C \times N}$ and its coordinate as $\mathbf{p}(x_{i}) \in \mathbb{R}^{3 \times N}$ , with $C$ being the channels of input point features and $N$ the number of input points. Specifically, this layer transforms the group of feature points $\mathbf{f}(x_{i})$ via pointwise multi-layer perceptrs followed by max-pooling after point sampling and grouping. For an intuitive presentation, we show an analogy between the operations inside image convolution and SA in Fig. 2. SA without sampling can be formulated as follows: + +$$ +\mathbf {y} \left(x _ {i}\right) = \mathcal {A} \left(\left\{\mathcal {M} \left(x _ {i j}\right), \forall x _ {i j} \in \mathcal {G} \left(x _ {i}\right) \right\}\right), \tag {1} +$$ + +where $\mathcal{A}$ is the aggregation function (i.e., max-pooling), $\mathcal{M}$ is the mapping function, and $\mathcal{G}$ is the grouping method (i.e., + +![](images/0e626db6b9385333a03658a9c2ac256f84b45205c7fe3395b20f5a629b0fc34b.jpg) +Figure 3. Our group relation aggregator. After sampling and grouping operations on one point cloud, we input features and coordinates of the centroids $\mathbf{f}(x_i)$ , $\mathbf{p}(x_i)$ and their neighbors $\mathbf{f}(x_{i\cdot})$ , $\mathbf{p}(x_{i\cdot})$ . There are two parts in the relation function $\mathcal{R}$ , $\alpha$ for the geometric relation as well as $\theta$ for the semantic relation. We apply cross-channel attention (denoted as $\otimes$ in the above figure) to the output of $\mathcal{M}$ and the $\gamma$ . Here we introduce the cross-channel attention, which segments the output of $\gamma$ to $K$ groups with size $N\times G\times (C^{\prime \prime} / K)$ , and we apply one of $K$ weight map with size $N\times G$ to each of the $(C^{\prime \prime} / K)$ channels of the corresponding group via element-wise product. The outputs of cross-channel attention and $\gamma$ have the same shape. Finally, we aggregate the output followed by a linear function. + +kNN, Ball Query [40]). Here we adopt farthest point sampling as the default sampling method. + +SA is popular for its simplicity, but it suffers from shape ambiguity as it learns from features or coordinates independently. In this way, RS-CNN [33] tries to solve this problem. Relation-shape convolution is of shape-awareness for the predefined geometric relation. As shown in Fig. 1 middle, the relation-shape convolution adaptively aggregates the key contents according to the weight from the predefined function $\mathcal{R}_l$ . For a more powerful shape-aware representation, it further applies a channel-raising mapping $\mathcal{L}_{cr}$ after the weighted features. Relation-shape convolution can be formulated as: + +$$ +\mathbf {y} \left(x _ {i}\right) = \mathcal {L} _ {c r} \left(\mathcal {A} \left(\left\{\mathcal {R} _ {l} \left(x _ {i}, x _ {i j}\right) \cdot \mathbf {f} \left(x _ {i j}\right), \forall x _ {i j} \in \mathcal {G} \left(x _ {i}\right) \right\}\right)\right). \tag {2} +$$ + +Relation-shape convolution is good practice to learn geometric relations on point clouds, but semantic level relations may be ignored. In this case, self-attention operation can be an inspiration to complement the semantic level relation learning on point clouds. Recently, self-attention is proved to be effective in computer vision. Similar to relation-shape convolution, self-attention (shown in Fig. 1 right) also learns to aggregate the key contents according to the weight (or compatibility) of query-key pairs. However, + +differently, the weight is implicitly obtained by the interaction of one query and its keys in a high-level space instead of 3D space. The relation function is defined as $\mathcal{R}_h$ (i.e., scaled dot-product). $\mathcal{L}$ is a linear function after aggregation. Self-attention operator can be formulated as: + +$$ +\mathbf {y} \left(x _ {i}\right) = \mathcal {L} \left(\mathcal {A} \left(\left\{\mathcal {R} _ {h} \left(x _ {i}, x _ {i j}\right) \cdot \beta \left(x _ {i j}\right), \forall x _ {i j} \in \mathcal {G} \left(x _ {i}\right) \right\}\right)\right). \tag {3} +$$ + +# 3.2. Inner-Group Relation Learning + +We explore a local aggregator to learn from both geometric relations and semantic relations inside a point set. Thus we propose group relation aggregator (shown in Fig. 3), which has the following form: + +$$ +\mathbf {y} \left(x _ {i}\right) = \mathcal {L} \left(\mathcal {A} \left(\left\{\mathcal {H} \left(x _ {i}, x _ {i j}\right), \forall x _ {i j} \in \mathcal {G} \left(x _ {i}\right) \right\}\right)\right), \tag {4} +$$ + +where the inner-group relation function $\mathcal{H}$ equipped with cross-channel attention is defined as: + +$$ +\mathcal {H} \left(x _ {i}, x _ {i j}\right) = \mathcal {M} \left(\mathcal {R} \left(x _ {i}, x _ {i j}\right)\right) \otimes \gamma \left(x _ {i j}\right), \tag {5} +$$ + +where $\otimes$ means cross-channel attention. Denote the number of attention maps as $K$ to enable the operation of cross-channel attention, the total number of centroids as $N$ , each centroid with $G$ neighbors, the feature dimension as $C$ . $C' = C / r1$ and $C'' = C / r2$ (details in Sec. 3.4). We found our introduction of cross-channel attention beneficial by allowing the model to attend to information from different representation subspaces. Cross-channel attention first segments the output of $\gamma$ to $K$ groups with size $N \times G \times (C'' / K)$ . For each of $K$ weight map obtained from $\mathcal{M}$ , it then applies the map with size $N \times G$ to every channel (totally $C'' / K$ channels) of the corresponding group by element-wise product. The number of channels in the output of $\gamma$ is consistent after the operation of cross-channel attention. Cross-channel attention will degenerate into vanilla attention when $K = 1$ . The operation of cross-channel attention can further allow the design of bottleneck, significantly reducing the number of parameters and the computations. $\mathcal{M}$ a combination of both linear functions and nonlinearity functions, i.e., $\{MLP \to ReLU \to MLP\}$ . It allows us to introduce additional trainable transformations for more expressive construction of the weights. The output dimensionality of $\omega$ does not need to match that of $\gamma$ as the attention weights are shared across a group of channels for cross-channel attention. The function $\gamma$ is a linear function here. The relation function $\mathcal{R}$ contains a geometric function $\alpha(\cdot, \cdot)$ followed by a mapping function $\omega$ as well as a semantic function $\theta(\cdot, \cdot)$ : + +$$ +\mathcal {R} \left(x _ {i}, x _ {i j}\right) = \left[ \omega \left(\alpha \left(x _ {i}, x _ {i j}\right)\right), \theta \left(x _ {i}, x _ {i j}\right) \right], \tag {6} +$$ + +where $\omega$ is a sequence of mapping operations, and $\alpha$ can be defined like this: + +$$ +\alpha \left(x _ {i}, x _ {i j}\right) = \left[ \| \mathbf {p} \left(x _ {i}\right) - \mathbf {p} \left(x _ {i j}\right) \|, \mathbf {p} \left(x _ {i}\right), \mathbf {p} \left(x _ {i j}\right) \right. \tag {7} +$$ + +$$ +\left. \mathbf {p} \left(x _ {i}\right) - \mathbf {p} \left(x _ {i j}\right) \right]. +$$ + +![](images/eb4eed864a51f4688885238e405aa2b8e202dbe7e72bb09f99c5b317428a35e8.jpg) + +![](images/3243b09950070c41778c4d8dee9b6cb299a89fd8479bc085eaa65a0f220faf1d.jpg) +Figure 4. Comparison of architectures of PointNet++ (above) and our RPNet-D14 (below) for segmentation task. 'Skip' and 'Res' represent 'Skip Block' and 'Residual Block' respectively. The two blocks are based on our GRA. Skip block is a GRA combined with down-sampling, while residual block has a branch of residual link. Each skip block groups with a specific scale and outputs the features with a fixed dimension, while each residual block enhances the features through a fixed scale of groups. For example, the first skip block in RPNet-D14 groups 32 points corresponding to the center points and outputs 64 dimension vectors. The following residual block groups 16 points per center point. + +We explore possible instantiations of $\theta$ , along with feature transformation elements that surround self-attention operations in our architecture: + +Concatenation: $\theta (x_i,x_{ij}) = [\eta (\mathbf{f}(x_i)),\mu (\mathbf{f}(x_{ij}))]$ + +Summation: $\theta (x_i,x_{ij}) = \eta (\mathbf{f}(x_i)) + \mu (\mathbf{f}(x_{ij}))$ + +Subtraction: $\theta (x_i,x_{ij}) = \eta (\mathbf{f}(x_i)) - \mu (\mathbf{f}(x_{ij}))$ + +Hadamard product: $\theta (x_i,x_{ij}) = \eta (\mathbf{f}(x_i))\odot \mu (\mathbf{f}(x_{ij}))$ + +Here $\eta$ and $\mu$ are trainable transformations such as linear mappings, and have matching output dimensionality. + +# 3.3. Bottleneck Improves Efficiency + +Matrix multiplication in self-attention brings about significant computations. The complexity of GRA is of $\mathcal{O}\left(C^2\right)$ . To design an efficient aggregator, we introduce the philosophy of bottleneck to GRA. Denote the channel dimensionality of input features by $C$ . The output of $\eta$ and $\mu$ have $C / r_1$ channels. The output of $\gamma$ and $\mathcal{H}$ have the same dimension $C / r_2$ . The output of the block is subsequently expanded back to $C$ through a linear mapping. In our architectures, we set $r_1 = 16$ and $r_2 = 4$ . + +# 3.4.RPNet + +The main structures of our RPNet generally follow PointNet++ [40], which we use as our baseline. The number $X$ in RPNet-WX and RPNet-DX refers to the number of our GRA blocks. + +Classification. RPNet-W consists of GRA only. The backbone of RPNet-W has three stages, each with different spatial resolution. Every stage comprises multiple self-attention blocks. In RPNet-W7, grouping of the first two stages are performed by multi-scale groupers, with the sizes of $\{16,32,128\}$ and $\{32,64,128\}$ in order. RPNet-W9 and RPNet-W15 adopt more detailed scales within [16, 128] and [32, 128]. The third stage groups all the rest points for aggregation. The output of the third stage is processed by a classification layer that comprises three linear layers and dropout with a ratio of 0.5 between two of the layers, followed by a softmax activation. + +Segmentation. We build RPNet-D with skip block (GRA with down-sampling) and residual block (GRA with a residual link). The input of RPNet-D is 8k or 16k points containing various information (i.e. coordinates, color and normal). RPNet-D first encodes a point cloud by downsampling points, i.e. $\{8192\to 1024\to 256\to 64\to 32\}$ , and then decodes by upsampling through feature propagation [40]. The residual GRA blocks are attached to the downsampling or upsampling blocks. The segmentation layer includes a linear layer and a dropout layer of 0.5. An illustration (Fig. 4) shows the architecture of RPNet-D14. + +# 4. Experiments + +First, we evaluate our RPNet-W and RPNet-D on the classification and segmentation tasks of various datasets, in + +![](images/7c52d90ed9ebdbfe92bfb72c270e47609938a4bc01f4841569ce21eb051ae2a1.jpg) +(a) + +![](images/aa90b50326575dcf00aeeea0d8b3695a3b06abc8a1f99d2d885c70da80ea0d8e.jpg) +(b) + +![](images/39d1c0f9f5d04effdaf48157878963e945a17a75e63b4cdb125095140f96b2fd.jpg) +(c) + +![](images/58564ab52df2d13aa3277478daf625689903be58e3bf3dcc768f5107ce96149c.jpg) +(d) +Figure 5. We visualize the attention weights of a chair (a)(b) and an airplane (c)(d) from our GRA in different scales. Blue balls stand for the center (query) points. By visualizing, we can find that the bounding points obtain higher importance. We argue that GRA describes a shape representation by the bounding points to a large extent. Intuitively, it works on human eyes as well. We discriminate a shape by its outline most of the time. + +cluding synthetic datasets and scene segmentation datasets. Furthermore, we discuss the expandability of our RPNet. We then analyze the robustness of our models in terms of rigid transformation and noises. The following ablation studies explore the variants of our module and assess the effectiveness of the components used to construct the networks. All the experiments are performed on a machine with four V100 GPUs. + +# 4.1. Evaluation on Classification + +We conduct experiments on ModelNet40 [53] on classification through our RPNet-W network. The dataset contains 9843 training point clouds and 2468 test ones from 40 different categories. + +Implementation. Our implementation mainly follows the practice in [38]. For training, we first select 1024 points as input. To prevent overfitting, we apply augmentation strategy including the following components: random scaling in the range [0.8, 1.25], random shift in the range $[-0.1, 0.1]$ , random dropout points with the ratio of the range $[0, 87.5\%]$ . The initial learning rate is 0.001, and it decays by a factor of 0.7 every 20 epochs. For testing, similar to [38, 40], we average the predictions of randomly scaled inputs. + +Results. In Tab. 1, we compare our RPNet-W with state-of-the-art classification methods on ModelNet40. Among all current methods, our method achieves state-of-the-art + +
MethodModalityAccuracy(%)
PointGCN [62]Graph89.5
KPConv [46]Grid92.9
SO-Net [27]Points+Normals (5k)93.4
PVRNet [60]Points+Views93.6
RS-CNN [33] w/ vot.Points93.6
PointNet [38]Points89.2
RS-CNN [33] w/o vot.Points92.4
PointASNL [58]Points92.9
RPNet-W7 (ours)Points93.8 ↑0.9
RPNet-W9 (ours)Points93.9 ↑1.0
PointNet++ [40]Points+Normals91.9
FPConv [29]Points+Normals92.5
Grid-GCN [56]Points+Normals93.1
PointASNL [58]Points+Normals93.2
RPNet-W7 (ours)Points+Normals93.9 ↑0.7
RPNet-W9 (ours)Points+Normals94.1 ↑0.9
+ +Table 1. Performance of classification on ModelNet40 on accuracy(%) + +
MethodS3DIS-6ScanNet
Convolution-based Methods
PointCNN [28]65.445.8
FPConv [29]68.763.9
KPConv [46]70.668.4
MLP-based Methods
RandLA [21] (105)70.0-
PointNet++ [40]53.433.9
PointWeb [65]66.7-
PointASNL [58]68.763.0
RPNet-D8 (ours)69.167.1
RPNet-D14 (ours)70.067.7
RPNet-D27 (ours)70.8 ↑2.168.2 ↑5.2
+ +Table 2. Mean per-class IoU(%) for the task of semantic segmentation on the datasets of ScanNet v2 and S3DIS (6-fold cross validation). “-” means unknown. + +with a promotion of $0.9\%$ . We also compare our RPNet-W7 with RS-CNN and PointASNL with and without normal input. Besides, we visualize the attention maps in Fig. 5. + +# 4.2. Evaluation on Segmentation + +Large-scale scene segmentation is a more challenging task due to outliers and noises. We evaluate our RPNet-D on Stanford 3D Large-Scale Indoor Spaces (S3DIS) [1] and ScanNet v2 (ScanNet) [6] datasets. S3DIS contains 271 scenes from six zones. It provides 13 types of semantic labels for scene segmentation. ScanNet includes 1513 training point clouds and 100 test ones. It marks each point from 21 categories. + +Implementation. On both datasets, we verify each method with mean per-class IoU (mIoU), and use point position and RGB information as input. In particular, we evaluate models with 6-fold cross-validation over all six zones (6-fold) on S3DIS. For training, we randomly sample 16384 + +![](images/e818f1dff912811a473c875f8a9a25dedaaab9fb40625ee116df00c2e4cfc50c.jpg) + +![](images/d6d00c3d7abffc7f0401908e21f4885df82b0be5682552cc5497305815b92647.jpg) + +![](images/9320cad0ca91988a7312280593208eeaaefa6e5f2e72e2b13dcb3d3edd37574d.jpg) + +![](images/759af073a14c1ecd63ee2e61bea8b1595461c8212486bbb96c3e2a271834ec22.jpg) +Figure 6. Examples of semantic scene labeling with RPNet. + +![](images/fa21b07cf15d6731a851b921d7dcfe105491d64d8029d50db818b00b71b7ea9f.jpg) + +![](images/10ac85f8c835ddf101a7fa60731d7f5b26e508dca974a8b3ec91925cf5b3c6b8.jpg) + +![](images/e8dc461f2f40badfa94b49f74c17864d35ea40eb9e6e243d3e2c46183bf812ce.jpg) + +![](images/d019594b55a034bde808199597d14d1beb0e1b66f3d9c3d3d5bc5f40f15758a8.jpg) + +![](images/1d8c8765d695fa1e48321eb12322178e6525c2b6e3980aaee3c2860a161c31a6.jpg) +Figure 7. Model comparison in terms of width on classification (above) and depth on segmentation (below). We compare models by both accuracy or mIoU (left) and the number of parameters (right). Here "nor." means normals, "BT" means bottleneck version. + +![](images/4d3da593b1f5798a6468eda80594b743b4739ea0626c279c8b9cac5183af02a8.jpg) + +points from the scenes. For evaluation, similar to [58], we obtain an average prediction of 5 votes by sliding a window across the room in $0.5\mathrm{m}$ stride. + +Results. In Tab. 2, we list the latest methods to compare with our RPNet-D, i.e., PointASNL [58]. We adopt the same training and test approach by randomly chopping cubes with a fixed number of points. We show the results of convolution-based methods as well, i.e., FPconv [29], KPconv [46]. All of these methods utilize the raw point clouds as the input. An illustration of semantic scene labeling is shown in Fig. 6. + +# 4.3. Discussion of Expandability + +As show in Fig. 7, we evaluate various models with respect to accuracy and the number of parameters. With the same depth or width, our model outperforms SOTAs by an obvious margin. Besides, the efficiency of our model is also competitive compared with prior works. + +Shown in Fig. 7 above, we compare our RPNet-W with + +PointNet++ multi-scale grouping (MSG) version. To improve efficiency, we use a bottleneck architecture to build blocks. These blocks significantly reduce the computational cost while maintaining high accuracy. By increasing the width, our model can obtain more geometric information from a point cloud, and thus higher accuracy. The comparison of RPNet-W9 and RPNet-W15 shows a overfitting problem. We argue that the width of 9 is enough for the full exploitation. Wider model would bring much redundant information and cause the decrease of performance. + +Shown in Fig. 7 below, similar to [26], we deepen our models on segmentation. We compare the efficiency improvement of RPNet-D with our bottleneck blocks. To verify the effectiveness of greater depth, we gradually increase the depth of RPNet-D on ScanNet. Obviously, as the depth increases, the model can obtain higher mIoU. We argue that relation learning helps to deeply extract representations by stacking residual blocks. We also obtain a similar conclusion from [26] that going deeper can help improve the accuracy on segmentation. + +To explore which kind of model works better on the two tasks, we conduct simple experiments on deeper models for classification and wider models for segmentation. First, we test deeper model using RPNet-W1 on classification: + +
Depth357
acc.92.992.5 ↓0.492.1 ↓0.8
+ +Shown in the table, the results perform worse with the depth increasing. We discuss that the task of classification concentrates on the global view instead of point-wise recognition. Increasing the depth could not be beneficial to obtain such global view. Besides, there would be a great number of redundant features inside each layer. The errors of a global view would increase significantly if the depth is over the threshold value. + +Also, we test wider RPNet-D4 (RPNet-D without residual block) on segmentation: + +
Width123
acc.66.867.0 ↑0.267.1 ↑0.3
+ +Shown in the table, increasing the width leads to almost no improvement, but with nearly $X$ -fold increasing on the number of parameters and the computation. Through the empirical results as well as our discussion, we conclude that RPNet-W fits for classification, while RPNet-D works better on segmentation. + +# 4.4. Ablation Study + +We conduct ablation studies to evaluate the effectiveness of our design. We mainly discuss some key components of our GRA, including inner-group relation function, aggregation function and cross-channel attention. We perform all ablation studies on S3DIS with 6-fold validation. + +Inner-group relation function $\mathcal{H}$ . Shown in Tab. 3, we + +
ModelGeometric Relation αSemantic Relation θmIoU (%)
l2l1xi-xij[xi, xij]sumsubcathad
A✓63.7
B✓✓63.8
C✓✓✓✓64.2
D✓✓✓✓✓67.8
E✓✓✓✓✓67.8
F✓✓✓✓✓67.5
G✓✓✓✓✓67.6
+ +ablate the designs of geometric and semantic relation functions $\alpha$ and $\theta$ in details. We define the geometric priors as four possible components: $\ell 2$ , $\ell 1$ , $x_{i} - x_{ij}$ and $[x_i, x_{ij}]$ . $\ell 2$ and $\ell 1$ can directly describe the distances between two points, while $x_{i} - x_{ij}$ and $[x_i, x_{ij}]$ show the relative and global positions of two points. Model C outperforms model A and B, which shows that four components of geometric priors boost the performance of our RPNet at the same time. Furthermore, we survey the designs of semantic relation function $\theta$ with four possibilities: summation, subtraction, concatenation and Hadamard product. The results prove that summation or subtraction works better in RPNet. Summation or subtraction would be better in terms of computation as well. + +Aggregation function $\mathcal{A}$ . We adopt three types of symmetric function to aggregate in our GRA: max-pooling, avg-pooling and sum-pooling. Here is the results: + +Table 3. The results of different designs on inner-group relation function $\mathcal{H}$ (sum: summation, sub: subtraction, cat: concatenation, had: Hadamard product). The experiments are on S3DIS with 6-fold validation. + +
RPNet-D8max-poolingavg-poolingsum-pooling
acc.67.867.567.7
+ +The table shows that max-pooling performs better than the others. We argue that max-pooling can filter the redundant information in our GRA and select the expressive features. + +Cross-channel attention. We test the design of our cross-channel attention below: + +
RPNet-D8vanilla att.cross-channel att.
acc.67.869.1 ↑1.3
+ +As shown in the table, cross-channel attention greatly boosts our GRA by $1.3\%$ on S3DIS. Vanilla attention does not enable the channelwise exploration. However, different channels may play different roles to influence the final weights. One channel attention map cannot fully utilize the feature space, especially when the space has a great number of dimensions. To handle this problem, cross-channel attention applies multiple attention maps to different groups of channels, allowing the channelwise exploration in GRA. + +# 4.5. Analysis of Robustness + +Robustness to rigid transformation. We evaluate the robustness to rigid transformation for the comparison of our RPNet with PointNet [38], PointNet++ [40], RS-CNN + +
modeloriginperm±0.290°180°270°
PointNet [38]88.788.770.842.538.640.7
PointNet++ [40]88.288.288.288.247.939.7
RS-CNN [33]90.390.390.390.390.390.3
RPNet-W7 (ours)90.990.990.990.990.990.9
+ +Table 4. Robustness to point permutation and rigid transformation $(\%)$ . We perform the operations of random permutation (perm), translation of $\pm 0.2$ , and clockwise rotation around Y axis. + +![](images/4a859322a9c22fe706f7bb995f807c6d869c6f4d2cedd4a0dd3a8eaad2d308ea.jpg) +Figure 8. (Left) Classification results of different models with noises. (Right) By learning semantic relation, the local aggregator is relatively insensitive to noises, concentrating more on the shape instead of independent points. + +[33]. We follow the experimental setup of RS-CNN for the evaluation. As shown in Tab. 4, all these coordinate-based methods are insensitive to permutation thanks to the design of symmetric function. However, PointNet is sensitive to translation and rotation, while PointNet++ is vulnerable to rotation. RS-CNN and our RPNet perform robust due to the usage of relation learning. Our RPNet outperforms RS-CNN for the learning on high-level relation. + +Robustness to noises. We also evaluate our networks on robustness to noises. Shown in Fig. 8, our RPNet outperforms other competitive methods with the same noises input. Note that RS-CNN is sensitive to noise. We argue that the predefined relation may affect the output of attention map, causing the wrong relation representation. However, our RPNet uses semantic level relation, which is skilled at denoising and focusing on the content. + +# 5. Conclusion + +We present group relation aggregator as well as deeper (RPNet-D) and wider (RPNet-W) models for efficient point cloud analysis. By learning from both geometric and semantic relations inside a point set, our RPNet achieves state-of-the-art on both classification and segmentation tasks. We further introduce bottleneck philosophy to our module for high efficiency. Experiments based on challenging benchmarks illustrate the effectiveness of our RPNet. + +# References + +[1] Iro Armeni, Ozan Sener, Amir R Zamir, Helen Jiang, Ioannis Brilakis, Martin Fischer, and Silvio Savarese. 3d semantic parsing of large-scale indoor spaces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1534–1543, 2016. 2, 6 +[2] Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 3286-3295, 2019. 3 +[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. arXiv preprint arXiv:2005.12872, 2020. 3 +[4] Can Chen, Luca Zanotti Fronarara, and Antonios Tsourdos. Go wider: An efficient neural network for point cloud analysis via group convolutions. Applied Sciences, 10(7):2391, 2020. 3 +[5] Christopher Choy, JunYoung Gwak, and Silvio Savarese. 4d spatio-temporal convnets: Minkowski convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3075-3084, 2019. 2 +[6] Angela Dai, Angel X Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5828-5839, 2017. 2, 6 +[7] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 764-773, 2017. 3 +[8] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019. 3 +[9] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. 3 +[10] Yifan Feng, Zizhao Zhang, Xibin Zhao, Rongrong Ji, and Yue Gao. Gvcnn: Group-view convolutional neural networks for 3d shape recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 264-272, 2018. 1, 2 +[11] Kent Fujiwara and Taiichi Hashimoto. Neural implicit embedding for point cloud analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11734-11743, 2020. 2 +[12] Matheus Gadelha, Rui Wang, and Subhransu Maji. Multiresolution tree networks for 3d point cloud processing. In Proceedings of the European Conference on Computer Vision (ECCV), pages 103-118, 2018. 1, 2 +[13] Benjamin Graham, Martin Engelcke, and Laurens Van Der Maaten. 3d semantic segmentation with submanifold sparse convolutional networks. In Proceedings of the + +IEEE conference on computer vision and pattern recognition, pages 9224-9232, 2018. 2 +[14] Jiayuan Gu, Han Hu, Liwei Wang, Yichen Wei, and Jifeng Dai. Learning region features for object detection. In Proceedings of the European Conference on Computer Vision (ECCV), pages 381-395, 2018. 3 +[15] Haiyun Guo, Jinqiao Wang, Yue Gao, Jianqiang Li, and Hanqing Lu. Multi-view 3d object retrieval with deep embedding network. IEEE Transactions on Image Processing, 25(12):5526-5537, 2016. 2 +[16] Zhizhong Han, Mingyang Shang, Zhenbao Liu, Chi-Man Vong, Yu-Shen Liu, Matthias Zwicker, Junwei Han, and CL Philip Chen. Seqviews2seqlabels: Learning 3d global features via aggregating sequential views by rnn with attention. IEEE Transactions on Image Processing, 28(2):658-672, 2018. 2 +[17] Pedro Hermosilla, Tobias Ritschel, Pere-Pau Vázquez, Álvar Vinacua, and Timo Ropinski. Monte carlo convolution for learning on non-uniformly sampled point clouds. ACM Transactions on Graphics (TOG), 37(6):1-12, 2018. 3 +[18] Han Hu, Jiayuan Gu, Zheng Zhang, Jifeng Dai, and Yichen Wei. Relation networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3588-3597, 2018. 3 +[19] Han Hu, Zheng Zhang, Zhenda Xie, and Stephen Lin. Local relation networks for image recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 3464-3473, 2019. 1, 3 +[20] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. 3 +[21] Qingyong Hu, Bo Yang, Linhai Xie, Stefano Rosa, Yulan Guo, Zhihua Wang, Niki Trigoni, and Andrew Markham. Randla-net: Efficient semantic segmentation of large-scale point clouds. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11108-11117, 2020. 3, 6 +[22] Li Jiang, Hengshuang Zhao, Shu Liu, Xiaoyong Shen, ChiWing Fu, and Jiaya Jia. Hierarchical point-edge interaction network for point cloud semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pages 10433-10441, 2019. 2 +[23] Roman Klokov and Victor Lempitsky. Escape from cells: Deep kd-networks for the recognition of 3d point cloud models. In Proceedings of the IEEE International Conference on Computer Vision, pages 863-872, 2017. 2 +[24] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097-1105, 2012. 1 +[25] Itai Lang, Asaf Manor, and Shai Avidan. Samplenet: Differentiable point cloud sampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7578-7588, 2020. 2 +[26] Eric-Tuan Le, Iasonas Kokkinos, and Niloy J Mitra. Going deeper with lean point networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9503-9512, 2020. 2, 7 + +[27] Jiaxin Li, Ben M Chen, and Gim Hee Lee. So-net: Self-organizing network for point cloud analysis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9397–9406, 2018. 6 +[28] Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In Advances in neural information processing systems, pages 820-830, 2018. 3, 6 +[29] Yiqun Lin, Zizheng Yan, Haibin Huang, Dong Du, Ligang Liu, Shuguang Cui, and Xiaoguang Han. Fpconv: Learning local flattening for point convolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4293-4302, 2020. 3, 6, 7 +[30] Zhi-Hao Lin, Sheng-Yu Huang, and Yu-Chiang Frank Wang. Convolution in the cloud: Learning deformable kernels in 3d graph convolution networks for point cloud analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1800-1809, 2020. 3 +[31] Xinhai Liu, Zhizhong Han, Yu-Shen Liu, and Matthias Zwicker. Point2sequence: Learning the shape representation of 3d point clouds with an attention-based sequence to sequence network. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 8778-8785, 2019. 3 +[32] Yongcheng Liu, Bin Fan, Gaofeng Meng, Jiwen Lu, Shiming Xiang, and Chunhong Pan. Densepoint: Learning densely contextual representation for efficient point cloud processing. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5239-5248, 2019. 3 +[33] Yongcheng Liu, Bin Fan, Shiming Xiang, and Chunhong Pan. Relation-shape convolutional neural network for point cloud analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8895-8904, 2019. 1, 2, 3, 4, 6, 8 +[34] Ze Liu, Han Hu, Yue Cao, Zheng Zhang, and Xin Tong. A closer look at local aggregation operators in point cloud analysis. In European Conference on Computer Vision, pages 326-342. Springer, 2020. 2 +[35] Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for real-time object recognition. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 922-928. IEEE, 2015. 2 +[36] Ehsan Nezhadarya, Ehsan Taghavi, Ryan Razani, Bingbing Liu, and Jun Luo. Adaptive hierarchical down-sampling for point cloud classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12956-12964, 2020. 2 +[37] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018. 3 +[38] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652-660, 2017. 1, 2, 6, 8 +[39] Charles R Qi, Hao Su, Matthias Nießner, Angela Dai, Mengyuan Yan, and Leonidas J Guibas. Volumetric and multi-view cnns for object classification on 3d data. In Pro- + +ceedings of the IEEE conference on computer vision and pattern recognition, pages 5648-5656, 2016. 2 +[40] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pages 5099-5108, 2017. 1, 2, 3, 4, 5, 6, 8 +[41] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Standalone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019. 3 +[42] Gernot Riegler, Ali Osman Ulusoy, and Andreas Geiger. Octnet: Learning deep 3d representations at high resolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3577-3586, 2017. 2 +[43] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 1 +[44] Hang Su, Varun Jampani, Deqing Sun, Subhransu Maji, Evangelos Kalogerakis, Ming-Hsuan Yang, and Jan Kautz. Splatnet: Sparse lattice networks for point cloud processing. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2530-2539, 2018. 2 +[45] Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik Learned-Miller. Multi-view convolutional neural networks for 3d shape recognition. In Proceedings of the IEEE international conference on computer vision, pages 945-953, 2015. 2 +[46] Hugues Thomas, Charles R Qi, Jean-Emmanuel Deschaud, Beatrix Marcotegui, François Goulette, and Leonidas J Guibas. Kpconv: Flexible and deformable convolution for point clouds. In Proceedings of the IEEE International Conference on Computer Vision, pages 6411–6420, 2019. 3, 6, 7 +[47] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008, 2017. 1, 2, 3 +[48] Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, and Xiaou Tang. Residual attention network for image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3156-3164, 2017. 3 +[49] Peng-Shuai Wang, Yang Liu, Yu-Xiao Guo, Chun-Yu Sun, and Xin Tong. O-cnn: Octree-based convolutional neural networks for 3d shape analysis. ACM Transactions on Graphics (TOG), 36(4):1-11, 2017. 2 +[50] Shenlong Wang, Simon Suo, Wei-Chiu Ma, Andrei Pokrovsky, and Raquel Urtasun. Deep parametric continuous convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2589-2597, 2018. 3 +[51] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794-7803, 2018. 3 + +[52] Wenxuan Wu, Zhongang Qi, and Li Fuxin. Pointconv: Deep convolutional networks on 3d point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9621-9630, 2019. 3 +[53] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1912-1920, 2015. 1, 2, 6 +[54] Jin Xie, Guoxian Dai, Fan Zhu, Edward K Wong, and Yi Fang. Deepshape: Deep-learned shape descriptor for 3d shape retrieval. IEEE transactions on pattern analysis and machine intelligence, 39(7):1335–1345, 2016. 2 +[55] Saining Xie, Sainan Liu, Zeyu Chen, and Zhuowen Tu. Attentional shapecontextnet for point cloud recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4606-4615, 2018. 3 +[56] Qiangeng Xu, Xudong Sun, Cho-Ying Wu, Panqu Wang, and Ulrich Neumann. Grid-gcn for fast and scalable point cloud learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5661-5670, 2020. 3, 6 +[57] Yifan Xu, Tianqi Fan, Mingye Xu, Long Zeng, and Yu Qiao. Spidercnn: Deep learning on point sets with parameterized convolutional filters. In Proceedings of the European Conference on Computer Vision (ECCV), pages 87-102, 2018. 3 +[58] Xu Yan, Chaoda Zheng, Zhen Li, Sheng Wang, and Shuguang Cui. Pointasnl: Robust point clouds processing using nonlocal neural networks with adaptive sampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5589-5598, 2020. 3, 6, 7 +[59] Minghao Yin, Zhuliang Yao, Yue Cao, Xiu Li, Zheng Zhang, Stephen Lin, and Han Hu. Disentangled non-local neural networks. arXiv preprint arXiv:2006.06668, 2020.3 +[60] Haoxuan You, Yifan Feng, Xibin Zhao, Changqing Zou, Rongrong Ji, and Yue Gao. Pvrnet: Point-view relation neural network for 3d shape recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 9119–9126, 2019. 6 +[61] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International Conference on Machine Learning, pages 7354–7363. PMLR, 2019. 3 +[62] Yingxue Zhang and Michael Rabbat. A graph-cnn for 3d point cloud classification. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6279-6283. IEEE, 2018. 6 +[63] Zhiyuan Zhang, Binh-Son Hua, and Sai-Kit Yeung. Shellnet: Efficient point cloud convolutional neural networks using concentric shells statistics. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1607–1616, 2019. 3 +[64] Hengshuang Zhao, Jiaya Jia, and Vladlen Koltun. Exploring self-attention for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10076–10085, 2020. 1, 3 + +[65] Hengshuang Zhao, Li Jiang, Chi-Wing Fu, and Jiaya Jia. Pointweb: Enhancing local neighborhood features for point cloud processing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5565-5573, 2019. 3, 6 \ No newline at end of file diff --git a/learninginnergrouprelationsonpointclouds/images.zip b/learninginnergrouprelationsonpointclouds/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..eef51cb31aa1801e23dd520ce82b3ab96e72c9fb --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33ae0d9bfa19a7ef16122764caa4b287b14c9ab8942442442118be6555909e23 +size 493665 diff --git a/learninginnergrouprelationsonpointclouds/layout.json b/learninginnergrouprelationsonpointclouds/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..346149b19ba45b471554bbc8b7e94bdf3ddd0816 --- /dev/null +++ b/learninginnergrouprelationsonpointclouds/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b40f33b89d39bda4400e8033f64a82512a3e9c86e0760814f229a9abea663d6 +size 460106 diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_content_list.json b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e57e9895bae0eebfa010c21321545204a93680a4 --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8af3f3fa66e5152e4e2337765c7e7cd589f00ac569e06f515eb1295e64d2bbfe +size 82267 diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_model.json b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e9111ec9d4f359f4e16bcef441ece52aba58d8fc --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f1cf7f18bc35638c74bc82edcb02ea3fa451fb13a7404efe3ff085aecd8735 +size 100646 diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_origin.pdf b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..32984eb5ee9eef4bf1fd6073b142cb40d12b0929 --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/b3d9ada4-3c6a-46e6-b274-edbaa21720d2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5259824aa946ca08eddcdba7f2a51de464c084cef3262c5eaca5c954a965f54f +size 4679273 diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/full.md b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ce2776051ffa7ddaa46b7ade32ca3ba64ee09491 --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/full.md @@ -0,0 +1,410 @@ +# Learning Instance-level Spatial-Temporal Patterns for Person Re-identification + +Min Ren $^{12*}$ , Lingxiao He $^{3}$ , Xingyu Liao $^{3}$ , Wu Liu $^{3}$ , Yunlong Wang $^{2}$ , Tieniu Tan $^{2}$ + +1University of Chinese Academy of Sciences + +$^{2}$ CRIPAC NLPR, Institute of Automation Chinese Academy of Sciences + +$^{3}$ JD AI Research + +{min. ren, yunlong.wang} $@$ cripac.ia.ac.cn, {helingxiao3, liaoxingyu5, liwu1} $@$ jd.com, tint@nlpr.ia.ac.cn + +# Abstract + +Person re-identification (Re-ID) aims to match pedestrians under disjoint cameras. Most Re-ID methods formulate it as visual representation learning and image search, and its accuracy is consequently affected greatly by the search space. Spatial-temporal information has been proven to be efficient to filter irrelevant negative samples and significantly improve Re-ID accuracy. However, existing spatial-temporal person Re-ID methods are still rough and do not exploit spatial-temporal information sufficiently. In this paper, we propose a novel Instance-level and Spatial-Temporal Disentangled Re-ID method (InSTD), to improve Re-ID accuracy. In our proposed framework, personalized information such as moving direction is explicitly considered to further narrow down the search space. Besides, the spatial-temporal transferring probability is disentangled from joint distribution to marginal distribution, so that outliers can also be well modeled. Abundant experimental analyses are presented, which demonstrates the superiority and provides more insights into our method. The proposed method achieves mAP of $90.8\%$ on Market-1501 and $89.1\%$ on DukeMTMC-reID, improving from the baseline $82.2\%$ and $72.7\%$ , respectively. Besides, in order to provide a better benchmark for person re-identification, we release a cleaned data list of DukeMTMC-reID with this paper: https://github.com/RenMin1991/cleaned-DukeMTMC-reID/ + +# 1. Introduction + +Person re-identification aims to retrieve pedestrians across non-overlapping camera views. Most existing person re-identification methods focus on the visual feature representations of pedestrian images [6, 11, 14, 27, 32, 35, 38, 36, 42], such as appearance, clothes, and textures. The auxiliary information of person images is also adopted recently, such + +![](images/eba39920a6018287f2267b4fb70b6a8864cff24820e842b06370106b1782ac60.jpg) +Figure 1. For each pair of pedestrian images, instance-level spatial and temporal constraints are provided separately by the proposed framework. Then they are adaptively combined with the visual feature similarity for matching. + +as parsing information [5, 13, 15, 22, 25], pose of the pedestrians [3, 19, 20], or human body key points [33]. However, the performances of these methods are still far from the requirements of real-world situations. Because it is hard for visual representations to discriminate pedestrian with similar appearance and clothes. + +Recent methods model spatial-temporal patterns [8, 18, 21, 34] to filter out the irrelevant candidates and narrow down the search space. Specifically, these methods mainly formulate spatial-temporal pattern as a joint distribution $P(S_{c_i,c_j},T)$ , where $S_{c_i,c_j}$ means moving from camera $i$ to camera $j$ , $T$ means time interval. It has been proven to be efficient to significantly improve re-identification accuracy. However, there are two problems of the existing methods. Firstly, the existing spatial-temporal methods only consider camera-level but neglect instance-level information. The state information of each pedestrian is neglected while it is essential for spatial-temporal patterns of the person. Secondly, existing methods formulate spatial-temporal patterns as a joint distribution, meaning that only those candidates + +matching both spatial and temporal priors can be matched. They are not robust to the outliers. + +To solve these problems, we propose a novel method named Instance-level and Spatial-Temporal Disentangled Re-ID (InSTD) to model the instance-level and spatial-temporal disentangled patterns. Firstly, the traditional spatial-temporal pattern is updated to be conditional on instance-level state information. Its formulation looks like $p(S_{c_i,c_j},T|P)$ , where $P$ is instance-level pedestrian information. The walking direction of the pedestrian, which is the key instance-level state information, is taken into consideration in this paper. The walking direction of a pedestrian is complimentary information of pedestrian detection and tracking. It is useful because it is highly correlated with spatial-temporal patterns. For example, a pedestrian, who is walking towards the west in the view of a camera, is more probable to appear in the view of the western cameras later, rather than the eastern cameras. Meanwhile, it is economical because pedestrian detection and tracking are necessary steps before person re-identification in practice. + +Secondly, we disentangle the spatial-temporal pattern by constructing their marginal distribution, i.e. transmission probability $P(S_{c_i,c_j}|P)$ and time interval distribution $P(T|P)$ . They are modeled separately and adaptively combined to handle outliers. If the temporal (spatial) pattern of a pedestrian is unusual, the person may be normal in the term of spatial (temporal) patterns. The similarity metric should focus on the spatial (temporal) pattern. For example, a runner, who is moving faster than most pedestrians, is an outlier from the view of temporal pattern. But the runner can be quite normal in terms of spatial transmission perspective. It is harmful to model this runner by joint distribution of spatial and temporal patterns. To this end, we propose a novel fusion approach to adaptively combine the spatial and temporal patterns. The spatial patterns and temporal patterns are complementary, rather than in conflict as existing methods, so that outliers can also be well modeled. + +The contributions of this paper can be summarized as follows: + +- We present a novel instance-level method to model spatial-temporal patterns for person re-identification. The proposed method provides personalized predictions by leveraging the instance-level state information of each pedestrian. +- The instance-level spatial-temporal patterns are decoupled into transmission probabilities and time interval distributions between cameras in the proposed method. The spatial and temporal patterns become complementary rather than in conflict as existing methods. +- Without bells and whistles, the proposed method surpasses the baseline model based on visual features + +by $16.9\%$ on DukeMTMC-reID and $8.6\%$ on Market-1501 in the term of mAP, and outperforms the state-of-the-art method based on spatial-temporal patterns by $4.8\%$ on DukeMTMC-reID and $2.2\%$ on Market-1501. + +# 2. Related Work + +# 2.1. Visual Features based Re-ID + +Person re-identification addresses the problem of matching pedestrian images across non-overlapping camera views [29, 40]. Many studies exploit discriminative visual features [2, 26, 37]. + +Deep learning algorithms foster significant improvements in the field of person re-identification. Some researchers attempt to explore effective convolutional neural networks [1, 4, 6, 9, 16, 17, 10, 30, 31, 35, 36, 41, 44]. Some studies explore training strategies and loss functions for person re-identification [1, 9, 10, 31, 43]. Recently, some studies leverage the structure information of person images, such as parsing information [5, 15, 22, 25], pose of the pedestrians [3, 19, 20, 24], or human body key points [33]. + +However, appearance-based methods are still far from practical applications. They are not discriminative enough in complex scenarios where pedestrians may exhibit similar appearance and clothes. It is hard to further improve the performance using only appearance-based features. + +# 2.2. Spatial-temporal Person Re-ID + +There are some researchers who have paid attention to the topology of cameras since the spatial-temporal patterns implied in the topology are essential for cross-camera retrieval. The spatial-temporal constraints are utilized to filter out the irrelevant gallery images [8, 18, 21, 34]. Huang et al. [34] propose a method to take both visual feature representation and spatial-temporal constraints into consideration for person re-identification. However, this method makes a strong assumption that the time intervals between cameras follow Weibull distribution. This assumption is invalid for complex scenarios. Cho et al. [21] propose a framework to integrate camera network topology into person re-identification. However, the temporal constraints are simply realized by time thresholds, which cannot handle massive gallery images and complex cases in practice. Lv et al. [18] propose a method that leverage the spatial-temporal constraints for cross-dataset person re-identification. The spatial-temporal constraints improve the performance on the target dataset by enhancing the pseudo label during training. It is not proper to be directly applied to general person re-identification tasks. Wang et al. [8] propose a two-stream architecture to apply spatial-temporal constraints to person re-identification. However, the spatial-temporal constraints are coupled together in this method, + +![](images/0d8082ff231ccae78cde620d2f44ae3394ee2d79c1a6d929ba4465f665794401.jpg) +Figure 2. Spatial-temporal patterns are implied in the topology of cameras. The spatial-temporal pattern between two cameras of a pedestrian are highly correlated with his/her moving direction. Pedestrians in the view of camera 2 may appear in camera 1, camera 3, or camera 5 after a certain time lapse. However, pedestrians with different states will appear in different cameras at different times. For example, the pedestrian in the red bounding box is much more likely to appear in Camera 3 than Camera 1, because he is moving towards the field of view of Camera 3. In the proposed method, the instance-level state information is adopted rather than modeling the spatial-temporal patterns on camera-level as the existing methods. + +which is harmful to recalling positive samples. All these spatial-temporal person Re-ID methods establish the patterns based on the camera-level information, which means they can not provide fine-grained constraints for each instance. + +Different from existing spatial-temporal methods, our method models spatial-temporal patterns at the instance-level to filter out more irrelevant gallery images and provide personalized predictions. And the spatial-temporal patterns are decoupled into transmission probabilities and time interval distributions to make them mutually beneficial rather than in conflict. + +# 3. Method + +The instance-level spatial constraint i.e. transmission probabilities, and temporal constraint i.e. time interval distributions are detailed separately in this section. Then the adaptive combined metric is presented. + +# 3.1. Instance-level Spatial Constraint + +The spatial constraint between two cameras is described by the transmission probability of the cameras, which means how tightly the two cameras correlate. Formally, we model the transmission probability by a conditional probability: + +$$ +p _ {i, j} = \Pr \left(C _ {l} = j \mid C _ {e} = i\right) \tag {1} +$$ + +![](images/5600394596923b016ec49dc2e24827be321f760aadbd37f1c5dfeb589916d29b.jpg) +Figure 3. View of the first camera of DukeMTMC-reID. The state set of this camera contains two states: walking towards the red zone and walking towards the blue zone. + +where $i$ and $j$ are the indexes of cameras, $C_e$ is the camera that a person appears earlier, $C_l$ is the camera that the same person appears later. It is the probability that a person appears in the view of camera $j$ later on the condition that this person has appeared in the view of camera $i$ . The conditional probability in Eq. 1 can be easily calculated: + +$$ +p _ {i, j} = \frac {\Pr \left(C _ {l} = j , C _ {e} = i\right)}{\Pr \left(C _ {e} = i\right)} \tag {2} +$$ + +The higher the conditional probability means the person in the view of camera $i$ is more likely to appear in the view + +of camera $j$ later. The time interval between camera $i$ and $j$ is not involved here. Note that $p_{i,j} \neq p_{j,i}$ in most cases. + +However, the spatial patterns of persons appear in the same camera can be different, as shown in Fig. 2. To address this problem, we introduce the instance-level state information of a person into the conditional probability: + +$$ +p _ {i, j} ^ {s} = \Pr (C _ {l} = j | C _ {e} = i, s _ {e} = s) \tag {3} +$$ + +where $s_e$ is the state of a person in the view of $C_e$ , $s \in S_i$ , $S_i$ is the set of states: + +$$ +S _ {i} = \left\{s _ {1}, s _ {2}, \dots , s _ {n _ {i}} \right\} \tag {4} +$$ + +where $n_i$ is the number of states of camera $i$ . + +The instance-level states are represented by walking directions of pedestrians. For example, the view of the first camera of DukeMTMC-reID [7] is shown in Fig. 3. The state set of this camera contains two states: walking towards the red zone and walking towards the blue zone. The state sets of the rest cameras are defined similarly, and the illustrations of other cameras can be found in the supplementary material. + +Hence, the instance-level transmission probability can be calculated: + +$$ +p _ {i, j} ^ {\mathrm {s}} = \frac {\Pr \left(C _ {l} = j , C _ {e} = i , s _ {e} = s\right)}{\Pr \left(C _ {e} = i , s _ {e} = s\right)} \tag {5} +$$ + +# 3.2. Instance-level Temporal Constraint + +The temporal constraint is described by the time interval distribution, which represents the time lapse for a pedestrian to transfer between two cameras. Formally, we model the time interval distribution by a conditional probability density function: + +$$ +f _ {i, j} (\delta) = \frac {\mathrm {d} F _ {i , j} (\delta)}{\mathrm {d} \delta} \tag {6} +$$ + +where $\delta$ is the transfer time, $F_{i,j}(\delta)$ is the cumulative distribution function, which is a conditional probability: + +$$ +F _ {i, j} (\delta) = \Pr \left(\Delta \leq \delta \mid C _ {e} = i, C _ {l} = j\right) \tag {7} +$$ + +It can be harmful to recalling positive samples that fitting $f_{i,j}(\delta)$ or $F_{i,j}(\delta)$ into a closed-form probability distribution. Hence, a non-parameter estimation method is adopted in our method. Specially, we use Parzen window with Gaussian kernel to estimate $f_{i,j}(\delta)$ : + +$$ +f _ {i, j} (\delta) = \frac {1}{Z _ {i , j}} \sum_ {n} H _ {i, j} (\delta) K (n - \delta) \tag {8} +$$ + +$$ +H _ {i, j} (\delta) = \left\{ \begin{array}{l l} 1 & \delta \in \mathcal {D} _ {i, j} \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {9} +$$ + +where $K(\cdot)$ is the kernel function, $Z_{i,j} = \sum_{\delta}H_{i,j}(\delta)$ is a normalized factor, $\mathcal{D}_{i,j}$ is the time interval set between camera $i$ and camera $j$ of training samples. + +However, the time interval distribution of persons appear in the same camera can be different, as we have mentioned before. Similar to the instance-level transmission probabilities, the instance-level state information of a person is introduced into the conditional probability to address this problem: + +$$ +f _ {i, j} ^ {s} (\delta) = \frac {\mathrm {d} F _ {i , j} ^ {s} (\delta)}{\mathrm {d} \delta} \tag {10} +$$ + +$$ +F _ {i, j} ^ {s} (\delta) = \Pr \left(\Delta \leq \delta \mid C _ {e} = i, C _ {l} = j, s _ {e} = s\right) \tag {11} +$$ + +where $s_e$ is the instance-level state of a person in the view of $C_e$ . The moving direction is also considered as the key state information. Similar with Eq. 8, instance-level time interval distribution $f_{i,j}^{s}(\delta)$ can be estimated: + +$$ +f _ {i, j} ^ {s} (\delta) = \frac {1}{Z _ {i , j} ^ {s}} \sum_ {n} H _ {i, j} ^ {s} (\delta) K (n - \delta) \tag {12} +$$ + +$$ +H _ {i, j} ^ {s} (\delta) = \left\{ \begin{array}{l l} 1 & \delta \in \mathcal {D} _ {i, j} ^ {s} \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {13} +$$ + +where the normalized factor $Z_{i,j}^{s} = \sum_{\delta} H_{i,j}^{s}(\delta)$ , $\mathcal{D}_{i,j}^{s}$ is a subset of $\mathcal{D}_{i,j}$ , it contains the samples subject to $s_e = s$ . + +# 3.3. Joint Metric + +Given the transmission probability and time interval distribution affiliated to instance-level state information, the spatial-temporal probability is the fusion of them: + +$$ +\mathcal {P} = \mathcal {F} \left(p _ {s p a}, p _ {t e m}\right) \tag {14} +$$ + +where $p_{spa} = p_{i,j}^{s}$ is the instance-level transmission probability of two images in Eq. 5, and $p_{tem} = f_{i,j}^{s}(\delta)$ is the instance-level time interval probability in Eq. 10. And the final joint metric of two images is: + +$$ +\mathcal {S} \cdot \mathcal {P} = \mathcal {S} \cdot \mathcal {F} \left(p _ {\text {s p a}}, p _ {\text {t e m}}\right) \tag {15} +$$ + +where $S$ is the visual feature similarity. + +A straightforward way to fuse both components is multiplying $p_{spa}$ and $p_{tem}$ together. However, the constraint realized by directly multiplying is too strict for person re-identification. If a spatial/temporal pattern of a pedestrian is unusual, the person may be normal in terms of temporal/spatial patterns. This kind of samples should not be removed recklessly. Hence, the spatial-temporal probability $\mathcal{F}(p_{spa}, p_{tem})$ should be fairly high when only one of them is high. Fusion by multiplying directly is not proper here obviously. + +The spatial-temporal probability in our method is defined as: + +$$ +\mathcal {P} = \frac {1}{1 + e ^ {- (\alpha p _ {s p a} + \beta p _ {t e m})}} \tag {16} +$$ + +where $\alpha$ and $\beta$ are scaling parameters of similarity fusion. The spatial and temporal constraints are adjusted by $\alpha$ and $\beta$ separately. + +The spatial-temporal factor is scaled into $[0.5,1)$ . The constraint is relaxed properly when the spatial-temporal probability is low. And the value of $\mathcal{P}$ stays stable when $p_{spa}$ or $p_{tem}$ is low. + +# 3.4. Implementation Details + +More details are presented in this subsection. The moving direction of a pedestrian is complimentary information of pedestrian detection and tracking, which is a necessary step before person re-identification in practice. There is no need to predict the moving direction by an extra model or manual annotations. In our experiments, the moving directions of samples in the field of one camera are confirmed by tracking them in the original video of this camera. Actually, the moving direction of a pedestrian can be confirmed within five consecutive frames in most cases, which can be easily derived from existing tracking methods. + +A pretrained ResNet-50 is adopted as baseline for feature extraction. We set the standard deviation of the Gaussian kernel for distribution estimation to 100. As for the scaling parameters, $\alpha$ , $\beta$ in Eq. 16 are set to 0.15 and 1 respectively. + +# 4. Experiments + +In this section, we evaluate our method on two large scale person re-identification benchmark datasets, i.e. Market-1501 [23] and DukeMTMC-reID [7]. Then, more experimental analysis is presented. + +# 4.1. Datasets and Evaluation Protocol + +Market-1501 dataset [23] is collected at a university campus. A total of six cameras are used, including 5 high-resolution cameras, and one low-resolution camera. It contains 32,668 annotated bounding boxes of 1,501 identifies, plus a distractor set of over 500K images. The pedestrians are detected by Deformable Part Model (DPM). Among them, the training set consists of 12,936 images from 751 identities, the gallery set contains 19,732 images from other 750 identities and all the distractors. 3,368 hand-drawn bounding boxes from 750 identities are used as the query images. In this dataset, each image contains its camera index and time stamp. + +DukeMTMC-reID [7] is a subset of DukeMTMC dataset for image-based person re-identification. There are eight cameras in total. 1,404 identities appear in more than one camera and 408 identities (distractor) appear in only one camera. 702 identities are used for training, and the other 702 identities plus distractors are used for testing. One image for each identity in each camera is picked as a query, and the other images are put into the gallery. Each image contains its camera index and time stamp. + +We use two performance indexes as in most person re-identification literature. The first is mean average precision (mAP). The average precision (AP) of a query is + +
MethodsmAPRank-1Rank-5Rank-10
PCB [38]77.4%92.3%97.2%98.2%
VPM [39]80.8%93.0%97.8%98.8%
BOT [12]85.9%94.5%--
SPReID [25]81.3%92.5%97.15%98.1%
MGCAM [5]74.3%83.8%--
MaskReID [22]75.4%90.4%--
FPR [15]86.6%95.4%--
PDC [3]63.4%84.1%--
Pose-transfer [20]68.9%87.7%--
PSE [28]69.0%87.7%94.5%96.8%
PGFA [19]76.8%91.2%--
HOReID [33]84.9%94.2%--
Baseline82.2%93.6%98.4%99.0%
Baseline+st-ReID [8]88.6%96.9%99.2%99.5%
Baseline+InSTD90.8%97.6%99.5%99.7%
+ +Table 1. Comparison with the state-of-the-arts methods on Market-1501. Group 1: vanilla deep learning based methods. Group 2: human-parsing information based methods. Group 3: pose or key points based methods. Group 4: spatial-temporal methods. + +the area under the Precision-Recall curve, which means both precision and recall rate is taken into consideration. Hence, the mean average precision among all query images is a comprehensive performance index for person re-identification. The second is the cumulative matching characteristic (CMC) i.e. the top-k accuracy. Hence, the cumulative matching characteristic emphasizes precision rather than recall rate. + +# 4.2. Comparisons to the State-of-the-Art + +The proposed method is compared with fourteen existing state-of-the-art methods, which can be categorized into four groups. The first group of methods extract visual features directly from the person images, including PCB [38], VPM [39], and BOT [12]. These methods explore various aspects of visual feature extraction, including the structure of convolutional neural networks, training strategy, data augmentation, and loss function. The second group of methods adopt human parsing information for person re-identification, including SPReID [25], MGCAM [5], MaskReID [22] and FPR [15]. The third group of methods leverage the pose or key points of person images, including PDC [3], Pose-transfer [20], PSE [28], PGFA [19] and HOReID [33]. The fourth group of methods utilize the spatial-temporal information to enhance the person re-identification, including TFusion-sup [18] and st-ReID [8]. These methods use hard or soft constraints to narrow the number of gallery images. + +The experiment results on Market-1501 are shown in Tab. 1, and the results on DukeMTMC-reID are shown in Tab. 2. Our method outperforms all of the existing methods on both datasets. Comparing to the baseline model, + +
MethodsmAPRank-1Rank-5Rank-10
PCB [38]66.1%81.7%89.7%91.9%
VPM [39]72.6%83.6%91.7%94.2%
BOT [12]76.4%86.4%--
SPReID [25]70.9%84.4%91.8%93.7%
MGCAM [5]46.0%46.7%--
MaskReID [22]61.89%78.86%--
FPR [15]78.4%88.6%--
Pose-transfer [20]56.9%78.5%--
PSE [28]62.0%79.8%89.7%92.2%
PGFA [19]65.5%82.6%--
HOReID [33]75.6%86.9%--
Baseline72.7%85.7%90.9%93.5%
Baseline+st-ReID [8]84.3%94.1%96.3%97.2%
Baseline+InSTD89.1%95.7%97.2%98.0%
+ +Table 2. Comparison with state-of-the-arts for person re-identification on DukeMTMC-reID [7]. Group 1: vanilla deep learning based methods. Group 2: human-parsing information based methods. Group 3: pose or key points based methods. Group 4: spatial-temporal methods. + +which is a ResNet-50, our method improves the mAP by $8.6\%$ on Market-1501 and $16.5\%$ on DukeMTMC-reID, improve the Rank-1 accuracy by $4\%$ on Market-1501 and $10\%$ on DukeMTMC-reID. Our method achieves significant improvements especially in terms of mAP. + +Comparing to the methods in the first three groups, the advantage of our method is obvious. Besides, the compared methods in the second and third groups need expensive annotations, such as key points, pixel-wise parsing maps, and masks, to match the query and gallery images. Our method adopts economical information i.e. camera ID, timestamp, and state information. + +The disadvantages of the methods in the fourth group have been interpreted in Sec. 2. And the interpretations have been demonstrated by the results of experiments in this subsection. Given the same baseline model, our method outperforms the st-ReID by a remarkable margin, especially in terms of mAP (2.2% on Market-1501 and 4.8% on DukeMTMC-reID). These results indicate that our method has evident advantages over existing spatial-temporal methods. + +To show the effect of spatial-temporal constraint, an example from DukeMTMC-reID is presented in Fig. 4. The appearance of the pedestrian in the red bounding box, who is mistakenly ranked first, is similar to the query image. The visual representation cannot distinguish it from the correct identifies as shown in Fig. 4 (a). The incorrect pedestrian, which is difficult to discriminate for the visual representation, is filtered out by the spatial-temporal constraint as shown in Fig. 4 (b). + +The effect of instance-level information are shown in Fig. 5. The spatial-temporal constrains may be misguided + +![](images/1a9923f3e6087b7234dcdccd74bcfc52e9356400ddaee5b66b27548574f78f0a.jpg) +Figure 4. (a): The appearance of the pedestrian in the red bounding box, who is mistakenly ranked first, is similar to the query image. (b): The incorrect pedestrian is filtered out by the spatial-temporal constraint. + +![](images/a0eef4091fc9ce0d33eb1b95835b272a0d20cff90745d9341c30a72086acc69e.jpg) + +![](images/15d739103042f38c53b045f4031c59b732b443fad2a6315bb9b5058232dd7e5c.jpg) +Figure 5. (a): The top three of the ranked list are wrong samples because the spatial-temporal constraints are misguided without instance-level information. (b): The spatial-temporal constraints are more reliable because of the instance-level state. + +![](images/987c0200d4ef2d54d8e150bc424ca5b7991c68ac5ea2236828bcdcfdd2dbc3af.jpg) + +in complex scenarios, as shown in Fig. 5 (a). The instance-level information can make the spatial-temporal constrains more reliable for person re-identification. The incorrect pedestrians are filtered out by the instance-level state as shown in Fig. 5 (b). + +# 4.3. Experiments on Different Feature Extractors + +The proposed method can be applied to different feature extractors. To verify its effectiveness, we evaluate the proposed method based on other two feature extractors: PCB [38], and VPM [39]. + +The results are shown in Tab. 3. Our method consistently improves the performance of all feature extractors. Our method gains significant $20\% /11\%$ improvement in mAP/rank-1 accuracy for PCB [38], and $16\% + / 10\% +$ improvement for the other two feature extractors. Comparing to st-ReID [8], which is also based on spatial-temporal constraints, our method achieves consistent improvements too. Our method outperforms st-ReID [8] by $4\% + / 0.6\% +$ improvement in mAP/rank-1 accuracy for all of the feature extractors. + +The results show that our method can be generalized to different feature extractors. Moreover, the results demonstrate the advantages of our method comparing to the existing spatial-temporal based method. + +# 4.4. Analysis of Scaling Parameters + +To investigate the impact of two scaling parameters, $\alpha$ and $\beta$ in Eq. 16, we conduct two sensitivity analysis experiments on $\alpha$ and $\beta$ . The results are shown in Fig. 6. When + +
MethodsmAPRank-1Rank-5Rank-10
PCB [38]66.1%81.7%89.7%91.9%
PCB [38]+st-ReID [8]80.9%92.1%95.4%96.6%
PCB [38]+InSTD86.1%92.7%96.5%97.6%
VPM [39]72.6%83.6%91.7%94.2%
VPM [39]+st-ReID [8]84.9%94.2%96.1%96.9%
VPM [39]+InSTD89.3%95.1%97.0%97.9%
+ +![](images/a665f67b5e71ce01a91b8c97cfe627904a08d054be5eae3c1f63d0d76c677aeb.jpg) +Figure 6. Result of sensitivity analysis experiments on $\alpha$ and $\beta$ in Eq. 16. When analyzing one of them, the other one is fixed as its optimal value. The experimental results show that our method is is insensitive to fusion parameters. + +![](images/3ec818d33b193b6355d9a452d718daf5647954796bebb14ad5db1e0224f12471.jpg) + +analyzing one of them, the other one is fixed as its optimal value: $\alpha = 0.15$ , $\beta = 1$ . As we can observe, our method nearly keeps the best performance when $\alpha$ is in the range of 0.1 to 0.3 or $\beta$ is in the range of 1 to 1.7. The results show that our method is insensitive to fusion parameters. + +# 4.5. Ablation Study + +The ablation study on the instance-level state information of pedestrians and the decoupling of spatial-temporal patterns is presented in this part. + +Four protocols are taken into consideration. The first one is the proposed method itself. In the second protocol, $p_{spa}$ and $p_{tem}$ in Eq. 14 are replaced by $p_{i,j}$ (Eq. 2) and $f_{i,j}(\delta)$ (Eq. 8). The instance-level state information is excluded in this protocol. + +In the third protocol, the spatial pattern and temporal pattern are coupled together. The normalized factor in Eq. 12 is replaced by $\hat{Z}$ : + +$$ +\hat {f} _ {i, j} ^ {s} (\delta) = \frac {1}{\hat {Z} ^ {s}} \sum_ {n} H _ {i, j} ^ {s} (\delta) K (n - \delta) \tag {17} +$$ + +$$ +\hat {Z} ^ {s} = \max _ {i, j} Z _ {i, j} ^ {s} \tag {18} +$$ + +which means all time interval distributions share an identical denominator. The numerical relations of the area under curves indicate the transmission probabilities between cameras. And $p_{spa}$ and $p_{spa}$ are replaced by $p_{st}$ Eq. 16: + +$$ +\mathcal {P} = \frac {1}{1 + e ^ {\beta p _ {s t}}}, \tag {19} +$$ + +Table 3. Effects on different feature extractors. The experiments are conducted on DukeMTMC-reID [7] + +
ProtocolInstance Info.ST DecouplemAPRank-1
1✓✓89.1%95.7%
2×✓87.1%94.3%
3✓×86.9%95.0%
4××83.4%93.8%
+ +Table 4. Ablation Study results on DukeMTMC-reID [7]. + +$$ +p _ {s t} = \hat {f} _ {i, j} ^ {s} (\delta) \tag {20} +$$ + +In the fourth protocol, the instance-level state information is excluded based on the third protocol: + +$$ +\hat {f} _ {i, j} (\delta) = \frac {1}{\hat {Z}} \sum_ {n} H _ {i, j} (\delta) K (n - \delta) \tag {21} +$$ + +$$ +\hat {Z} = \max _ {i, j} Z _ {i, j} \tag {22} +$$ + +The results of these four protocols are shown in Tab. 4. The results show that the instance-level state information of pedestrians and the decoupling of spatial and temporal are both useful to improve the performance. + +Besides, the instance-level state information of pedestrians is more helpful to Rank-1 accuracy, and the decoupling of spatial and temporal patterns is more contributive to mAP. These results indicate that the decoupling of spatial and temporal patterns is more helpful to improve mAP by recalling more hard positive samples. The instance-level state information of pedestrians is more helpful to improve precision by narrowing the number of gallery images. The combination of these two strategies achieves the best performance. + +To demonstrate the effect of introducing instance-level state information, the time interval distributions between camera 1 and camera 2 of DukeMTMC-reID are shown in Fig. 7. The instance-level states are not taken into consideration in Fig. 7 (a). On the other hand, distributions of two states are shown separately in Fig. 7 (b). The distribution in Fig. 7 (a) is split into two distributions, which means more irrelevant gallery images can be filtered out according to the instance-level state information. + +To show the difference between spatial-temporal coupled constraint and spatial-temporal decoupled constraint, time interval distributions of camera 1 to camera 2 and camera 1 to camera 5 are shown in Fig. 8. In the coupled case, the spatial pattern is conveyed by the areas under distribution curves as shown in Fig. 8 (b). In the decoupled case, the areas under distribution curves are the same as shown in Fig. 8 (c), and the spatial pattern is decoupled from the time interval distributions as transmission probabilities. + +# 4.6. Failure Analysis + +In this part, we analyze the failure cases of the proposed method on DukeMTMC-reID. We find that the failures can be categorized as four cases: + +![](images/bea2ec69d3dad725ec7d80ac18f6451a273b5f7c616778eb2fcca0d0af7b2c83.jpg) + +![](images/f4025ac7af66b8570130daae8329bc1f4c887d57bc82c419983c5674ade020a8.jpg) +(a) + +![](images/0e8c821f386a1f82fe87e2078d43b0ad8c7333c50b6f3fed797d2163aad41c37.jpg) +(b) + +![](images/3a4138e078670c2076b70ca30955c53a88c5bf8aa427467bcfa5c1929d2b3bfa.jpg) + +![](images/fde79a70015a4a57a310b84c78156562eb62be5a0689980afb0117103b8ff9c8.jpg) +Figure 7. The time interval distributions between camera 1 and camera 2 of DukeMTMC-reID. (a): Time interval distribution without state information. (b): Time interval distributions with instance-level state information. The distribution in (a) is split into two distributions in (b), which means more irrelevant gallery images can be filtered out according to the instance-level state information. +(a) + +![](images/54a3e0ed20ea4a255fc8a86e9db96f7db7b30ee2bb62ebe0033f5a004dbfbd27.jpg) +(b) +Figure 8. The time interval distributions of camera 1 to camera 2 and camera 1 to camera 5 of DukeMTMC-reID. (a): Time interval frequencies. (b): Time interval distributions without spatial-temporal decouple. The spatial pattern is conveyed by the areas under distribution curves. (c): Time interval distributions with spatial-temporal decouple. The areas under distribution curves are the same. The spatial pattern is decoupled from the time interval distributions as transmission probabilities. (Instance-level state information is not shown for simplicity.) + +![](images/70e19da7cdcf01975920498ff5e009c7c14d9e91a0cb092df418babf1ee5a105.jpg) +(c) + +Firstly, there are incorrect labels in DukeMTMC-reID. The proportion of failure cases caused by incorrect labels is $16.2\%$ . It is harmful to keep the incorrect labels in + +the database. Hence, we release a cleaned data list of DukeMTMC-reID with this paper: https://github.com/RenMin1991/cleaned-DukeMTMC-reID/. + +Secondly, the feature extractor is fooled because of serious occlusions. For example, the upper part of two individuals is quite similar while the lower part is occluded. The proportion of this case in all failures is $56.9\%$ . + +In the third case, the visual feature is not discriminative enough to distinguish the hard negative samples. The proportion of this case in all failures is $23.5\%$ . + +In the last case, the proposed method outputs high probabilities due to spatial-temporal patterns. However, it improperly pushes up the final joint metric. The proportion of this case in all failures is $3.4\%$ . + +The failure analysis shows that serious occlusion is the main cause of mismatching (56.9%). The second important reason is that the feature extracted by the recognition model is not discriminative enough (23.5%). Incorrect labels also degrade the performance (16.2%). The proportion of failure samples caused by the improper spatial-temporal probability in all failures is quite small (3.4%). + +# 5. Conclusion + +In this paper, we propose a method to exploit spatial-temporal patterns for person re-identification. Different from the existing spatial-temporal person re-identification methods, the proposed method adopts the walking direction of each pedestrian, as key instance-level state information, to provide personalized predictions. In addition, the spatial-temporal patterns are decoupled into transmission probabilities and time interval distributions between cameras. The spatial-temporal patterns become mutually beneficial rather than in conflict with each other as current methods. A novel joint metric is proposed to fuse the instance-level spatial constraint, temporal constraint, and visual feature similarity. The superiority of our method is demonstrated by extensive contrast experiments. And adequate experimental analyses provide more insights into our method. + +# Acknowledgments + +The authors would like to thank Guanan Wang for his valuable help. This work is funded by National Natural Science Foundation of China (Grant No.62006225, 61806197, 62071468, U1836217) and supported by the Strategic Priority Research Program of Chinese Academy of Sciences (Grant No. XDA27040700), Tianjin Science and Technology Plan Project (17ZXRGGX00110). + +# References + +[1] Hermans Alexander, Beyer Lucas, and Leibe Bastian. In defense of the triplet loss for person re-identification. ArXiv 1703.07737, 2017. 2 + +[2] Bedagkar-Gala Apurva and Shah Shishir K. Multiple person re-identification using part based spatio-temporal color appearance model. In IEEE International Conference on Computer Vision Workshops (ICCV Workshops), 2011. 2 +[3] Su C., Li J., Zhang S., Xing J., Gao W., and Q. Tian. Pose-driven deep convolutional model for person reidentification. IEEE/CVF International Conference on Computer Vision (ICCV), 2017. 1, 2, 5 +[4] Weihua Chen, Xiaotang Chen, Jianguo Zhang, and Kaiqi Huang. A multi-task deep network for person re-identification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. 2 +[5] Song Chunfeng, Huang Yan, Ouyang Wanli, and Wang Liang. Mask-guided contrastive attention model for person re-identification. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2, 5, 6 +[6] Ahmed Ejaz, Jones Michael, and Tim K. Marks. An improved deep learning architecture for person re-identification. In IEEE Conference on Computer Vision & Pattern Recognition (CVPR), pages 3908-3916, 2015. 1, 2 +[7] Ristani Ergys, Solera Francesco, Zou Roger S, Cucchiara Rita, and Tomasi Carlo. Performance measures and a data set for multi-target, multi-camera tracking. In European Conference on Computer Vision (ECCV), 2016. 4, 5, 6, 7 +[8] Wang Guangcong, Lai Jianhuang, Huang Peigen, and Xie Xiaohua. Spatial-temporal person re-identification. Proceedings of the AAAI Conference on Artificial Intelligence, pages 8933–8940, 2019. 1, 2, 5, 6, 7 +[9] Wang Guangcong, Lai Jianhuang, and Xie Xiaohua. P2snet: Can an image match a video for person re-identification in an end-to-end way? IEEE Transactions on Circuits and Systems for Video Technology, 2017. 2 +[10] Wang Guangrun, Lin Liang, Ding Shengyong, Li Ya, and Wang Qing. Dari: Distance metric and representation integration for person verification. Proceedings of the AAAI Conference on Artificial Intelligence, 2016. 2 +[11] Wang Guanshuo, Yuan Yufeng, Chen Xiong, Li Jiwei, and Zhou Xi. Learning discriminative features with multiple granularities for person re-identification. 2018 ACM Multimedia Conference, 2018. 1 +[12] Luo Hao, Gu Youzhi, Liao Xingyu, Lai Shenqi, and Jiang Wei. Bag of tricks and a strong baseline for deep person re-identification. In The IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPR Workshops), June 2019. 5, 6 +[13] Lingxiao He, Jian Liang, Haiqing Li, and Zhenan Sun. Deep spatial feature reconstruction for partial person re-identification: Alignment-free approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[14] Lingxiao He, Xingyu Liao, Wu Liu, Xinchen Liu, Peng Cheng, and Tao Mei. Fastreid: A pytorch toolbox for general instance re-identification. arXiv preprint arXiv:2006.02631, 2020. 1 +[15] Lingxiao He, Wang Yinggang, Liu Wu, Zhao He, Sun Zhenan, and Feng Jiashi. Foreground-aware pyramid reconstruction for alignment-free occluded person re + +identification. In IEEE/CVF International Conference on Computer Vision (ICCV), 2019. 1, 2, 5, 6 +[16] Shuting He, Hao Luo, Pichao Wang, Fan Wang, Hao Li, and Wei Jiang. Transreid: Transformer-based object re-identification. arXiv preprint arXiv:2102.04378, 2021. 2 +[17] Takashi Isobe, Dong Li, Lu Tian, Weihua Chen, Yi Shan, and Shengjin Wang. Towards discriminative representation learning for unsupervised person re-identification. arXiv preprint arXiv:2108.03439, 2021. 2 +[18] Lv Jianming, Chen Weihang, Li Qing, and Yang Can. Unsupervised cross-dataset person re-identification by transfer learning of spatial-temporal patterns. IEEE Conference on Computer Vision & Pattern Recognition (CVPR), 2018. 1, 2, 5 +[19] Miao Jiaxu, Wu Yu, Liu Ping, Ding Yuhang, and Yang Yi. Pose-guided feature alignment for occluded person re-identification. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), 2019. 1, 2, 5, 6 +[20] Liu Jinxian, Ni Bingbing, Yan Yichao, Zhou Peng, and Hu Jianguo. Pose transferrable person re-identification. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2, 5, 6 +[21] Cho Yeong Jun, Kim Su A, Park Jae Han, Lee Kyuewang, and Yoon Kuk Jin. Joint person re-identification and camera network topology inference in multiple cameras. Computer Vision and Image Understanding, 2017. 1, 2 +[22] Qi Lei, Huo Jing, Wang Lei, Shi Yinghuan, and Gao Yang. Maskreid: A mask based deep ranking neural network for person re-identification. ArXiv 1804.03864, 2018. 1, 2, 5, 6 +[23] Zheng Liang, Shen Liyue, Tian Lu, Wang Shengjin, and Tian Qi. Scalable person re-identification: A benchmark. In IEEE International Conference on Computer Vision (ICCV), 2015. 5 +[24] Wu Liu, Qian Bao, Yu Sun, and Tao Mei. Recent advances in monocular 2d and 3d human pose estimation: A deep learning perspective. In CoRR abs/2104.11536, 2021. 2 +[25] Kalayeh Mahdi M., Basaran Emrah, Gokmen Muhittin, Kamasak Mustafa E., and Shah Mubarak. Human semantic parsing for person re-identification. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2, 5, 6 +[26] Bingpeng Ma, Yu Su, and Frederic Jurie. Covariance descriptor based on bio-inspired features for person reidentification and face verification. Image and Vision Computing, 2014. 2 +[27] Sakrapee Paisitkriangkrai, Chunhua Shen, and Anton Van Den Hengel. Learning to rank in person re-identification with metric ensembles. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 1 +[28] Sarfraz M. Saquib, Schumann Arne, Eberle Andreas, and Stiefelhagen Rainer. A pose-sensitive embedding for person re-identification with expanded cross neighborhood reranking. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 5, 6 +[29] Gong Shaogang, Cristani Marco, Yan Shuicheng, and Loy Chen Change. Person re-identification. Advances + +in Computer Vision & Pattern Recognition, 42(7):301-313, 2014. 2 +[30] Y. Shen, Hongsheng Li, Shuai Yi, Dapeng Chen, and X. Wang. Person re-identification with deep similarity-guided graph neural network. ArXiv, abs/1807.09975, 2018. 2 +[31] Ding Shengyong, Lin Liang, Wang Guangrun, and Chao Hongyang. Deep feature learning with relative distance comparison for person re-identification. Pattern Recognition, 48(10):2993–3003, 2015. 2 +[32] Dapeng Tao, Yanan Guo, Mingli Song, Yaotang Li, Zhengtao Yu, and Yuan Yan Tang. Person re-identification by dualregularized kiss metric learning. IEEE Transactions on Image Processing, 25(6):2726-2738, 2016. 1 +[33] Guan'an Wang, Shuo Yang, Huanyu Liu, Zhicheng Wang, Yang Yang, Shuliang Wang, Gang Yu, Erjin Zhou, and Jian Sun. High-order information matters: Learning relation and topology for occluded person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1, 2, 5, 6 +[34] Huang Wenxin, Hu Ruimin, Liang Chao, Yu Yi, and Zhang Chunjie. Camera network based person re-identification by leveraging spatial-temporal constraint and multiple cameras relations. In International Conference on Multimedia Modeling, 2016. 1, 2 +[35] Lin Wu, Chunhua Shen, Anton Van, and Den Hengel. Deep linear discriminant analysis on fisher networks: A hybrid architecture for person re-identification. Pattern Recognition, 2017. 1, 2 +[36] Chen Xuesong, Fu Canmiao, Zhao Yong, Zheng Feng, Song Jingkuan, Ji Rongrong, and Yang Yi. Salience-guided cascaded suppression network for person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1, 2 +[37] Yang Yang, Yang Jimei, Yan Junjie, Liao Shengcai, and Li Stan Z. Salient color names for person re-identification. European Conference on Computer Vision (ECCV), 2014. 2 +[38] Sun Yifan, Zheng Liang, Yang Yi, Tian Qi, and Wang Shengjin. Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). European Conference on Computer Vision (ECCV), 2018. 1, 5, 6, 7 +[39] Sun Yifan, Xu Qin, Li Yali, Zhang Chi, Li Yikang, Wang Shengjin, and Sun Jian. Perceive where to focus: Learning visibility-aware part-level features for partial person re-identification. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 5, 6, 7 +[40] Yuqi Zhang, Qian Qi, Chong Liu, Weihua Chen, Fan Wang, Hao Li, and Rong Jin. Graph convolution for re-ranking in person re-identification. arXiv preprint arXiv:2107.02220, 2021. 2 +[41] Zhizheng Zhang, Cuiling Lan, Wenjun Zeng, Xin Jin, and Zhibo Chen. Relation-aware global attention for person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2 +[42] Chen Shi Zhe, Guo Chun Chao, and Lai Jianhuang. Deep ranking for person re-identification via joint representation + +learning. IEEE Transactions on Image Processing, pages 1-1, 2016. 1 +[43] Kecheng Zheng, Wu Liu, Lingxiao He, Tao Mei, Jiebo Luo, and Zheng-Jun Zha. Group-aware label transfer for domain adaptive person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 2 +[44] Liang Zheng, Yi Yang, and Alexander G Hauptmann. Person re-identification: Past, present and future. ArXiv, 1610.02984, 2016. 2 \ No newline at end of file diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/images.zip b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..469d70e00f8b374fefc9a680eeeacf9870936503 --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38155194e9bf50c0b39c777b7e39a77b95e6aa8a68beec478f7d38d4d0f10b8f +size 639565 diff --git a/learninginstancelevelspatialtemporalpatternsforpersonreidentification/layout.json b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d59f9515acc06852c7f57b40d26dbbeed2ee01f5 --- /dev/null +++ b/learninginstancelevelspatialtemporalpatternsforpersonreidentification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f1ccf4616b67e06892605e3ee55a78a8281c5c698152a14e1559fdc6dc541ee +size 432963 diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_content_list.json b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6e716c5e6b8ded7dc5cffb32ee5d090c801e0a32 --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8914a857029a358b68005fc613e1b7cc9d7d4b2b03f49aba2e149dde8d068dc5 +size 84525 diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_model.json b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..baf05f5f790975d544bf1bdb7c19960323828ec4 --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7785d0506e19f69387b1e2dff50526a0b85521e4ba2f52024cb092e48322ef4 +size 106407 diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_origin.pdf b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..05b843b0ac03dc81a053cf81588fe869a29207e0 --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/af060170-ef04-469b-a0da-348b43df192a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb3e497448c108d60064073d635fdd0b62558e34c79e8c06c5ec3a7a2d8908e8 +size 1457930 diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/full.md b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..af9d54f71eb7bb5054cb2f6ac56d09dddfa34cca --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/full.md @@ -0,0 +1,342 @@ +# Learning Latent Architectural Distribution in Differentiable Neural Architecture Search via Variational Information Maximization + +Yaoming Wang $^{1\dagger}$ , Yuchen Liu $^{1\dagger}$ , Wenrui Dai $^{2*}$ , Chenglin Li $^{1}$ , Junni Zou $^{2}$ , and Hongkai Xiong $^{1}$ \ + $^{1}$ Department of Electronic Engineering, Shanghai Jiao Tong University, China\ + $^{2}$ Department of Computer Science & Engineering, Shanghai Jiao Tong University, China\ +{wang-yaoming, liuyuchen6666, daiwenrui, lcl1985, zoujunni, xionghongkai}@sjtu.edu.cn + +# Abstract + +Existing differentiable neural architecture search approaches simply assume the architectural distribution on each edge is independent of each other, which conflicts with the intrinsic properties of architecture. In this paper, we view the architectural distribution as the latent representation of specific data points. Then we propose Variational Information Maximization Neural Architecture Search (VIM-NAS) to leverage a simple yet effective convolutional neural network to model the latent representation, and optimize for a tractable variational lower bound to the mutual information between the data points and the latent representations. VIM-NAS automatically learns a nearly one-hot distribution from a continuous distribution with extremely fast convergence speed, e.g., converging with one epoch. Experimental results demonstrate VIM-NAS achieves state-of-the-art performance on various search spaces, including DARTS search space, NAS-Bench-1shot1, NAS-Bench-201, and simplified search spaces S1-S4. Specifically, VIM-NAS achieves a top-1 error rate of $2.45\%$ and $15.80\%$ within 10 minutes on CIFAR-10 and CIFAR-100, respectively, and a top-1 error rate of $24.0\%$ when transferred to ImageNet. + +# 1. Introduction + +With the development of deep learning, various neural architectures are needed for specific tasks. Given a specific dataset, neural architecture search (NAS) frees researchers from cumbersome architecture design by exploring the search space automatically to search for the optimal network architecture. Since different datasets have their own preference for the architecture, for instance, biomedical images favor U-Net alike architectures with fully convolutional operations and symmetrical structure. NAS can be deemed as searching for the preference of a given dataset. + +Thus, the architectural parameters can be viewed as the latent representation of specific data points. + +In the sense of methodology, NAS can be divided into three parts, i.e., search space, search strategy, and performance estimation strategy [17, 38]. One-shot approaches [3, 4, 34] have been developed as a promising alternative to reduce the search time by finding the best sub-network in a super network through parameter sharing. Gradient-based approaches [51, 29, 37, 41], aka Differentiable NAS, further treat the super network as the whole search space, introduce architectural parameters, and obtain the sub-network by optimizing the architectural parameters and super network weights in a differentiable manner. + +Despite the remarkable performance, existing differentiable NAS approaches make improper assumptions that the predefined architectural distribution on each edge is independent of each other, conflicting with intrinsic properties of architecture. Specifically, SNAS [41] and FBNet [39] utilize the Concrete distribution [22, 30] to approximate the discrete categorical distribution on architectural parameters. DATA [51] performs multiple sampling with replacement from the same Concrete distribution to expand the search space. SI-VDNAS [37] introduces Gaussian noise for variational dropout and samples the super network through the learned dropout rate. Isotropic Gaussian noise in SI-VDNAS as well as the factorizable distribution in SNAS, FBNet and DATA ignores the dependencies between architectural parameters. + +In addition to the above improper assumptions, the search cost for differentiable NAS approaches is also prohibitive due to the numerous search spaces and tasks. Two-stage approaches [47, 36] decouple the model training and searching process for amortizing the training cost, but are still restricted by numerous search spaces. Therefore, an efficient search strategy with fast convergence speed is desirable for differentiable NAS. + +In this paper, we propose a novel search strategy, namely Variational Information Maximization Neural Architecture Search (VIM-NAS), to maximize the mutual information + +between the data points and the latent architectural representations. VIM-NAS leverages a simple yet effective convolutional neural network to model the latent architectural representation, and optimizes for a tractable variational lower bound to the mutual information. Our contributions are summarized below. + +- We propose a novel perspective that architectural distribution can be deemed as the latent representation of a given dataset in NAS. +- We leverage a simple yet effective architectural neural network to model the dependencies among architectural distribution. +- We propose a novel search strategy to maximize the variational lower bound to the mutual information between the data points and the latent architectural representations. + +Experimentally, VIM-NAS exhibits currently the fastest convergence speed within one epoch and learns a nearly one-hot distribution from a continuous distribution. Specifically, VIM-NAS achieves the state-of-the-art performance on DARTS search space with a top-1 error rate of $2.45\%$ and $15.80\%$ within 10 minutes on CIFAR-10/100 and a top-1 error rate of $24.0\%$ when transferred to ImageNet. VIM-NAS also achieves the state-of-the-art performance on other search spaces, including NAS-Bench-1shot1, NAS-Bench201 and simplified search spaces S1-S4. + +# 2. Related Work + +NAS approaches liberate researchers from tedious network architecture design on various tasks, including image classification [54], objection detection [19, 20, 45], image segmentation [18, 28], and pose estimation [2, 50] etc. Meanwhile, more efficient and stable neural architecture search strategies are still attracting a lot of research. Evolutionary algorithms [16, 31, 35, 44] encode network architectures into populations, optimize populations through continuous iterative mutation, and eventually translate populations back to networks. Reinforcement learning (RL)-based approaches [3, 34, 54] utilize a meta-controller to guide the search process in a large architectural space based on a reward function corresponding to the inference accuracy of the selected network. Despite the remarkable performance, evolutionary algorithms and RL-based methods suffer from high search cost due to repeated evaluations. One-shot approaches [1, 3, 4, 34] adopt parameter sharing to reduce the search cost. Gradient-based approaches [29, 41, 37] further introduce architectural parameters to optimize searched architectures in a differentiable fashion. + +Though differentiable approaches can achieve fast search speed, the search process still encounters the unstable prob + +lem and tedious super network training for each search process. Recently, the collapse problem in DARTS attracts a lot of work. FairDARTS [11] utilizes the sigmoid function to avoid unfair exclusive competition. SGAS [25], instead, circumvents the problem with a greedy strategy. DARTS+ [27] and Progressive DARTS [8] employ early stopping to control the number of identity operations. These approaches involve too much human intervene, are not suitable for different search spaces, and are hard to transfer to different tasks. [48] designs indicators like Hessian eigenvalues for the collapse, and [7] adds perturbations to regularize such an indicator. Unsupervised representation [43] for neural architecture is also utilized to learn good architecture representation using architectures without accuracy. TE-NAS [6] proposes a training-free strategy to rank the candidate architectures with the spectrum of the neural tangent kernel (NTK) and the number of linear regions in the input space. + +# 3. Methodology + +# 3.1. Preliminary: Differentiable NAS + +Differentiable NAS decomposes the searched architecture into stacking cells. The search space is defined as a directed acyclic graph (DAG) over cells with $N$ nodes. Each node is a latent representation and there is a predefined operation set denoted by $\mathcal{O}$ on each edge $(i,j)$ connecting node $i$ and $j$ . The core idea is to relax the discrete operation selection to be continuous and obtain a weighted sum over all $|\mathcal{O}|$ operations on each edge as + +$$ +f _ {i, j} \left(x _ {i}\right) = \sum_ {o \in \mathcal {O}} \frac {\exp \left(\alpha_ {i , j} ^ {o}\right)}{\sum_ {o ^ {\prime} \in \mathcal {O}} \exp \left(\alpha_ {i , j} ^ {o ^ {\prime}}\right)} \cdot o \left(x _ {i}\right) \tag {1} +$$ + +where $x_{i}$ is the output of the $i$ -th node and $\alpha_{i,j}^{o}$ is the architectural parameter. The output of a node is the sum over all input edges as $\mathbf{x}_j = \sum_{i < j} f_{i,j}(\mathbf{x}_i)$ , and the output of the total cell is the concatenation of the output of nodes as $\text{concat}(\mathbf{x}_2, \mathbf{x}_3, \ldots, \mathbf{x}_{N-1})$ , where $\mathbf{x}_0$ and $\mathbf{x}_1$ are the fixed input nodes. Based on the cell search space, Differentiable NAS relaxes the architecture search to learn the architectural parameter $A = [\alpha^{(i,j)}]$ . With the target dataset and optimization objective, the architectural parameter $A$ and the network weight $w$ are optimized via gradient descent alternatively [29] or jointly [41]. + +# 3.2. VIM-NAS + +We deem the architecture as the latent variable for the observed data. Given a dataset $\mathcal{D}$ consisting of $N$ pairs of observations and labels $\{(x_{n},y_{n})\}_{n = 1}^{N}$ , we consider a joint distribution $p_{\phi}(\mathcal{D},A) = p(\mathcal{D})p_{\phi}(A|\mathcal{D})$ between the dataset $\mathcal{D}$ and architecture $A$ , where $p(\mathcal{D})$ is the distribution of dataset $\mathcal{D}$ and $p_{\phi}(A|\mathcal{D})$ is the posterior architectural distribution parameterized by $\phi$ . In differentiable NAS, we + +learn the parameter $\phi$ that accurately predicts the specific dataset $\mathcal{D}$ using the architecture $A$ . To achieve this goal, we propose to maximize the mutual information $I_{\phi}(\mathcal{D}, A)$ between the dataset $\mathcal{D}$ and architecture $A$ as: + +$$ +\begin{array}{l} \max _ {\phi} I _ {\phi} (\mathcal {D}, A) = \mathbb {E} _ {p _ {\phi} (\mathcal {D}, A)} \left[ \log \frac {p _ {\phi} (\mathcal {D} , A)}{p (\mathcal {D}) p _ {\phi} (A)} \right] \\ = H (\mathcal {D}) - H _ {\phi} (\mathcal {D} | A), \tag {2} \\ \end{array} +$$ + +where $H(\cdot)$ denotes information entropy. Since the data entropy $H(\mathcal{D})$ is constant for a given dataset $\mathcal{D}$ and independent of $\phi$ , we can omit $H(\mathcal{D})$ in Equation (2). + +$$ +\max _ {\phi} - H _ {\phi} (\mathcal {D} | A) = \mathbb {E} _ {p _ {\phi} (\mathcal {D}, A)} \left[ \log p _ {\phi} (\mathcal {D} | A) \right] \tag {3} +$$ + +It can be extremely challenging to compute the mutual information between high-dimensional random variables. Thus, we obtain the lower bound of the mutual information by introducing a variational approximation $q_{\theta}(\mathcal{D}|A)$ to the true posterior distribution $p_{\phi}(\mathcal{D}|A)$ . + +$$ +\begin{array}{l} I _ {\phi} (\mathcal {D}, A) = H (\mathcal {D}) + \mathbb {E} _ {p _ {\phi} (\mathcal {D}, A)} [ \log q _ {\theta} (\mathcal {D} | A) ] \\ + D _ {K L} \left(p _ {\phi} (\mathcal {D} | A) | | q _ {\theta} (\mathcal {D} | A)\right) \\ \geq H (\mathcal {D}) + \mathbb {E} _ {p _ {\phi} (\mathcal {D}, A)} [ \log q _ {\theta} (\mathcal {D} | A) ] \tag {4} \\ \end{array} +$$ + +Equation (4) suggests that the lower bound is tight when $q_{\theta}(\mathcal{D}|A)$ matches $p_{\phi}(\mathcal{D}|A)$ . In the view of NAS, the true posterior $p_{\phi}(\mathcal{D}|A)$ is the distribution of sub-network and is approximated with the distribution of super network $q_{\theta}(\mathcal{D}|A)$ . Formally, the objective for differentiable NAS is + +$$ +\max _ {\theta , \phi} \mathbb {E} _ {p _ {\phi} (\mathcal {D}, A)} \left[ \log q _ {\theta} (\mathcal {D} | A) \right], \tag {5} +$$ + +where $\phi$ is the architectural parameter and $\theta$ is the network weight. Given arbitrary finite dataset $\mathcal{D}$ , we estimate the expectations with respect to $p(\mathcal{D})$ and its gradients via Monte Carlo methods. The objective $\mathcal{L}(\phi, \theta; \mathcal{D})$ is formulated as + +$$ +\max _ {\theta , \phi} \mathcal {L} (\phi , \theta ; \mathcal {D}) = \sum_ {d \in \mathcal {D}} \mathbb {E} _ {p _ {\phi} (A | \mathcal {D})} [ \log q _ {\theta} (\mathcal {D} | A) ]. \tag {6} +$$ + +Existing differentiable NAS approaches [29, 39, 41] assume that architectural distribution on each edge is independent of each other. Thus, the true posterior $p_{\phi}(A|\mathcal{D})$ can be factorized in the form of $\prod_{i}p_{\phi_{i}}(A_{i}|\mathcal{D})$ to simplify the search process. A simple Monte Carlo sampling is leveraged to compute the expectation in Equation (6). However, this assumption obscures the natural dependencies among architectural parameters. As convolutional neural networks exhibit powerful ability in fitting arbitrary functions, we can leverage it to model the implicit distribution [33, 46] and achieve the simple sampling by forward propagation. Instead of fully factorizable assumption, we leverage convolutional neural network to model the architectural distribution $p_{\phi}(A|\mathcal{D})$ . Since the single convolutional neural network $\phi(\cdot)$ can only conduct point estimation for architectural distribution, we further introduce an additive Gaussian + +# Algorithm 1 VIM-NAS + +Input: Data $\mathcal{D} = \{x_n, y_n\}_{1:N}$ , initialized network weights $\theta$ , initialized architectural neural network parameters $\phi$ , and input Gaussian noise $\epsilon$ . + +Output: The searched final architecture. + +1: while not converged do +2: Sample Gaussian noise $\xi \sim \mathcal{N}(0,1)$ +3: Sample architecture $A = \phi(\epsilon) + \xi$ , $A \sim p_{\phi}(A|\mathcal{D})$ . +4: Update weights $\theta$ by descending $\nabla_{\theta}\mathcal{L}(\phi ,\theta ;\mathcal{D})$ +5: Update network $\phi$ by descending $\nabla_{\phi}\mathcal{L}(\phi ,\theta ;\mathcal{D})$ + +6: end while + +7: Derive the final architecture based on the learned $\phi$ . + +noise $\xi \sim \mathcal{N}(0,1)$ , and reformulate the architectural distribution $p_{\phi}(A|\mathcal{D}) = \mathcal{N}(\mu_{\phi},1)$ , where $\mu$ is parameterized by the convolutional neural network $\phi (\cdot)$ . Algorithm 1 elaborates the implementation of VIM-NAS. + +# 3.3. Architectural Neural Network + +VIM-NAS leverages an architectural neural network ConvReLUBN(3,14,3)-ConvReLUBN(14,1,3) to model the architectural distribution, where ConvReLUBN denotes the module stacked with convolution, relu and batch normalization, and the following three numbers denote the input channel number, output channel number and kernel size, respectively. The details of architectural neural network can be referred to supplementary materials. We further take a microscopic view for this architectural neural network, and figure out what is learned by the simple convolutional neural network. We visualize the feature map of the ConvReLUBN(3,14,3) module in Figure 1. As we can see from Figure 1, the initialized feature map is dense and random, while a sparse connection is learned from convolutional neural network after training one epoch. This phenomenon indicates that the proposed simple convolutional neural network captures the dependencies among architectural distribution. + +# 3.4. Convergence to Nearly One-hot Within 1 Epoch + +To our best knowledge, VIM-NAS is the fastest differentiable NAS approaches up to now. VIM-NAS can reach the convergent result by only training one epoch in DARTS search space. Figures 2 and 3 demonstrate that VIM-NAS learns a nearly one-hot architectural distribution from the random initialized continuous distribution automatically after one epoch training. + +Compared with DARTS, as shown in Figure 2, which exhibits oscillation and homogeneity among candidate operations during the search period, VIM-NAS approaches to the true posterior distribution of sub-network with a nearly one-hot architectural distribution. To verify the impact of initialization imposed on the convergent nearly one-hot architectural distribution, Figure 3 utilizes different colors for + +![](images/858aaf432475d6a991fc915886809563834a73c2049f6d7387fb2b9586ae0ea4.jpg) +(a) Initialized feature map + +![](images/b513522aa297babeca6232cac610efff98388e555c38fc2042e6bd280009d5e7.jpg) +(b) Convergent feature map after one epoch + +![](images/cdfdedd127e8cb56c312d1e864ca8cb99b0791873624c89fd7b26234c85fc70a.jpg) +(a) DARTS-N + +![](images/0e3ae67cb96466941b3f13edd9766740c281b4494bf8e05389af0ef4b1d40668.jpg) +Figure 1. Comparison with initialized feature map and convergent feature map (one epoch training) of intermediate layer. In each sub figure, 14 channels of feature maps and each feature map shares the same size as candidate operations and edges. +(b) VIM-NAS-N + +![](images/f5f03d6f48b69362356042d96dbd60a4b407d577346978f1c0f0343ae83d22f7.jpg) +Figure 2. Anytime architectural weights on the first edge of normal cell on DARTS search space for DARTS and VIM-NAS. 'N' denotes the searched normal cell(best viewed in color). +Figure 3. Contrast of architectural distribution between initialization and convergence after training one epoch. + +![](images/4dd0ab880a8179ecc972a1fc4d0ea0a397d1d54bc8b46067f07c893900521fc5.jpg) +(a) Initialized architectural distribution +(b) Convergent architectural distribution after one epoch training + +a brief instruction that the information is learned from the dataset instead of random initialization. + +# 3.5. Discussion + +Understanding VIM-NAS in a GAN-alike Way. In generative models, a convolutional neural network is leveraged + +to learn the good representation from the noise for downstream tasks. Similarly, VIM-NAS utilizes a simple convolutional neural network $\phi$ to map the input noise to the target architectural distribution. + +When considering to utilize the network $\phi$ for the modeling of architectural distribution, the optimization objective can be deemed as adversarial optimization of two networks. Specifically, the architectural neural network serves as a generator to learn a good representation of architectural distribution, while the super network acts as a discriminator to distinguish the architecture with good performance. In contrast to vanilla GAN, which utilizes the real data as the ground truth to optimize the discriminator, our VIM-NAS has no explicit good architectures as reference. Consequently, VIM-NAS leverages the training accuracy of a given dataset to optimize the discriminator. + +Reformulation of Variational Dropout NAS. Furthermore, we also leverage the convolutional neural network $\varphi(\cdot)$ to parameterize the variance $\sigma$ of Gaussian architectural distribution. Specifically, we achieve the parameterized architectural distribution as $p_{\phi,\varphi}(A|\mathcal{D}) = \mathcal{N}(\mu_{\phi},\sigma_{\varphi})$ . We can utilize the reparameterization trick to sample from the distribution as $A = \mu_{\phi} + \sigma_{\varphi}\cdot \xi$ , $\xi \sim \mathcal{N}(0,1)$ . Moreover, we can reinterpret the architectural distribution with variational dropout [23, 32] as $\mathcal{N}(\mu,\mu^2\delta)$ , where $\delta = \sigma/\mu^2 = p/(1-p)$ , and $p$ denotes the Gaussian dropout rate. Following [37], a sparse constraint is also leveraged in our experiments. We name the reformulated variational dropout NAS as VIM-NAS-Dropout and report the results in Section 4. + +# 4. Experiments + +# 4.1. Datasets + +We conduct experiments on CIFAR-10/100 [24] and ImageNet [12], three most popular datasets for evaluating NAS. CIFAR-10/100 consist of 60K images, 50K training images and 10K test images. ImageNet is a large-scale benchmark for image classification that contains 1.3M training images and 50K test images. + +# 4.2. Experiments on DARTS Search Space + +Search Space. Following DARTS [29], the macro architecture is constructed by stacking 6 normal cells and 2 reduction cells. Each cell contains seven nodes, including two input nodes, four intermediate nodes and one output node. The outputs of four intermediate nodes are concatenated as the input to the output node. Each cell has 14 candidate edges, 8 candidate operations for each edge, 'zero' operation is utilized to select candidate edges implicitly. + +Search Settings. During the search process, DARTS directly utilizes $14 \times 8$ architectural parameters to describe the micro DAG. Instead, VIM-NAS leverages an architectural neural network to model the architectural distribution. The + +![](images/c7fd4a2ee3cdafd1111bbc5d3fd67308244037438990be72ffb8ea80104b7a5f.jpg) +Figure 4. Anytime test regret on NAS-Bench-1Shot1 (best viewed in color). + +![](images/fb009b35497ce44f4020e9093f53db5f5d3bc4174f93bc17b6f214f09d8d44bc.jpg) + +![](images/26cf349def2767822150d191f4d6b56607c3d0e53af2f721eeb8c61b850430d9.jpg) + +![](images/e628d1d0399f5838ba8ce0b61f5e13c95a763ccf6850a2112ccdaed6a7bcc755.jpg) + +![](images/0c37a25eab1a18317b1b13e42f996467788bca461d3443c38fd4b661ffe88154.jpg) +Figure 5. Searched normal cell and reduction cell of VIM-NAS on DARTS search space on CIFAR-10. + +architectural neural network parameters and conventional network weights are optimized with two separate momentum SGD optimizers, respectively. Since the architectural neural network is quite small, the extra computation cost is negligible. Other detailed settings for searching and evaluation are the same as DARTS (please refer to supplementary materials). + +Results on CIFAR-10. Our proposed VIM-NAS reaches the convergent result after training only one epoch (within 10 minutes on a single NVIDIA GTX 1080 Ti GPU). The architectural distribution reaches almost one-hot and remains unchanged during further training. The searched normal cell and reduction cell on CIFAR-10 are shown in Figure 5. As in Table 1, VIM-NAS can achieve state-of-the-art performance with the top-1 test error of $2.45\%$ and $15.80\%$ on CIFAR-10 and CIFAR-100, respectively. + +Results on ImageNet. We further transfer the searched architectures on CIFAR-10 to ImageNet to evaluate the generalization ability. As shown in Table 2, VIM-NAS achieves state-of-the-art performance with a top-1 error rate of $24.0\%$ and a top-5 error rate of $7.2\%$ compared with other popular gradient-based NAS approaches. Notice that we can outperform the directly searched architecture on ImageNet by + +
ArchitectureTop-1 (Test) Error (%)Params (M)Cost (days)
CIFAR-10CIFAR-100
DARTS-V1 [29]3.00 ± 0.1417.76*3.30.4
DARTS-V2 [29]2.76 ± 0.0917.54*3.31
P-DARTS [8]2.5016.55*3.40.3
SNAS [41]2.85 ± 0.02-2.81.5
PARSEC [5]2.81 ± 0.03-3.71
BayesNAS [53]2.81 ± 0.04-3.40.2
DATA (M = 7) [51]2.79-2.91
PC-DARTS [42]2.57 ± 0.07-3.60.1
ASNG-NAS [1]2.83 ± 0.14-3.90.11
SI-VDNAS-C† [37]2.60 ± 0.0516.202.70.8
GDAS [15]2.9318.383.40.21
SDARTS-ADV [7]2.61 ± 0.02-3.31.3
SGAS [25]2.66 ±0.24-3.70.25
DARTS- [10]2.59 ± 0.08-3.50.4
TE-NAS [6]2.63 ± 0.06-3.80.05
VIM-NAS2.45 ± 0.0415.803.90.007
+ +Table 1. Comparison with state-of-the-art gradient-based NAS methods for image classification on CIFAR-10/100. For each method, top-1 test error $(\%)$ , number of parameters (M) and search cost (GPU-days) are evaluated. Here, lower error rate stands for better performance and * indicates that the experiments are conducted by P-DARTS.† denotes that SI-VDNAS-C are the searched convergent cell. + +PC-DARTS. Moreover, we conduct a direct search on ImageNet and achieve even better performance with a top-1 error rate of $23.8\%$ and a top-5 error rate of $7.1\%$ . + +# 4.3. Experiments on NAS-Bench-201 + +Settings. Based on the reduced DARTS-like cell search space, NAS-Bench-201 [13] has 4 internal nodes with 5 operations per node, which constructs 15,625 architectures in total. All the architecture performance on three datasets (CIFAR-10, CIFAR-100, ImageNet-16-120 [9]) can be directly obtained by querying in the database as ground-truth. We use the same search setting with Section 4.2, and keep the hyperparameters for all compared methods the same as [13]. We run every method 4 independent times with different random seeds and report the results in Table 3. + +
ArchitectureTest Error (%)FLOPS (M)Search Cost (GPU-days)
Top-1Top-5
DARTS (2nd) [29]26.78.75741
GDAS [15]26.08.55810.21
PARSEC [5]26.08.4-1
PC-DARTS [42]25.17.85860.1
\( \text{PC-DARTS}^{\dagger} \)[42]24.27.35973.8
P-DARTS [8]24.47.45570.3
\( \text{DARTS+}^{\dagger} \)[27]23.97.45826.8
\( \text{DARTS-}^{\dagger} \)[10]23.87.04674.5
FairDARTS-B [11]24.97.55410.4
DSO-NAS-share [52]25.48.45866
SDARTS-ADV [7]25.27.8-1.3
SGAS [25]24.27.25850.25
SparseNAS [40]24.77.6-1
BayesNAS [53]26.58.9-0.2
DATA (M = 7) [51]24.98.1-1.5
SI-VDNAS-B [37]25.38.05770.3
TE-NAS [6]26.28.3-0.05
\( \text{TE-NAS}^{\dagger} \)[6]24.57.5-0.17
VIM-NAS24.07.26270.007
\( \text{VIM-NAS}^{\dagger} \)23.87.16600.26
+ +Table 2. Comparison with state-of-the-art gradient-based NAS methods on ImageNet. For each method, top-1 and top-5 test errors $(\%)$ , FLOPS (M) and search cost (GPU-days) are evaluated. Here, lower error rate stands for better performance and $\dagger$ indicates that the architecture is directly searched on ImageNet. + +Results. During the search process on CIFAR-10, our proposed VIM-NAS can reach the convergent result after training only one epoch (232.51 seconds on a single NVIDIA GTX 1080 Ti GPU). Compared with Random baseline, our VIM-NAS shows better performance on all three datasets. Compared with other differentiable algorithms DARTS-V1 [29], DARTS-V2 [29], GDAS [15], SETN [14], DARTS- [10] and TE-NAS [6], our proposed VIM-NAS achieves a new state-of-the-art, the best of which almost touches the optimal. Moreover, we achieve state-of-the-art performance by training one epoch with much reduced search time, which is minimal among differentiable approaches. Though TE-NAS proposes a training-free strategy, the search cost is six times as large as VIM-NAS. Consequently, our VIM-NAS demonstrates more stable and superior performance on NAS-Bench-201. + +# 4.4. Experiments on NAS-Bench-1Shot1 + +Settings. NAS-Bench-1Shot1 [49] consists of 3 search spaces based on CIFAR-10, which contains 6,240, 29,160 and 363,648 architectures, respectively. The macro architecture is constructed by stacking 3 blocks and each block contains 3 stacked cells. The micro architecture of each cell is represented as a DAG. The search algorithm needs to determine the operation on every edge, as well as the topology of edges connecting input, output nodes and the choice blocks. We leverage the architectural neural network + +(same as Section 4.2) to model the operation distribution and keep the other parameters the same as [49] to determine the topology. We compare our proposed methods with other popular NAS algorithms on all 3 search spaces. Each algorithm is trained for 50 epochs with three independent times, and the hyperparameters are set as defaults [49]. + +Results. The anytime test regret averaged from three independent runs are exhibited in Figure 4. Our proposed VIM-NAS can reach the convergent result after training for several epochs (2-5 epochs) in all three search spaces. Though the operation distribution parameterized by the architectural neural network reaches convergence in one epoch, the other topology parameters require several epochs to converge. Random Search with Weight Sharing [26] and ENAS [34] mainly find some poor performance architectures. GDAS [15] turns to converge prematurely to a suboptimal local minimum. DARTS and PC-DARTS explore some better architecture as the search process goes gradually. Our proposed VIM-NAS achieves state-of-the-art performance after training several epochs in search spaces 1 and 2, respectively. For search space 3, VIM-NAS can also achieve a satisfactory result after training two epochs. Compared with GDAS, which demonstrates the premature convergence due to the temperature annealing of the Gumbel Softmax, our VIM-NAS consistently converges to a better local minimum across all three search spaces. + +# 4.5. Experiments on Simplified Search Spaces S1-S4 + +Settings. RobustDARTS (R-DARTS) [48] proposed four simplified search spaces (S1-S4), which keep the same macro architecture as DARTS but only contain a portion of candidate operations (please refer to details in R-DARTS [48]). We search on CIFAR-10 with the same architectural neural network to model the architectural distribution as Section 4.2. There are two different evaluation settings from R-DARTS [48], SDARTS [7] and DARTS- [10]. Following R-DARTS [48], we use 20 cells with 36 initial channels for CIFAR-10 in S1 and S3, 20 cells with 16 initial channels for CIFAR-10 in S2 and S4, and 8 cells with 16 initial channels for CIFAR-100 in all four search spaces. Moreover, following SDARTS [7] and DARTS- [10], we evaluate the architecture performance using 20 cells with 36 initial channels for CIFAR-10 in S2 and S4, and 20 cells with 36 initial channels for CIFAR-100 in all four search spaces. We run every method 4 independent times and pick the final best architecture performance reported in Table 4. + +Results. Our proposed VIM-NAS can converge after training one epoch (within 10 minutes), and the searched architecture performance outperforms the recent SOTAs across several spaces and datasets, which further demonstrate the robustness of VIM-NAS. Specifically, we find a good architecture in S1 with the lowest top-1 test error of $2.61\%$ and $16.12\%$ on CIFAR-10 and CIFAR-100, respectively. Be + +
MethodSearch Cost (seconds)CIFAR-10 (%)CIFAR-100 (%)ImageNet-16-120 (%)
validationtestvalidationtestvalidationtest
ResNet [21]N/A90.8393.9770.4270.8644.5343.63
Random0.0190.93 ± 0.3693.70 ± 0.3670.60 ± 1.3770.65 ± 1.3842.92 ± 2.0042.96 ± 2.15
Reinforce [54]0.1291.09 ± 0.3793.85 ± 0.3770.05 ± 1.6770.17 ± 1.6143.04 ± 2.1843.16 ± 2.28
ENAS [34]14058.8039.77 ± 0.0054.30 ± 0.0010.23 ± 0.1210.62 ± 0.2716.43 ± 0.0016.32 ± 0.00
DARTS (1st) [29]11625.7739.77 ± 0.0054.30 ± 0.0038.57 ± 0.0038.97 ± 0.0018.87 ± 0.0018.41 ± 0.00
DARTS (2nd) [29]35781.8039.77 ± 0.0054.30 ± 0.0038.57 ± 0.0038.97 ± 0.0018.87 ± 0.0018.41 ± 0.00
GDAS [15]31609.8089.89 ± 0.0893.61 ± 0.0971.34 ± 0.0470.70 ± 0.3041.59 ± 1.3341.71 ± 0.98
SETN [14]34139.5384.04 ± 0.2887.64 ± 0.0058.86 ± 0.0659.05 ± 0.2433.06 ± 0.0232.52 ± 0.21
DARTS- [10]11625.7791.03 ± 0.4493.80 ± 0.4071.36 ± 1.5171.53 ± 1.5144.87 ± 1.4645.12 ± 0.82
TE-NAS [6]1558-93.90 ± 0.47-71.24 ± 0.56-42.38 ± 0.46
Ours232.5191.48 ± 0.0994.31 ± 0.1173.12 ± 0.5173.07 ± 0.5845.92 ± 0.5146.27 ± 0.17
Ours (best)232.5191.5594.3673.4973.5146.3746.34
OptimalN/A91.6194.3773.4973.5146.7747.31
+ +Table 3. Comparison with state-of-the-art NAS methods on NAS-Bench-201 [13]. Averaged on 4 runs of searching. + +
BenchmarkDARTS†R-DARTS†DARTS†DARTS-†Ours†PC-DARTS‡SDARTS‡DARTS-‡Ours‡
DPL2ESADARSADV
C10S13.843.112.783.013.102.682.613.112.782.732.682.61
S24.853.483.313.263.353.713.223.022.752.652.632.53
S33.342.932.512.742.592.422.422.512.532.492.422.42
S47.203.583.563.714.843.883.553.022.932.872.862.85
C100S129.4625.9324.2528.3724.0322.4122.0718.8717.0216.8816.9216.12
S226.0522.3022.2423.2523.5221.6120.9018.2317.5617.2416.1416.35
S328.9022.3623.9923.7323.3721.1321.1118.0517.7317.1215.8615.94
S422.8522.1821.9421.2623.2021.5521.0117.1617.1715.4617.4817.39
+ +Table 4. Comparison in various search spaces. We report the lowest error rate $(\%)$ of 4 found architectures. ‡: under [7, 10] evaluation settings where all models have 20 layers and 36 initial channels. †: under [48] settings where CIFAR-10 models in S2 and S4 have 20 layers and 16 initial channels, and CIFAR-100 models have 8 layers and 16 initial channels. + +sides, VIM-NAS achieves state-of-the-art performance in S2 with the top-1 test error of $2.53\%$ on CIFAR-10 and $20.90\%$ on CIFAR-100 under small evaluation settings. In S3, we obtain a well-performed architecture with state-ofthe-art top-1 test error of $2.42\%$ on CIFAR-10 and $21.11\%$ on CIFAR-100. Moreover, VIM-NAS achieves a top-1 error rate of $2.85\%$ on CIFAR-10 and $21.01\%$ on CIFAR-100 in S4. The architectures of all these models can be found in the supplementary material. + +# 4.6. Extensive Experiments + +Since the DARTS search space is the most popular search space, we conduct extensive experiments on it. + +Ablation Study on Architectural Network. To demonstrate the effectiveness of our proposed architectural neural network, we further evaluate DARTS† with the vanilla $14 \times 8$ architectural parameters, but with the same pretraining stage, posterior Gaussian distribution with covariance as 1 and the same learning rate (0.025) for the architectural neural network as VIM-NAS. For a better understanding of the convergence of search algorithms, we visualize the architectural weights for the first edge of normal cell and reduction cell. + +As seen in Figure 6, vanilla DARTS converges slowly + +and suffers from high uncertainty lying in the homogenization of architectural parameters. Though with the same large learning rate, $\mathrm{DARTS}^{\dagger}$ fails to converge quickly and turns to behave like noise. As seen in Figure 8, Our proposed VIM-NAS can achieve fast convergence to a well-performed local minimum after training one epoch. Consequently, it is our architectural neural network design that contributes to the fast and stable convergence. + +To verify the design of the architectural network, we further implement a small architectural neural network with a single ConvReLUBN module and a large architectural neural network with five modules, which are denoted as VIM-NAS-Small and VIM-NAS-Large, respectively. Please refer to the supplementary material for the detailed network structure. The architectural weights for the first edge of the normal cell are visualized in Figure 7, and the evaluation performance is listed in Table 5. VIM-NAS-Small exhibits slightly poor performance and unstable convergence with large fluctuation due to the limited capacity of a small network. VIM-NAS-Large turns to gradually converge after training several epochs, since the large architectural neural network needs a longer period of training. + +Extensive Experiments on Approximating Posterior Architectural Distribution. Instead of leveraging the proba + +![](images/9302ba5bee9d23bc0d3ec9068439135bd3cdf68bb71ae59f776b950b0720229d.jpg) +(a) DARTS-N + +![](images/d1d6f92ee31ef8688854a98c7307a7ecfb6388143b2f951aadccf921c8248a63.jpg) +(b) DARTS†-N + +![](images/6eb4409cf7c1408eaae4181b43175b8a3bc8161e7b9b872fc9041b800c78e18a.jpg) +Figure 6. Anytime architectural weights on DARTS search space. 'N' denotes the searched normal cell. DARTS†: DARTS is implemented with high learning rate (0.025) and added noise. +(a) VIM-NAS-S-N + +![](images/a4dc018625a39a4f92a4508037abf942d4e1bb6cdfa2ef788d4378272b97426f.jpg) +(b) VIM-NAS-L-N + +![](images/f5d826325e4b6e01940287754da753477740c6ade80e96004510da0ae6da4215.jpg) +Figure 7. Anytime architectural weights on DARTS search space. 'N' denotes the searched normal cell. VIM-NAS-S: VIM-NAS implemented with a small architectural network. VIM-NAS-L: VIM-NAS implemented with a large architectural network. +(a) VIM-NAS-N + +![](images/2cdc9efc6663833acfc93012e9952721dca44acd2a67831fb37ac4a8ccd315e3.jpg) +(b) VIM-NAS-R + +![](images/778bc452e52d76953c91670bca81af3b082ba984f995f826cbc87a9313333e2c.jpg) +(a) VIM-NAS-D-N +Figure 9. Anytime architectural weights on DARTS search space. 'N' denotes the searched normal cell. VIM-NAS-D: reformulation of variational dropout NAS with VIM. VIM-NAS-P-N: VIM-NAS implemented with point estimation. + +![](images/bf73809535f8fc6eee0d6aeabf2da7887d48030456ac5614785ed7910b1867d9.jpg) +Figure 8. Anytime architectural weights on DARTS search space. 'N' and 'R' denote normal cell and reduction cell, respectively. +(b) VIM-NAS-P-N + +bility estimation to model the architectural distribution in Section 3.2, we directly utilize the convolutional neural network as a point estimation to approximate the archi + +
MethodDARTSDARTS†VIM-NAS
Top-1 Error (%)3.002.652.45
Params (M)3.33.63.9
+ +
MethodVIM-NAS-SVIM-NAS-LVIM-NAS-D
Top-1 Error (%)2.512.582.58
Params (M)3.63.73.3
+ +Table 5. Extensive experiments on CIFAR10. DARTS†: DARTS implemented with high learning rate (0.025) and added noise. VIM-NAS-S: VIM-NAS implemented with a small architectural network. VIM-NAS-L: VIM-NAS implemented with a large architectural network. VIM-NAS-D: reformulation of variational dropout NAS with variational information maximization. + +tectoral distribution, namely VIM-NAS-P. Furthermore, we also leverage the convolutional neural network to parameterize the variance of the posterior architectural distribution, which is deemed as a reformulation of variational dropout NAS in Section 3.5, namely VIM-NAS-Dropout. + +The architectural weights for the first edge of searched normal cells are visualized in Figure 9. The point estimation is less effective, and VIM-NAS-P turns to converge slowly with large fluctuation. VIM-NAS-Dropout can also achieve fast and stable convergence as VIM-NAS. + +# 5. Conclusion + +In this paper, we provide new insights into NAS that the architectural distribution is the latent representation of a given dataset. Then, we leverage a simple yet effective convolutional neural network to model the dependencies among architectural distribution. Moreover, we propose a novel search strategy to maximize the variational lower bound to the mutual information between the data points and the latent architectural representations. Experimental results demonstrate VIM-NAS exhibits extremely fast convergence speed within one epoch, and achieves state-of-the-art performance on various search spaces, including DARTS search space, NAS-Bench-1shot1, NAS-Bench-201 and simplified search spaces S1-S4. Specifically, VIM-NAS achieves a top-1 error rate of $2.45\%$ and $15.80\%$ within 10 minutes on CIFAR-10 and CIFAR-100, respectively. When transferred to ImageNet, VIM-NAS reaches a $24.0\%$ top-1 error rate. Moreover, a direct search on ImageNet achieves even better performance with a top-1 error rate of $23.8\%$ and a top-5 error rate of $7.1\%$ . + +# Acknowledgement + +This work was supported in part by the National Natural Science Foundation of China under Grants 61932022, 61720106001, 61931023, 61831018, 61971285, 61871267, 61972256, 61838303, and in part by the Program of Shanghai Science and Technology Innovation Project under Grant 20511100100. + +# References + +[1] Youhei Akimoto, Shinichi Shirakawa, Nozomu Yoshinari, Kento Uchida, Shota Saito, and Kouhei Nishida. Adaptive stochastic natural gradient method for one-shot neural architecture search. In Proceedings of the 36th International Conference on Machine Learning, pages 171-180, 2019. +[2] Qian Bao, Wu Liu, Jun Hong, Lingyu Duan, and Tao Mei. Pose-native network architecture search for multi-person human pose estimation. In Proceedings of the 28th ACM International Conference on Multimedia, pages 592-600, 2020. +[3] Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In Proceedings of the 35th International Conference on Machine Learning, pages 549-558, 2018. +[4] Andrew Brock, Theo Lim, J.M. Ritchie, and Nick Weston. SMASH: One-shot model architecture search through hypernetworks. In 6th International Conference on Learning Representations, 2018. +[5] Francesco Paolo Casale, Jonathan Gordon, and Nicolo Fusi. Probabilistic neural architecture search. arXiv preprint arXiv:1902.05116, 2019. +[6] Wuyang Chen, Xinyu Gong, and Zhangyang Wang. Neural architecture search on ImageNet in four GPU hours: A theoretically inspired perspective. In 9th International Conference on Learning Representations, 2021. +[7] Xiangning Chen and Cho-Jui Hsieh. Stabilizing differentiable architecture search via perturbation-based regularization. In Proceedings of the 37th International Conference on Machine Learning, pages 1554-1565, 2020. +[8] Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 1294-1303, 2019. +[9] Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of ImageNet as an alternative to the CIFAR datasets. arXiv preprint arXiv:1707.08819, 2017. +[10] Xiangxiang Chu, Xiaoxing Wang, Bo Zhang, Shun Lu, Xiaolin Wei, and Junchi Yan. DARTS-: Robustly stepping out of performance collapse without indicators. In 9th International Conference on Learning Representations, 2021. +[11] Xiangxiang Chu, Tianbao Zhou, Bo Zhang, and Jixiang Li. Fair DARTS: Eliminating unfair advantages in differentiable architecture search. In 16th European Conference on Computer Vision, pages 465-480, 2020. +[12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009. +[13] Xuanyi Dong and Yi Yang. NAS-Bench-201: Extending the scope of reproducible neural architecture search. In 7th International Conference on Learning Representations, 2019. +[14] Xuanyi Dong and Yi Yang. One-shot neural architecture search via self-evaluated template network. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 3681-3690, 2019. + +[15] Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in four GPU hours. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1761-1770, 2019. +[16] Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Efficient multi-objective neural architecture search via Lamarckian evolution. In 7th International Conference on Learning Representations, 2019. +[17] Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. Journal of Machine Learning Research, 20:1-21, 2019. +[18] Jiemin Fang, Yuzhu Sun, Qian Zhang, Kangjian Peng, Yuan Li, Wenyu Liu, and Xinggang Wang. FNA++: Fast network adaptation via parameter remapping and architecture search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(9):2990-3004, 2020. +[19] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V. Le. NAS-FPN: Learning scalable feature pyramid architecture for object detection. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7036-7045, 2019. +[20] Jianyuan Guo, Kai Han, Yunhe Wang, Chao Zhang, Zhaohui Yang, Han Wu, Xinghao Chen, and Chang Xu. Hit-Detector: Hierarchical trinity architecture search for object detection. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 11405-11414, 2020. +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. +[22] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-Softmax. In Workshop on Bayesian Deep Learning, NIPS 2016, 2016. +[23] Durk P. Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. In Advances in Neural Information Processing Systems 28, pages 2575-2583, 2015. +[24] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. +[25] Guohao Li, Guocheng Qian, Itzel C. Delgadillo, Matthias Muller, Ali Thabet, and Bernard Ghanem. SGAS: Sequential greedy architecture search. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1620-1630, 2020. +[26] Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In Uncertainty in Artificial Intelligence, pages 367-377, 2020. +[27] Hanwen Liang, Shifeng Zhang, Jiacheng Sun, Xingqiu He, Weiran Huang, Kechen Zhuang, and Zhenguo Li. DARTS+: Improved differentiable architecture search with early stopping. arXiv preprint arXiv:1909.06035, 2019. +[28] Chenxi Liu, Liang-Chieh Chen, Florian Schroff, Hartwig Adam, Wei Hua, Alan L. Yuille, and Li Fei-Fei. AutoDeepLab: Hierarchical neural architecture search for semantic image segmentation. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 82–92, 2019. + +[29] Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In 7th International Conference on Learning Representations, 2019. +[30] Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In Workshop on Bayesian Deep Learning, NIPS 2016, 2016. +[31] Risto Miikkulainen, Jason Liang, Elliot Meyerson, Aditya Rawal, Daniel Fink, Olivier Francon, Bala Raju, Hormoz Shahrzad, Arshak Navruzyan, Nigel Duffy, and Babak Hodjat. Evolving deep neural networks. In Artificial Intelligence in the Age of Neural Networks and Brain Computing, pages 293-312. Elsevier, 2019. +[32] Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In Proceedings of the 34th International Conference on Machine Learning, pages 2498-2507, 2017. +[33] Dmitry Molchanov, Valery Kharitonov, Artem Sobolev, and Dmitry Vetrov. Doubly semi-implicit variational inference. In Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics, pages 2593–2602, 2019. +[34] Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In Proceedings of the 35th International Conference on Machine Learning, pages 4095-4104, 2018. +[35] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, pages 4780-4789, 2019. +[36] Dilin Wang, Meng Li, Chengyue Gong, and Vikas Chandra. AttentiveNAS: Improving neural architecture search via attentive sampling. In 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6418-6427, 2021. +[37] Yaoming Wang, Wenrui Dai, Chenglin Li, Junni Zou, and Hongkai Xiong. SI-VDNAS: Semi-implicit variational dropout for hierarchical one-shot neural architecture search. In Proceedings of the 29th International Joint Conference on Artificial Intelligence, pages 2088–2095, 2020. +[38] Martin Wistuba, Ambrish Rawat, and Tejaswini Pedapati. A survey on neural architecture search. CoRR, abs/1905.01392, 2019. +[39] Bichen Wu, Xiaoliang Dai, Peizhao Zhang, Yanghan Wang, Fei Sun, Yiming Wu, Yuandong Tian, Peter Vajda, Yangqing Jia, and Kurt Keutzer. FBNet: Hardware-aware efficient convnet design via differentiable neural architecture search. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10734-10742, 2019. +[40] Yan Wu, Aoming Liu, Zhiwu Huang, Siwei Zhang, and Luc Van Gool. Neural architecture search as sparse supernet. In Proceedings of the 35th AAAI Conference on Artificial Intelligence, pages 10379-10387, 2021. +[41] Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In 6th International Conference on Learning Representations, 2018. +[42] Yuhui Xu, Lingxi Xie, Xiaopeng Zhang, Xin Chen, Guo-Jun Qi, Qi Tian, and Hongkai Xiong. PC-DARTS: Partial channel connections for memory-efficient architecture search. In + +8th International Conference on Learning Representations, 2020. +[43] Shen Yan, Yu Zheng, Wei Ao, Xiao Zeng, and Mi Zhang. Does unsupervised architecture representation learning help neural architecture search? In Advances in Neural Information Processing Systems 32, pages 12486-12498, 2020. +[44] Zhaohui Yang, Yunhe Wang, Xinghao Chen, Boxin Shi, Chao Xu, Chunjing Xu, Qi Tian, and Chang Xu. CARS: Continuous evolution for efficient neural architecture search. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1829-1838, 2020. +[45] Lewei Yao, Hang Xu, Wei Zhang, Xiaodan Liang, and Zhenguo Li. SM-NAS: Structural-to-modular neural architecture search for object detection. In Proceedings of the 34th AAAI Conference on Artificial Intelligence, pages 12661-12668, 2020. +[46] Mingzhang Yin and Mingyuan Zhou. Semi-implicit variational inference. In Proceedings of the 35th International Conference on Machine Learning, pages 5660–5669, 2018. +[47] Jiahui Yu, Pengchong Jin, Hanxiao Liu, Gabriel Bender, Pieter-Jan Kindermans, Mingxing Tan, Thomas Huang, Xiaodan Song, Ruoming Pang, and Quoc Le. BigNAS: Scaling up neural architecture search with big single-stage models. In 16th European Conference on Computer Vision, pages 702-717, 2020. +[48] Arber Zela, Thomas Elsken, Tonmoy Saikia, Yassine Marrakchi, Thomas Brox, and Frank Hutter. Understanding and robustifying differentiable architecture search. In 7th International Conference on Learning Representations, 2019. +[49] Arber Zela, Julien Siems, and Frank Hutter. NAS-Bench1Shot1: Benchmarking and dissecting one-shot neural architecture search. In 7th International Conference on Learning Representations, 2019. +[50] Wenqiang Zhang, Jiemin Fang, Xinggang Wang, and Wenyu Liu. EfficientPose: Efficient human pose estimation with neural architecture search. Computational Visual Media, 7:335-347, 2021. +[51] Xinbang Zhang, Jianlong Chang, Yiwen Guo, Meng Gaofeng, Shiming Xiang, Zhouchen Lin, and Chunhong Pan. DATA: Differentiable ArchiTecture Approximation with distribution guided sampling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(9):2905-2920, 2020. +[52] Xinbang Zhang, Zehao Huang, Naiyan Wang, Shiming Xiang, and Chunhong Pan. You only search once: Single shot neural architecture search via direct sparse optimization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(9):2891-2904, 2020. +[53] Hongpeng Zhou, Minghao Yang, Jun Wang, and Wei Pan. BayesNAS: A Bayesian approach for neural architecture search. In Proceedings of the 36th International Conference on Machine Learning, pages 7603-7613, 2019. +[54] Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8697-8710, 2018. \ No newline at end of file diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/images.zip b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c195e55608a72439dda7fe42acac10a7af496750 --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a79324103fcc7d5da8ba7a84e28c9a3e2190fb4fe388dc01675a28fe0eff55a5 +size 659683 diff --git a/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/layout.json b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..32a3f4a79ca6bbb6c1225b68ef417a3ebc9f7ca0 --- /dev/null +++ b/learninglatentarchitecturaldistributionindifferentiableneuralarchitecturesearchviavariationalinformationmaximization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9847d0c17300e4c988402aeb3f8a264f46948e7655ddd5ede12377918224d721 +size 449599 diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_content_list.json b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e7c1f688b3def9a21d1c83b6edef29e8984e8fbf --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c89bfac4f4f00ed64da23e685d0bc7d3ba0b2137469af0e0a85de99f02e5eff +size 82218 diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_model.json b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..97ecea7a5d62ec4f872e81d34176721fd0edaed9 --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90b399e880c23772a069c968e5e57af3ae02a4633937ba20f63efb5c676d1693 +size 97160 diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_origin.pdf b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9e67ae49b234a28b12ef56ca70716df78f0aaed0 --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/0e12d834-4ccf-4808-b81c-afd4b1432e9e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a5933bbfa8e6b15fb9197e5a2efee1bbcb38b36b1ef8379a9d769d81dd0a9d9 +size 969060 diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/full.md b/learningmetaclassmemoryforfewshotsemanticsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..22e44ad70cff8505612da7dcafb8f7e595ee62c9 --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/full.md @@ -0,0 +1,376 @@ +# Learning Meta-class Memory for Few-Shot Semantic Segmentation + +Zhonghua $\mathbf{W}\mathbf{u}^{1,2}$ Xiangxi Shi Guosheng Lin\*1,2 Jianfei Cai4 + +$^{1}$ S-lab, Nanyang Technological University + +$^{2}$ School of Computer Science and Engineering, Nanyang Technological University + +3Electrical Engineering and Computer Science, Oregon State University + +$^{4}$ Dept of Data Science and AI, Monash University + +zhonghua001@e.ntu.edu.sg shixia@oregonstate.edu gslin@ntu.edu.sg jianfei.cai@monash.edu + +# Abstract + +Currently, the state-of-the-art methods treat few-shot semantic segmentation task as a conditional foreground-background segmentation problem, assuming each class is independent. In this paper, we introduce the concept of meta-class, which is the meta information (e.g. certain middle-level features) shareable among all classes. To explicitly learn meta-class representations in few-shot segmentation task, we propose a novel Meta-class Memory based few-shot segmentation method (MM-Net), where we introduce a set of learnable memory embeddings to memorize the meta-class information during the base class training and transfer to novel classes during the inference stage. Moreover, for the $k$ -shot scenario, we propose a novel image quality measurement module to select images from the set of support images. A high-quality class prototype could be obtained with the weighted sum of support image features based on the quality measure. Experiments on both PASCAL-5 and COCO datasets show that our proposed method is able to achieve state-of-the-art results in both 1-shot and 5-shot settings. Particularly, our proposed MM-Net achieves $37.5\%$ mIoU on the COCO dataset in 1-shot setting, which is $5.1\%$ higher than the previous state-of-the-art. + +# 1. Introduction + +With the development of convolution neural networks (CNNs), fully supervised image semantic segmentation [12, 3] has achieved great success in both speed and accuracy. However, the state-of-the-art image segmentation methods usually require abundant pixel-level annotations which requires huge human labeling efforts. If we want to segment a new class that has not been seen in the training set, we usually need to label thousands of images for + +![](images/1e3cb678263b8245577462fef1b61b1c8c5ff5836672ae8f1c09a1a51e8e787e.jpg) + +![](images/53b43e003052dac60cd14a34e27162475f72c687750faa02d83116a7b4c642e2.jpg) +Figure 1. Comparison between the typical pipeline of state-of-the-art (SOTA) methods (top part) and that of our proposed meta-class memory based network (MM-Net) (bottom part) for few-shot segmentation. The main difference is that SOTA treats the task as a class-agnostic conditional foreground-background segmentation problem, while we propose to learn a set of meta-class middle-level representations shareable between base and novel classes. + +the new class. In order to reduce human labeling efforts on novel classes, the few-shot image segmentation task [35, 17] has been introduced, which aims to predict the segmentation mask of a query image of a novel class with only one or a few labelled support images in testing, while with abundant images of base classes with full annotations in training. + +The top part of Fig. 1 shows the typical pipeline of the state-of-the-art (SOTA) few-shot image segmentation methods [35, 34]. Firstly, a pre-trained CNN network is used to extract the features of both support and query images. Then, the two features are typically processed by convolutional layers and compared for similarity so as to gener + +ate the segmentation map for the query image. Essentially, these methods treat the few-shot segmentation task as a conditional binary foreground-background segmentation problem, i.e. to find and segment the most relevant regions in the query image based on the given support images and their masks, regardless of the class information. + +The class-agnostic design in SOTA is understandable. This is because by class-agnostic design the interaction / comparison between query and support features in base classes can be transferred to novel classes. However, we argue that although different classes of objects are quite different, there are still some common attributes or middle-level knowledge shareable among them, which we call meta-class information. Similar observations have been made in [38, 10, 32] for classification and detection tasks, where some low-level information (e.g. circle, dot) and middle-level information (e.g. wings, limbs) are shared among different classes. + +Motivated by this, in this paper, we propose a novel Meta-class Memory Module (MMM) to learn middle-level meta-class embeddings shareable between base and novel classes for few-shot segmentation. As shown in the lower part of Fig. 1, a set of meta-class memory embeddings is introduced into the SOTA pipeline, which can be learned through the back-propagation during the base class training. The meta-class memory embeddings are then used to attend the middle-level features of query and support images to obtain meta-class activation maps. This can be considered as aligning both query and support middle-level features to the meta-class embeddings. Based on the obtained meta-class activation maps of query and support images, we then perform interaction / comparison between them to propagate the support mask information from support activation maps to query activation maps, and the fused query activation maps are finally used for the query mask prediction. + +In addition, when it comes to the $k$ -shot scenarios, which means more than one support images are given, previous methods usually apply an average operation [34] on the few support image features to obtain the class prototype feature. However, we observe that some support images are in low quality which is hard to represent the support class. Thus, we further propose a Quality Measurement Module (QMM) to obtain the quality measure for each support image. Based on the quality measure, the features from all support images are fused via weighted sum to get a better class prototype feature. + +In our experiments, we follow the design of [26] to perform training and testing for a fair comparison. We evaluate our proposed method on four different splits with 1-shot and 5-shot settings on PASCAL- $5^{i}$ [24] and COCO [13] datasets. Our method is able to achieve state-of-the-art results on both datasets under both 1-shot and 5-shot settings. + +Our main contributions can be summarized as follows: + +- For few-shot semantic image segmentation, to our knowledge, we are the first one to introduce a set of learnable embeddings to memorize the meta-class information during base class training that can be transferred to novel classes during testing. Specifically, a Meta-class Memory Module (MMM) is proposed to generate the meta-class activation maps for both support and query images, which is helpful for the final query mask prediction. + +- For $k$ -shot scenarios, a Quality Measurement Module (QMM) is proposed to measure the quality of all the support images so as to effectively fuse all the support features. With QMM, our model is able to pay more attention to the high quality support samples for better query image segmentation. + +- Extensive experiments on PASCAL- $5^{i}$ and COCO datasets show that our proposed method performs the best in all settings. Specifically, our method significantly outperforms SOTA on the large scale dataset COCO, with $5.1\%$ mean mIoU gain, as our memory embeddings are able to learn a universal meta-class representation. + +# 2. Related Works + +# 2.1. Semantic Segmentation + +Semantic segmentation [30, 36, 16, 14, 15] is a task of classifying each pixel in an image into a specified category and has been applied in various fields [31, 25, 37]. State-of-the-art segmentation methods are usually based on the Fully Convolutional Network (FCN) [19], which uses a classification network as the backbone and replaces fully connected layers with convolutional layers to predict the dense segmentation map. Later, to obtain a higher resolution prediction and have a larger receptive field of the network, DeepLab [1, 2] proposed to use dilated convolutions which insert holes to the convolutional filters instead of using the conventional convolution with downsampling. Recently, Chen et al. further explored the effect of atrous convolutions, multi-grid, atrous spatial pyramid pooling, difference backbones, and different training sizes in DeepLab V3 [3] and DeepLab V3+ [4]. These methods usually require abundant pixel-level annotations for all the classes during training and cannot generalize to novel classes with only a few labelled images. + +# 2.2. Few-Shot Semantic Segmentation + +Few-shot semantic segmentation [6, 8, 28, 22, 24, 5] aims to give a dense segmentation prediction for new class query images with only a few labeled support images. CANet [35] proposed Dense Comparison Module + +![](images/0dcae48cc2881ba017fdba9c1152e300b05c08c7aead903623a7c67b80fccbfb.jpg) +Figure 2. Overview of our proposed meta-class memory based network (MM-Net) for few-shot semantic segmentation. Different from previous few-shot segmentation methods, Meta-class Memory Module (MMM) (orange) is introduced to learn the meta-class features that can be shared among all base and novel classes and generate meta-class activation maps for support and query images, respectively. Then, Activation Propagation Module (APM) (purple) is used to propagate support mask information to the query activation maps for the query mask generation. Meanwhile, foreground confidence module (FCM) (yellow) is used to obtain a confidence map from the high-level image features. Finally, the fused query activation maps are concatenated with the foreground confidence map and fed into FEM [26] for the final query segmentation mask prediction (green). + +(DCM) and Iterative Optimization Module (IOM) to give a dense prediction and iteratively refine the prediction. Similarly, the prototype alignment regularization was used in PANet [29] which encourages the model to learn more consistent embedding prototypes. Later, PGNet [34] used a Graph Attention Unit (GAU) to build the local similarity between support and query images. Liu et al. [17] proposed to use a Siamese Network on query and support images to get the co-occurred features between the two images. More recently, following the practice in PGNet [34] which uses the pyramid structure to refine results, PFENet [26] used a multi-scale decoder Feature Enrichment Module (FEM) to incorporate the prior masks and query features to give a better segmentation map prediction. + +Unlike all the existing few-shot semantic segmentation methods, we introduce a concept of meta-class memory that could learn a set of shareable meta-class representations among base and novel classes. + +# 2.3. Meta Learning + +Most state-of-the-art recognition methods require a large number of training images with abundant annotations which often need tremendous human labeling efforts. Meta-learning methods [7], also known as learning to learn, have been introduced to better transfer existing knowledge to novel classes or get faster training on new given data. One popular set of approaches [11, 23] are to learn a meta-learner which could help deep neural networks optimize faster when given new data on unseen classes. Another set of meta-learning approaches [7] are introduced to learn a better parameter initialization which could be fast to optimize with fewer training data. Metric learning methods [27] + +are belonging to another type that use a certain similarity measurement to obtain the classification results over different classes. On the other hand, Munkhdalai et al. [20] proposed an external memory model across different tasks and can shift its inductive biases via fast parameterization for rapid generalization on new tasks. + +Different from these meta-learning approaches, we do not have a meta-learner. Instead, we construct a meta-class memory to capture representative middle-level features for better transfer between base and novel classes for few-shot semantic segmentation. + +# 3. Method + +Fig. 2 gives an overview of our proposed meta-class memory based network (MM-Net) for few shot semantic segmentation. It consists of three major modules, meta-class memory module (MMM), activation propagation module (APM) and foreground confidence module (FCM), as well as two off-the-shelf modules, feature extraction backbone and feature enrichment module (FEM) [26]. MMM is particularly novel, which learns the meta-class features that can be shared among all base and novel classes and generate meta-class activation maps for support and query images, respectively. APM is used to propagate support mask information to the query activation maps for the query mask generation. FCM is to retain the conventional interactions of the high-level features of the query and support images. Moreover, we also propose an additional Quality Measurement Module (QMM) to measure the quality of different support images in $k$ -shot settings so as to fuse the information from different support images in a better way. In the following, we describe the major modules + +![](images/e903b55fecd5527d112695a8972ce99c623bf01836061ff16739285b6d12c174.jpg) +Figure 3. Illustration of Activation Propagation Module (APM). + +of our MM-Net in detail. + +# 3.1. Meta-class Memory Module + +Meta-class Memory module (MMM) aims to learn the meta-class information that can be shared among all classes and use them to encode / classify the middle-level features of the query or support image. As shown in Fig. 2, the input to MMM includes the features of either query image $I_{Q}$ or support image $I_{S}$ , and a set of meta-class embeddings $M^{1}\ldots M^{N}$ , each with a dimension of $D$ , where we set $N$ as 50 and $D$ as 256. These meta-class embeddings can be learned during the network training through the back propagation. The outputs of MMM are the meta-class activation maps corresponding to the given image. In particular, we firstly use the ResNet50 as a feature extractor to extract the features for both support and query images. Similar to the previous few-shot segmentation works [35, 34], the feature extractor is pre-trained on the image classification task. We choose the features from the 2nd and 3rd levels, since the middle-level features are better for transfer, same as the observation in [35]. Then, we apply a channel-wise concatenation of the 2nd and 3rd level features, followed by a $3\times 3$ convolution layer to get the feature maps $F_{Q}$ and $F_{S}$ for the query and support images, respectively. Then, we compute the similarity between the meta-class memory $M$ and image feature maps $F$ to get the meta-class activation maps $Act_{Q}$ and $Act_{S}$ for query and support images, respectively: + +$$ +A c t ^ {n} (x, y) = \sigma (F (x, y) ^ {T} M ^ {n}), \tag {1} +$$ + +where $Act^{n}(x,y)$ indicates the $n$ th meta-class activation map at the spatial location (x, y) obtained by the $n$ th embedding, and $\sigma(\cdot)$ is the Sigmoid function to normalize the value between 0 to 1. + +# 3.2. Activation Propagation Module + +With the two memory activation maps $Act_{S}$ and $Act_{Q}$ encoded by the $N$ meta-class embeddings, which are of the dimensions of $H \times W \times N$ and $H \times W$ is the spatial dimensions, the purpose of this activation propagation module + +(APM) is to propagate the label information (support mask) from the support image to the unlabeled query image for the mask generation. + +For APM, we adopt an approach similar to [34] but using our unique memory activation maps, where we treat the vector at each spatial location of the activation maps as a node. Fig. 3 illustrates the process of APM. In particular, we denote $h_q \in Act_Q$ as a query node and $h_s \in Act_S$ as a support node, where $h \in R^N$ , and $q, s \in \{1,2,\dots,HW\}$ . Then, we calculate the cosine similarity $e_{q,s} = \cos(h_q, h_s)$ between all node pairs, with one from $Act_Q$ and the other from $Act_S$ : + +$$ +e _ {q, s} = \frac {h _ {q} ^ {T} h _ {s}}{\| h _ {q} \| \| h _ {s} \|} \quad q, s \in \{1, 2, \dots , H W \}. \tag {2} +$$ + +For each query node $h_q$ , we obtain an $H \times W$ similarity map $e_q$ , which is then element-wise multiplied with the support mask to keep the similarity of the foreground support nodes while setting the similarity of the background support nodes to $-\infty$ , followed by Softmax to generate the weights: + +$$ +w _ {q, s} = \frac {\exp \left(e _ {q , s}\right)}{\sum_ {k = 1} ^ {H W} \exp \left(e _ {q , k}\right)}. \tag {3} +$$ + +We then do a weighted sum over all support node features and multiply it with the original query node feature: + +$$ +v _ {q} = \sum_ {s = 1} ^ {H W} w _ {q, s} h _ {s}, \tag {4} +$$ + +$$ +h _ {q} ^ {\prime} = h _ {q} \odot v _ {q} \tag {5} +$$ + +where $\odot$ denotes element-wise product. Combining all the fused query features $h_q'$ , we obtain the fused activation map $Act_Q' \in \mathbb{R}^{H \times W \times N}$ . Here, (4) essentially selects the most similar foreground support nodes and (5) highlights the query nodes matched with foreground support nodes while suppressing the query nodes matched with background support nodes, all in the context of the metaclass representation. + +# 3.3. Foreground Confidence Module + +Inspired by PFENet [26], which concludes that the high level features can give a guidance mask telling the probability of pixels belonging to the target class. Thus, we further introduce a foreground confidence module (FCM) to produce a high-level foregound confidence map. Compared with the previous process based on MMM and APM, which facilitates the interactions of the query and support images via middle-level meta-class features, FCM facilitates their interactions via high-level within-class features, i.e. the 4th level features of the pre-trained ResNet50. + +For simplicity, we reuse $F_{Q}$ and $F_{S}$ for the high level backbone feature maps for the query and support images, + +![](images/48b5e4e15bfc7f762741e7e58f582d13a1f9ea82727caaabeb54e94ef9e093b2.jpg) +Figure 4. Visual results of our proposed MM-Net on fold-0 of PASCAL-5 $^i$ dataset. + +respectively. To generate the foreground confidence map $C_{Q}$ , we first update $F_{S}$ by element-wise multiplying it with the support mask. Then, similar to that in APM, we compute cosine similarity $\cos(f_{q}, f_{s})$ between all pairs of feature nodes of $f_{q} \in F_{Q}$ and $f_{s} \in F_{S}$ as + +$$ +\cos \left(f _ {q}, f _ {s}\right) = \frac {f _ {q} ^ {T} f _ {s}}{\| f _ {q} \| \| f _ {s} \|} \quad q, s \in \{1, 2, \dots , H W \}. \tag {6} +$$ + +For each $f_{q}$ , we take the maximum similarity among all support nodes as the foreground probability value $c_{q} \in \mathbb{R}$ as + +$$ +c _ {q} = \max _ {s \in \{1, 2, \dots , H W \}} \left(\cos \left(f _ {q}, f _ {s}\right)\right). \tag {7} +$$ + +We then reshape all the probability values $c_{q}$ into the foreground confidence map $C_{Q} \in \mathbb{R}^{H \times W}$ . Finally, we normalize all the values in $C_{Q}$ by a min-max normalization: + +$$ +C _ {Q} = \frac {C _ {Q} - \operatorname* {m i n} \left(C _ {Q}\right)}{\operatorname* {m a x} \left(C _ {Q}\right) - \operatorname* {m i n} \left(C _ {Q}\right) + \epsilon}, \tag {8} +$$ + +where $\epsilon$ is set to $10^{-7}$ + +With the fused query attention map $Act_{Q}^{\prime}$ from APM and the foreground confidence map $C_{Q}$ from FCM, we apply a channel-wise concatenation of the two maps, and then pass it to the feature enrichment module (FEM) [26] to generate the final segmentation mask. + +# 3.4. Quality Measurement Module + +The diagram in Fig. 2 is only for one-shot setting. When it comes to $K$ -shot ( $K > 1$ ) settings, more than one support images are given. A common way is to average the features [34] extracted from the support images and then pass the averaged feature for further processing. Such a simple average feature fusion might not be good, since some support images could be of poor quality for generating the class prototype features. Thus, we further propose a Quality Measurement Module (QMM) to select high quality support features. + +Specifically, we make use of the cosine similarity $e_{q,s}$ in (2) with $-\infty$ on the background regions, same as in Section 3.2. For the $k$ th support image, we have $e_{q,s}^k$ . Then, we compute the quality measure for the $k$ th support image and the $q$ th query node: + +$$ +p _ {q} ^ {k} = \sum_ {s = 1} ^ {H W} \left(\sigma \left(e _ {q, s} ^ {k}\right)\right), k \in \{1, 2, \dots , K \}, q \in \{1, 2, \dots , H W \} \tag {9} +$$ + +where $\sigma(\cdot)$ is a Sigmoid function. Essentially, (9) suggests that for the $q$ th query node, the larger similarity sum from the $k$ th support image, the higher quality / weight we rank the support image. After that, we reshape $p_q^k$ , $q \in \{1, 2, \dots, HW\}$ into a map $P_Q^k \in \mathbb{R}^{H \times W}$ aligning with the fused activation map $Act_Q'$ . With the obtained $K$ maps $P_Q^k$ , $k \in \{1, 2, \dots, K\}$ , we further apply softmax over the $k$ dimension to normalize the quality maps across different support images. Finally, we treat each quality map $P_Q^k$ as a weight map, multiply with the corresponding fused activation map $Act_Q'$ , and sum them together. In this way, we obtain the final weighted average map $Act_Q'$ , which is then passed to FEM for segmentation prediction. + +# 3.5. Training Loss + +Image Segmentation loss is used to supervised the segmentation mask generation. Specifically, following PFENet [26], we apply multiple cross entropy losses, with $\mathcal{L}_{seg_2}$ on the final segmentation prediction $\hat{Y}_Q$ and $\mathcal{L}_{seg_1}^i$ $(i\in \{1,2,\dots,L\})$ on the intermediate masks $\hat{Y}_Q^i$ . + +Memory Reconstruction Loss. To avoid the meta-class memory from learning similar embeddings, we propose a memory reconstruction loss function to encourage learning meaningful and diverse meta-class embeddings. Specifically, we firstly apply a channel-wise Softmax function over all the activation maps $Act^{n}(x,y)$ obtained in (1) as + +$$ +\hat {A c t} ^ {n} (x, y) = \frac {\exp (A c t ^ {n} (x , y))}{\sum_ {k = 1} ^ {N} \exp (A c t ^ {k} (x , y))}. \tag {10} +$$ + +Table 1. 1-shot and 5-shot mIoU results on PASCAL ${5}^{i}$ dataset. We list the backbone and training size used by each method. Our MM-Net outperforms the state-of-the-art under all the experiment settings. + +
MethodsTraining SizeBackbone1-shot5 shot
Fold-0Fold-1Fold-2Fold-3MeanFold-0Fold-1Fold-2Fold-3Mean
PANet [29]417 × 417VGG 1642.358.051.141.248.151.864.659.846.555.7
FWBF [21]512 × 512VGG 1647.059.652.648.351.950.962.956.550.155.1
CANet [35]321 × 321ResNet 5052.565.951.351.955.455.567.851.953.257.1
PGNet[34]321 × 321ResNet 5056.066.950.650.456.054.967.451.853.056.8
CRNet [17]321 × 321ResNet 50----55.7----58.8
PMMs [33]321 × 321ResNet 5055.266.952.650.756.356.367.354.551.057.3
PPNet [18]417 × 417ResNet 5047.858.853.845.651.558.467.864.956.762.0
PFENet [26]473 X 473ResNet 50 v261.769.555.456.360.863.170.755.857.961.9
Ours321 X 321VGG57.167.256.652.358.356.666.753.656.558.3
Ours321 X 321ResNet 5058.070.058.055.060.260.070.656.360.361.8
Ours473 X 473ResNet 50 v262.770.257.357.061.862.271.557.562.463.4
+ +Then, we use $\hat{A c t}^n (x,y)$ and the meta-class embeddings $M$ to reconstruct the original image features $F(x,y)$ as + +$$ +\hat {F} (x, y) = \sum_ {n = 1} ^ {N} \hat {A c t} ^ {n} (x, y) M ^ {n}. \tag {11} +$$ + +Essentially, (10) and (11) are to select the most similar meta-class embeddings to obtain the reconstructed feature $\hat{F}$ . Reshaping $\hat{F}$ into $D\times HW$ , we then compute the correlation matrix $C_f\in R^{HW\times HW}$ : + +$$ +C _ {f} = \hat {F} ^ {T} F. \tag {12} +$$ + +Finally, we define the reconstruction loss $\mathcal{L}_{\text{Recon}}$ as a cross-entropy loss to maximize the log-likelihood of the diagonal elements in $C_f$ . This reconstruction loss encourages different meta-class embeddings to be different. This is because, if all $M^n$ are similar, it will not be able to well reconstruct the diverse original feature $F$ . + +The overall loss function can be summarized as + +$$ +\mathcal {L} = \frac {\alpha}{L} \sum_ {i = 1} ^ {L} \mathcal {L} _ {S e g _ {1}} + \beta \mathcal {L} _ {S e g _ {2}} ^ {i} + \gamma \mathcal {L} _ {R e c o n}, \tag {13} +$$ + +where $\alpha, \beta$ and $\gamma$ are the trade-off parameters, being set as 1, 1 and 0.1, respectively. + +# 4. Experiments + +# 4.1. Implementation details + +Datasets. We follow PFENet [26] to conduct experiments on PASCAL- $5^{i}$ [24] and COCO [13] datasets. PASCAL $5^{i}$ combines PASCAL VOC 2012 with external annotations from SDS dataset [9]. It contains 20 classes, divided into 4 folds with 5 classes per fold. We randomly sample 5000 support-query pairs for testing. For COCO, following [26], we split its 80 classes into 4 folds with 20 classes per fold. The class indexes in fold $i$ are selected according + +to $4x - 3 + i$ , where $x \in [1,20]$ and $i \in [1,4]$ . We random select 20,000 support and query pairs for testing. + +Experiment setting. For fair comparisons with previous methods, we consider multiple backbones including VGG-16, ResNet-50 and ResNet-50-v2. Here, VGG-16 and ResNet-50 are the commonly used backbone networks and ResNet-50-v2 is a modified version by PFENet [26], where the standard $7 \times 7$ convolution layers are replaced with a few $3 \times 3$ convolutional layers. All the backbone networks are pre-trained on the ImageNet classification task and fixed during our model training. We use SGD for training the rest of the network layers with momentum and weight decay being 0.9 and $10^{-4}$ , respectively. In addition, we use a learning rate of 0.0025 and a batch size of 4 to train our model for both 1-shot and 5-shot settings. All of our experiments are conducted on one NVIDIA RTX 2080Ti GPU. + +Evaluation metrics. Following the previous works [35, 17], we adopt the class mean intersection over union (mIoU) as our evaluation metric for ablation studies and final comparisons. + +# 4.2. Comparisons with state-of-the-art + +Tables 1 and 2 show the 1-shot and 5-shot mIoU results of different methods on PASCAL- $5^{i}$ and COCO datasets, respectively. We list the training size and the backbone used in the previous methods. For CANet, PGNet, CRNet and PMM methods, they all use the image size of $321 \times 321$ with the standard ResNet-50 backbone to extract the features. However, PPNet and PFENet use larger image sizes. As observed in [3], a larger image size usually gives a better segmentation performance. Moreover, PFENet also uses a more powerful ResNet-50-v2 backbone. For a fair comparison, we report the performance of our method under different image sizes and backbones. We can see that our MMNet achieves the best results under all training conditions. + +For the experiments on COCO dataset, PFENet uses the image size of $641 \times 641$ (as specified in their released code) with ResNet-101-v2 as backbone. Due to our GPU memory + +Table 2. 1-shot and 5-shot mIoU results on COCO dataset. The results of CANet* is obtained from [33]. + +
MethodsTraining SizeBackbone1-shot5 shot
Fold-0Fold-1Fold-2Fold-3MeanFold-0Fold-1Fold-2Fold-3Mean
PANet [29]417 × 417VGG 16----20.9----29.7
FWBF [21]512 × 512ResNet 10119.918.021.028.921.219.121.523.930.123.7
CANet* [35]321 × 321ResNet 5025.130.324.524.726.126.032.426.127.027.9
PMMs [33]321 × 321ResNet 5029.536.829.027.030.633.842.033.033.335.5
PFENet [26]641 × 641ResNet 101 v234.333.032.330.132.438.538.638.234.337.4
Ours321 × 321ResNet 5034.941.037.835.237.238.539.638.435.538.0
Ours473 × 473ResNet 50 v234.941.037.237.037.537.040.339.336.038.2
+ +Table 3. Ablation studies on PASCAL-5 $^i$ dataset about how many meta-class embeddings are better. + +
Numbers of Meta-class Embeddings1 shot
fold 0fold 1fold 2fold 3Mean
2061.470.057.558.061.7
5062.770.257.357.061.8
10062.270.455.955.661.0
+ +Table 4. Ablation studies of our proposed Meta-class Memory Module (MMM) on PASCAL $5^{i}$ dataset. + +
Methods1 shot
fold 0fold 1fold 2fold 3Mean
FCM40.447.442.940.542.8
FCM + Feat59.668.054.553.558.9
FCM + MMM62.770.257.357.061.8
+ +Table 5. Ablation studies on PASCAL $5^{i}$ dataset about which levels of features are better. Here $(2 + 3)$ indicates the 2nd and 3rd level features are fused, and (2,3) indicates we learn two memories from the 2nd and 3rd level features, respectively. + +
Methods1 shot
Fold 0Fold 1Fold 2Fold 3Mean
MMM(3) + APM59.869.354.255.259.6
MMM(2,3) + APM60.270.053.756.060.0
MMM(2+3) + Global61.869.156.756.461.2
MMM(2+3) + APM62.770.257.357.061.8
+ +restriction, we still use ResNet-50-v2 as our model backbone and $473 \times 473$ as our training size. Despite this, our 1-shot results still outperform PFENet by $5.1\%$ , as shown in Table 2. In addition, Fig. 4 gives a few qualitative testing results on fold-0 of PASCAL- $5^i$ dataset. + +For the inference speed and GPU memory consumption, our proposed MM-Net consumes 2466 MiB GPU memory (17 FPS), comparable to previous SOTA PFENet's 1920 MiB GPU memory consumption (42 FPS). The slightly more memory consumption and running time of MM-Net are due to our introduced Meta-class Memory Module. + +# 4.3. Ablation studies + +Number of Mate-class Memory Embeddings. We conduct ablation experiments to analyze how many meta-class + +Table 6. Ablation studies on our proposed memory reconstruction loss under 1-shot setting on PASCAL $5^{i}$ dataset. + +
Recon Loss On: +SupportQuery1 shot
Fold 0Fold 1Fold 2Fold 3Mean
60.770.255.656.260.7
✓64.169.856.155.561.4
✓62.570.257.756.161.6
62.770.257.357.061.8
+ +Table 7. Ablation studies on our proposed Quality Measurement Module under 5-shot setting on PASCAL $5^{i}$ dataset. + +
Methods5 shot
Fold 0Fold 1Fold 2Fold 3Mean
Ours w/o QMM60.771.056.961.862.6
Ours w/ QMM62.271.557.562.463.4
+ +memory embeddings are better for memory learning. Table 3 shows that 50 embeddings yield the best performance. This suggests that the network learns more meaningful and effective features with 50 meta-classes. Thus, we use 50 meta-class memory embeddings for our following experiments. + +Effect of Meta-class Memory Module. We construct two baselines to show the effectiveness of our proposed MMM. The first baseline is that we only use the foreground confidence map for the mask decoding (denoted as 'FCM' in Table 4). The 2nd baseline is that we add the middle-level image features for the mask prediction. Specifically, we extract the middle-level features (2nd and 3rd levels) of support and query images. Instead of computing the meta-class activate maps, we direct pass the image features to APM and FEM to predict the query mask. This baseline is denoted as 'FCM+Feat' in Table 4. + +As can be seen in Table 4, our proposed method 'FCM+MMM' improves the segmentation performance with $2.9\%$ gain in mean mIoU compared with directly using the middle-level features for decoding ('FCM+Feat'). This suggests that our proposed meta-class memory module is able to give better class prototype information for the query mask prediction. + +Fig. 5 gives some examples of the computed meta-class activation maps $Act$ , where we random select 5 from all 50 + +![](images/a259d5e4d4ed2e06d7b6f545f558843a1f0a6b3537020ebdfa99557e751f6a34.jpg) + +![](images/2a04b100b51f088ae743437c76d6990c9fe5cfceb31ea717cb4ce155f7fcee86.jpg) + +![](images/4856c287cfc8c7de99f65c2010f10da02a6ccdb3d3bd774ae45e9a96c1782073.jpg) + +![](images/800002594701466db2a96b2314f35f8a8e2eb0707fd3d2de93b3137cddb711dc.jpg) +Image + +![](images/44c643d68d5dcf6672cb851d7f20a02584935461367d69b01ac39b36f061acde.jpg) + +![](images/4c42a001fb4d0056ec9e16edcc637232a868ec79e0d0da90b6ff2411db92b5ec.jpg) + +![](images/b92655dce56e5dcd6e14e0abd22cf04629d50896517fe8f949849457c644fd09.jpg) + +![](images/42e70b57ce9d08838892e959a54e77501b865bc5e5697f51569786d9664ece03.jpg) +Map 1 +Figure 5. Visual results of the meta-class activation maps Act. We random select 5 from all 50 activation maps and all activation maps are obtained from the same meta-class memory. In the 1st row, we can see the meta-class memory highlights human's head, torso, edge, etc. + +![](images/8dc9f727eacb77c64a4db7269795b84f4ba86c5fbbd5bd021da3be716c11376c.jpg) + +![](images/4b220b49a184e67f3b48d8be0386bc9fcf0bc87e1a7d35b54c10cf5bb3faa0bf.jpg) + +![](images/66d41d0cc983dbc3889a7ce8ba4fb192e47cf7fb751f846ed7084e3f8fc37965.jpg) + +![](images/3131b27bec6e1f8cfe034a644c55990b69d30965b38d3a8854b90a9dda62edac.jpg) +Map 2 + +![](images/84a1d83c6d62577e5686e5aac7dfd6648c06b83f826158d62fd8f7cdfe33d623.jpg) + +![](images/3fc6b824c81b004c192aa2f00f2e1cf5d3722b31e2539c22fe3990d4201f825b.jpg) + +![](images/50d79de04b45c4774bf231bfae99ebbd0d4b45bceac3007c865a877805541e85.jpg) + +![](images/0162bfaac5206595a6ddc00898140e8a8ac8648fe8791ac09ae98facd5af66c4.jpg) +Map 3 + +![](images/79de35f05f48d684ab05e831793f51a7418ff94bac9673648a80579a72beaf75.jpg) + +![](images/9c2c948467e394ee9e4353d3067a65773e7bcf707d3245c9f01ac316a3c46036.jpg) + +![](images/38869079a137c40db8b3f3eada91a17355a1bdb43e4e4bc88029836d23d1ad68.jpg) + +![](images/b8d077cf52b9a99d579e6fd148f6d6b56a0200e5e2312cf72c593a579f5584f7.jpg) +Map 4 + +![](images/3eced942261a8c6ef32b4b087b0dd4220064e273bb93f3f10e64ea2d55bd521d.jpg) + +![](images/268e43e7afaefe4e3435fa3a143a19c9440ce374d532314287a2c0c2c576095c.jpg) + +![](images/71885d1aa739cc489474fdf6fd69ade86bc9da6762bbf3c984caa7339d59ef0e.jpg) + +![](images/a9caad95e1b39301acb13f49cd45ef11d0487efd21298364674b1cf1b0f1c9c0.jpg) +Map 5 + +meta-class activation maps and all the maps are obtained from the same learned meta-class memory. As we can see, different meta-class embeddings memorize different meta-class features and capture different patterns in the images, e.g., capturing human head, torso, edge, etc, in the first row. Features for memory learning. We conduct ablation experiments to analyze which level of feature is better for the memory learning. Table 5 shows that fusing 2nd and 3rd level features ( $2 + 3$ ) yields the best performance. Our conjecture is that because the 2nd-level features capture more edge information and the 3rd-level features capture more part and object information, a combination of them leads to learning better meta-class memory embeddings. + +Effect of Activation Propagation Module. With the metaclass activation maps of query and support images, instead of using APM, one simple way to propagate the support mask information to query activation maps is to apply a global average pooling within the foreground region on the support activation maps to get a global average foreground representation vector, and then element-wise multiply it with each node in the query activation maps. This is denoted as 'MMM(2+3)+Global' in Table 5. It can be seen that the APM is able to improve the mIoU by $0.6\%$ . + +Effect of Memory Reconstruction Loss. Table 6 shows the ablation study on our proposed memory reconstruction loss. It can be seen that the results with the loss are much better than the one without using the loss, clearly demonstrating its effectiveness. Note that the reconstruction loss can be applied for the reconstructions of different features, including query features, support features and both features. We can see that applying the loss for support features leads to the overall best performance. + +Effect of Quality Measurement Module. Table 7 shows + +the effectiveness of our proposed Quality Measurement Module. For the baseline method (ours $w / o$ QMM), we use APM to obtain 5 fused activation maps independently from 5 different support images, and then we follow the conventional way to average the 5 maps and pass the averaged map to FEM for the segmentation mask generation. Our proposed QMM improves mIoU by $0.8\%$ . This suggests that high quality support samples are more helpful for the query segmentation mask prediction. + +# 5. Conclusion + +In this paper, we have proposed a novel Meta-class Memory based few shot semantic segmentation method (MM-Net) with the major components of MMM, APM, FCM and QMM. The key novelty of our method lies in MMM, where we introduced a set of learnable meta-class embeddings to allow the common knowledge transfer between base classes and novel classes. Another novelty is from QMM, which can measure the quality of each support image so as to better fuse the support features. With all these components, our MM-Net has significantly improved the SOTA results on both PASCAL- $5^{i}$ and COCO datasets. + +Acknowledgements. This study is supported under the RIE2020 Industry Alignment Fund - Industry Collaboration Projects (IAF-ICP) Funding Initiative, as well as cash and in-kind contribution from the industry partner(s). This research is also supported by the National Research Foundation, Singapore under its AI Singapore Programme (AISG Award No: AISG-RP-2018-003), and the MOE Tier-1 research grants: RG28/18 (S), RG22/19 (S) and RG95/20. This research is also partially supported by Monash Start-up Grant and SenseTime Gift Grant. + +# References + +[1] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Semantic image segmentation with deep convolutional nets and fully connected crfs. arXiv preprint arXiv:1412.7062, 2014. +[2] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. 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. +[3] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017. +[4] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pages 801-818, 2018. +[5] Nanqing Dong and Eric P Xing. Few-shot semantic segmentation with prototype learning. In BMVC, volume 3, 2018. +[6] Zhibo Fan, Jin-Gang Yu, Zhihao Liang, Jiarong Ou, Changxin Gao, Gui-Song Xia, and Yuanqing Li. Fgn: Fully guided network for few-shot instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9172-9181, 2020. +[7] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017. +[8] Siddhartha Gairola, Mayur Hemani, Ayush Chopra, and Balaji Krishnamurthy. Simpropnet: Improved similarity propagation for few-shot image segmentation. arXiv preprint arXiv:2004.15014, 2020. +[9] Bharath Hariharan, Pablo Arbeláez, Ross Girshick, and Jitendra Malik. Simultaneous detection and segmentation. In European Conference on Computer Vision, pages 297-312. Springer, 2014. +[10] Shaoli Huang and Dacheng Tao. All you need is a good representation: A multi-level and classifier-centric representation for few-shot learning. arXiv preprint arXiv:1911.12476, 2019. +[11] Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Metasgd: Learning to learn quickly for few-shot learning. arXiv preprint arXiv:1707.09835, 2017. +[12] Guosheng Lin, Anton Milan, Chunhua Shen, and Ian Reid. Refinenet: Multi-path refinement networks for high-resolution semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1925-1934, 2017. +[13] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740-755. Springer, 2014. +[14] Weide Liu, Guosheng Lin, Tianyi Zhang, and Zichuan Liu. Guided co-segmentation network for fast video object seg + +mentation. IEEE Transactions on Circuits and Systems for Video Technology, 31(4):1607-1617, 2020. +[15] Weide Liu, Zhonghua Wu, Henghui Ding, Fayao Liu, Jie Lin, and Guosheng Lin. Few-shot segmentation with global and local contrastive learning. arXiv preprint arXiv:2108.05293, 2021. +[16] Weide Liu, Chi Zhang, Guosheng Lin, Tzu-Yi Hung, and Chunyan Miao. Weakly supervised segmentation with maximum bipartite graph matching. In Proceedings of the 28th ACM International Conference on Multimedia, pages 2085-2094, 2020. +[17] Weide Liu, Chi Zhang, Guosheng Lin, and Fayao Liu. Crnet: Cross-reference networks for few-shot segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4165-4173, 2020. +[18] Yongfei Liu, Xiangyi Zhang, Songyang Zhang, and Xuming He. Part-aware prototype network for few-shot semantic segmentation. arXiv preprint arXiv:2007.06309, 2020. +[19] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431-3440, 2015. +[20] Tsendsumen Munkhdalai and Hong Yu. Meta networks. Proceedings of machine learning research, 70:2554, 2017. +[21] Khoi Nguyen and Sinisa Todorovic. Feature weighting and boosting for few-shot segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pages 622-631, 2019. +[22] Cheng Ouyang, Carlo Biffi, Chen Chen, Turkay Kart, Huaqi Qiu, and Daniel Rueckert. Self-supervision with superpixels: Training few-shot medical image segmentation without annotation. In European Conference on Computer Vision, pages 762-780. Springer, 2020. +[23] Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. arXiv preprint arXiv:1807.05960, 2018. +[24] Amirreza Shaban, Shray Bansal, Zhen Liu, Irfan Essa, and Byron Boots. One-shot learning for semantic segmentation. arXiv preprint arXiv:1709.03410, 2017. +[25] Xiangxi Shi, Zhonghua Wu, Guosheng Lin, Jianfei Cai, and Shafiq Joty. Remember what you have drawn: Semantic image manipulation with memory. arXiv preprint arXiv:2107.12579, 2021. +[26] Zhuotao Tian, Hengshuang Zhao, Michelle Shu, Zhicheng Yang, Ruiyu Li, and Jiaya Jia. Prior guided feature enrichment network for few-shot segmentation. TPAMI, 2020. +[27] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pages 3630-3638, 2016. +[28] Haochen Wang, Xudong Zhang, Yutao Hu, Yandan Yang, Xianbin Cao, and Xiantong Zhen. Few-shot semantic segmentation with democratic attention networks. ECCV, 2020. +[29] Kaixin Wang, Jun Hao Liew, Yingtian Zou, Daquan Zhou, and Jiashi Feng. Panet: Few-shot image semantic segmentation with prototype alignment. In Proceedings of the IEEE + +International Conference on Computer Vision, pages 9197-9206, 2019. +[30] Zhonghua Wu, Guosheng Lin, and Jianfei Cai. Keypoint based weakly supervised human parsing. Image and Vision Computing, 91:103801, 2019. +[31] Zhonghua Wu, Guosheng Lin, Qingyi Tao, and Jianfei Cai. M2e-try on net: Fashion from model to everyone. In Proceedings of the 27th ACM International Conference on Multimedia, pages 293–301, 2019. +[32] Zhonghua Wu, Qingyi Tao, Guosheng Lin, and Jianfei Cai. Exploring bottom-up and top-down cues with attentive learning for webly supervised object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12936-12945, 2020. +[33] Boyu Yang, Chang Liu, Bohao Li, Jianbin Jiao, and Qixiang Ye. Prototype mixture models for few-shot semantic segmentation. arXiv preprint arXiv:2008.03898, 2020. +[34] Chi Zhang, Guosheng Lin, Fayao Liu, Jiushuang Guo, Qingyao Wu, and Rui Yao. Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pages 9587-9595, 2019. +[35] Chi Zhang, Guosheng Lin, Fayao Liu, Rui Yao, and Chunhua Shen. 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, pages 5217–5226, 2019. +[36] Tianyi Zhang, Guosheng Lin, Weide Liu, Jianfei Cai, and Alex Kot. Splitting vs. merging: Mining object regions with discrepancy and intersection loss for weakly supervised semantic segmentation. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXII 16, pages 663-679. Springer, 2020. +[37] Xiaojing Zhong, Zhonghua Wu, Taizhe Tan, Guosheng Lin, and Qingyao Wu. Mv-ton: Memory-based video virtual try-on network. arXiv preprint arXiv:2108.07502, 2021. +[38] Yixiong Zou, Shanghang Zhang, José MF Moura, JianPeng Yu, and Yonghong Tian. Revisiting mid-level patterns for distant-domain few-shot recognition. arXiv preprint arXiv:2008.03128, 2020. \ No newline at end of file diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/images.zip b/learningmetaclassmemoryforfewshotsemanticsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..95f3853a7c1b1ccc65bfa5f98cf195eec84b6d56 --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f72e739e08b6bf0359dbdc81bcf24196b87b1705ebb89eb47f753be1cc75e7ed +size 576985 diff --git a/learningmetaclassmemoryforfewshotsemanticsegmentation/layout.json b/learningmetaclassmemoryforfewshotsemanticsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6a5acef8e76beea84173d8118e73299d16c13f22 --- /dev/null +++ b/learningmetaclassmemoryforfewshotsemanticsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef1f87df7d394769637f5e9f16956fa6da32a9940c71f6418df015679c7a51de +size 450240 diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_content_list.json b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fca5f7d8610fdd1a664050673eee235300bb1735 --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1036f261c47a874f153d18cc383f86b3d159231863a4c269b2bcc8de9b429743 +size 82878 diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_model.json b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c25a9f2ff49d07fca463d03bae79a8ca296b0d70 --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c4bd79ccf2255cab6209cd39fbe929048b149abebd811221de5904f7b9297df +size 98846 diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_origin.pdf b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5c4fe0696537a0c71de8dd3562ef0d8b6a7f744b --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/c3b74e36-189b-4ef3-b7b0-78eab8ae97d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:275afc5c5df01548df2632a64c0eed177daf26d6198d8d9ee62c7fb7276e32d1 +size 1667053 diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/full.md b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d27c3055985b518d53743ec051f4aa8f1c77ce71 --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/full.md @@ -0,0 +1,359 @@ +# Learning Motion-Appearance Co-Attention for Zero-Shot Video Object Segmentation + +Shu Yang $^{1}$ , Lu Zhang $^{1}$ , Jinqing Qi $^{1}$ , Huchuan Lu $^{1}$ , Shuo Wang $^{2}$ , Xiaoxing Zhang $^{2}$ $^{1}$ Dalian University of Technology, China + $^{2}$ Meituan, China + +{yangshua, luzhang_dut}@mail.dlut.edu.cn, {jinqing, lhchuan}@dlut.edu.cn, {wangshuo28, zhangxiaoxing}@meituan.com + +# Abstract + +How to make the appearance and motion information interact effectively to accommodate complex scenarios is a fundamental issue in flow-based zero-shot video object segmentation. In this paper, we propose an Attentive Multi-Modality Collaboration Network (AMC-Net) to utilize appearance and motion information uniformly. Specifically, AMC-Net fuses robust information from multi-modality features and promotes their collaboration in two stages. First, we propose a Multi-Modality Co-Attention Gate (MCG) on the bilateral encoder branches, in which a gate function is used to formulate co-attention scores for balancing the contributions of multi-modality features and suppressing the redundant and misleading information. Then, we propose a Motion Correction Module (MCM) with a visual-motion attention mechanism, which is constructed to emphasize the features of foreground objects by incorporating the spatio-temporal correspondence between appearance and motion cues. Extensive experiments on three public challenging benchmark datasets verify that our proposed network performs favorably against existing state-of-the-art methods via training with fewer data. The code is released at https://github.com/isyangshu/AMC-Net. + +# 1. Introduction + +Zero-shot Video Object Segmentation (ZVOS) aims to automatically separate the primary object(s) from the background in a video sequence without any human interaction. Since ZVOS does not require manual intervention, it has significant value in a wide range of applications, such as video compression [11], visual tracking [45], and person re-identification [51]. How to distinguish the target object(s) from complex and diverse background without any prior knowledge is an open challenge in ZVOS. + +To address this issue, several methods [38, 21, 1, 19, 53] + +![](images/f4329c997c8e8aacb6a8a7ff10c1a457afea8e21207f290e0d589f7a4afda996.jpg) +(a) + +![](images/9eaddcee7452e37e655f484d36b2db7cc783a0c9c5143667f735877146f29979.jpg) +(b) + +![](images/a3a126954320c7c6cc259cc16d783aadc45c1fe70fe19679e269c02db115ee01.jpg) +(c) +Figure 1. Illustration of various multi-modality interaction approaches for fusing appearance and motion information. + +design various multi-modality interaction schemes to leverage external object motion information, which hypothesizes that the object moving across the video sequence is highly related to the primary object. Despite the impressive performance, there remain some issues in existing interaction approaches. Early methods [38, 21, 1] directly execute feature alignment such as concatenation or addition to produce object masks (see Figure 1 (a)). Due to the redundant and invalid information in flow maps and video frames, the direct feature alignment of multi-modality features would limit the accuracy of segmentation (see the third column in Figure 2). Several methods [53, 19] propose to build a motion-based attention mechanism to enhance the feature learning of object appearance (see Figure 1 (b)). These methods learn to + +![](images/bfb02becd0d58475f9f3677ebaceefd9fc5e5054afbd806bfffd44ae859cb08b.jpg) +Figure 2. Visual comparison of different flow-based methods. We show the video frames, optical flow maps, SegFlow [1] predictions, MATNet [53] predictions, and our predictions in the bmx-trees, motocross-jump, and car-roundabout video sequences. The optical flow maps are predicted by PwCNet [35]. + +enhance the appearance features of the significant motion areas, which makes them rely on the quality of optical flow. However, when complex motion conditions (e.g., deformation, motion blur, fast motion, and clutters) occur in the video sequence, optical flow might fail to capture the object location and influence the accuracy of object segmentation (see the fourth column in Figure 2). + +Motivated by the above observations, in this paper, we propose an Attentive Multi-Modality Collaboration Network (AMC-Net) for zero-shot video object segmentation, which builds a novel co-attention mechanism for effective multi-modality interaction. AMC-Net adaptively fuses robust spatio-temporal representations from multi-modality features and promotes their collaboration in two stages to thoroughly combine the merits of appearance and motion features (see Figure 1 (c)). In the first stage, we propose a Multi-Modality Co-Attention Gate (MCG), which is used to unify the appearance and motion information into valid spatio-temporal feature representations. Considering the disparity of the contributions of different modality features, we utilize a gate function to predict the co-attention scores, which are used to balance the contributions of multimodality features and suppress the redundant and misleading information. In the second stage, we propose a Motion Correction Module (MCM) to perform adaptive feature fusion, in which a visual-motion attention mechanism is constructed to emphasize the features of foreground objects by incorporating the spatio-temporal correspondence between appearance and motion cues. Specifically, different from the single-directional attention guidance from motion to appearance, we model the attention based on visual saliency and motion saliency to facilitate the feature learning of foreground objects. + +To investigate the effectiveness of our proposed model, we conduct comprehensive experiments including overall comparison and ablation studies on three benchmark + +datasets [31, 33, 29]. The results show that our proposed method can achieve superior performance against the state-of-the-arts by using only DAVIS-16 [31] for training. + +Our contributions can be summarized as follows: + +- We propose an Attentive Multi-Modality Collaboration Network for zero-shot video object segmentation, which promotes deep collaboration of appearance and motion information to generate accurate object segmentation. +- We propose a Multi-Modality Co-Attention Gate to unify the multi-modality information. A gate function is used to produce co-attention scores to adaptively balance the contributions of appearance and motion information. +- Our proposed method performs favorably against the state-of-the-art methods on three public challenging benchmark datasets (DAVIS-16 [31], Youtube-Objects [33], and FBMS [29]). + +# 2. Related work + +According to whether the manual intervention is required during testing, video object segmentation (VOS) can be broadly categorized into zero-shot (ZVOS) and one-shot (OVOS). In this paper, we focus on an object-level ZVOS setting (i.e., do not discriminate different instances), which extracts primary object(s) without manual annotation. + +Zero-shot video object segmentation aims to automatically generate masks of the primary objects in the video sequence without any human interaction, which is also called unsupervised video object segmentation (UVOS) [14, 18, 32, 49, 21]. Early non-learning methods based on handcrafted features leverage low-level cues, such as visual saliency information [42, 9, 5, 39], object proposals [18, 27, 49, 14, 6], or optical flow [16, 21, 13, 20, 30], which are used as reliable prior knowledge to guide object segmentation. Later, inspired by the success of deep learning on segmentation tasks, more research efforts focus on + +![](images/ef81b5719d9fcca33b92efb14d5d71fba7f639900a7c1654e6093b96bf36948b.jpg) +Figure 3. Overview of Attentive Multi-Modality Collaboration Network (AMC-Net). Given an input frame and the corresponding optical flow map, we first use bilateral encoder branches to extract multi-modality features. Then we adopt multi-level MCG on multiple encoder side outputs to filter information and unify robust information into spatio-temporal feature representations. Finally, we stack multiple MCMs in a coarse-to-fine manner to produce final predictions. + +fully convolutional networks based ZVOS models. For example, several methods [34, 38, 43] use variants of recurrent neural networks to store previously computed segmentation information implicitly. Inspired by the non-local operation, COSNet [26], AGNN [41] and AnDiff [48] model the long-term correlations between frames to explore global information and gain a more comprehensive understanding of the video contents. WCS [50] encodes the pixel-wise correspondence between frames and takes object hotspots as guidance to enhance the influence of salient regions. 3DC-Seg [28] leverages 3D convolution to jointly learn spatial and temporal features. Recent method [25] proposes episodic graph memory to store cross-frame correlations and learn to update the segmentation model. + +An alternative choice is to extract effective guidance about motion information from optical flow. LMP [37] discards the modeling of appearance features and purely relies on optical flow to predict foreground motion, which results in incorrect results for static foreground objects. To address this issue, several flow-based approaches [38, 1, 12, 19, 53] generally adopt dual-branch full convolution networks with feature fusion schemes, e.g., concatenation or attention mechanism, to aggregate appearance and motion information. Without considering the disparity of the contributions of multi-modality features, recent flow-based methods [19, 53] only consider the one-directional attention guidance from motion to appearance and enhance the appearance features of significant motion areas. When motion or appearance information is not significant from the background, these methods can not achieve satisfactory results which are shown in Figure 2. In this work, we consider the importance of deep collaboration between appearance and motion in learning richer spatio-temporal feature representations. We propose an Attentive Multi-Modality Collaboration Network (AMC-Net) to fuse robust information from multi-modality features and promote their collaboration for accurate zero-shot video object segmentation. + +# 3. Method + +# 3.1. Architecture Overview + +In this work, we propose an Attentive Multi-Modality Collaboration Network (AMC-Net) for accurate zero-shot video object segmentation, which constructs a two-stage multi-modality integration system. The framework of our AMC-Net is shown in Figure 3. Specifically, given an input frame $I \in \mathbb{R}^{H \times W \times 3}$ and the corresponding flow map $O \in \mathbb{R}^{H \times W \times 3}$ , we employ parallel encoder branches to capture the multi-level appearance and motion features, which are represented as $\{F_i^a\}_{i=0}^4$ and $\{F_i^m\}_{i=0}^4$ . In the first stage, with the appearance feature $F_i^a$ and motion feature $F_i^m$ as input, a Multi-Modality Co-Attention Gate (MCG) is proposed to suppress the interference from redundant and invalid information and obtain effective spatio-temporal feature representations. We implement MCG on multi-level encoder side outputs to integrate the multi-modality features and propagate more valuable feature representations to the decoder. In the second stage, we use Motion Correction Module (MCM) to further emphasize the features of foreground objects by constructing a visual-motion attention mechanism. We stack multiple MCMs in a coarse-to-fine manner to facilitate the feature learning of foreground objects and generate the final segmentation results. + +# 3.2. Multi-Modality Co-Attention Gate + +Recent flow-based methods [19, 53] explore the appearance features of significant motion areas and utilize single-directional attention guidance from motion to appearance, which makes them rely on the dominant motion in the scene and ignore inherent noises in optical flow maps or images. In this paper, we propose a Multi-Modality Co-Attention Gate (MCG) for attentive motion-appearance interaction. We identify effective information from motion and appearance, and integrate cross-modality features into unified spatio-temporal feature representations. + +![](images/743fcc1d65be1dcc27e36228d7d91268b632fece6a2090b5e768aeb4ae5fed98.jpg) +Figure 4. Frameworks of Multi-Modality Co-Attention Gate (left) and Motion Correction Module (right). + +The framework of MCG is shown in Figure 4. Given an appearance feature $F_{i}^{a}$ and a motion feature $F_{i}^{m}$ at level $i$ , we first combine them using cross-channel concatenation and convolution operation for implicit interaction, which aligns the motion feature with the appearance feature and helps to capture the relative relationship between multi-modality features. Then we obtain the fused feature $H \in \mathbb{R}^{h \times w \times 2}$ and spilt the channel-wise feature maps to two sub-branches. We perform the sigmoid function and global average pooling on each channel to obtain a pair of co-attention scores $g_{i}^{a}$ and $g_{i}^{m}$ , which reflect the importance of each modality feature on the final result. Specifically, we integrate the features from appearance and motion to formulate gate function, which plays the role of modality-wise attention and models the overall distribution of the contributions of multi-modality features in the network from global perspective. The entire gate function can be formulated as + +$$ +g _ {i} = \operatorname {A v g} \left(\sigma \left(\operatorname {C o n v} \left(\operatorname {C a t} \left(F _ {i} ^ {a}, F _ {i} ^ {m}\right)\right)\right)\right), \tag {1} +$$ + +where $g_{i}$ contains a pair of co-attention scores $g_{i}^{a}$ and $g_{i}^{m}$ . $Avg(\cdot)$ is the global average pooling. $\sigma$ denotes sigmoid function scaling the weight value into (0, 1). $Conv(\cdot)$ refers to the convolution layer with output channel 2 and $Cat(\cdot)$ is the concatenation operation among channel axis. In Figure 5, we give some visual examples of the co-attention scores in various videos. The tagged values show the disparity of the contributions of images and corresponding optical flow maps. A higher co-attention score indicates that the corresponding modality feature contains effective information for accurate segmentation. On the contrary, the modality feature with a lower score may contain noise that affects performance. + +We apply the co-attention scores to the corresponding features to generate gated appearance feature $G_{i}^{a}$ and gated motion feature $G_{i}^{m}$ , + +$$ +G _ {i} ^ {a} = F _ {i} ^ {a} * g _ {i} ^ {a}, G _ {i} ^ {m} = F _ {i} ^ {m} * g _ {i} ^ {m}, \tag {2} +$$ + +which can be viewed as suppressing redundant and misleading information and enhancing more effective information. By assigning reliability scores for appearance and motion features, the network would not rely too much on either of the two information. It learns to adaptively exploit the merits of appearance and motion information to obtain satisfactory results. Considering the uncertainty of the predicted flow maps, we use channel-wise and spatial-wise attentions on motion features to emphasize the motion areas. Instead of treating all channels equally, we first build the inter-channel relationship of $G_{i}^{m}$ , + +$$ +M ^ {\prime} = \sigma (M L P _ {f c} (A v g (G _ {i} ^ {m}))) * G _ {i} ^ {m}, \tag {3} +$$ + +where $MLP_{fc}$ denotes fully connected layers. By doing this, we strengthen the responses of multi-level attributes, including texture, boundaries, color and semantics. Then we utilize the inter-spatial relationship of $M'$ to emphasize the spatial locations of salient motion areas, + +$$ +M ^ {\prime \prime} = \sigma \left(M L P _ {c o n v} \left(\operatorname {M a x} \left(M ^ {\prime}\right)\right) * M ^ {\prime}, \right. \tag {4} +$$ + +where $MLP_{conv}$ denotes convolution layers and $Max(\cdot)$ is the global max pooling. We emphasize the features closely associated with motion-salient objects, which can take advantage of more effective salient motion information and temporal features. With the implicit interaction of appearance and motion information, we can aggregate features complementarily to obtain unified spatio-temporal feature representations. We devise the aggregation operation as an element-wise addition of the two modalities, + +$$ +E _ {i} = G _ {i} ^ {a} + M ^ {\prime \prime}. \tag {5} +$$ + +$E_{i}$ is fed to the next stage of the appearance branch and exploited in the decoder for mask generation. In particular, $G_{i}^{m}$ is applied to the decoder instead of the next stage + +![](images/a10e1e93a322cb8b97904079a8fbab1ad379e73211f6541488a4664d696598ec.jpg) + +![](images/b67fb0aef78f68c89e191628b57dd0a24b219c8b54ef9915014adfdd5343929c.jpg) + +![](images/31f6742aa0d69ca14c310a806783a1884fbf73050987b9f9bf5271d716086e45.jpg) +Figure 5. Visual samples of the co-attention scores. We show various video frames and the corresponding flow maps, along with the tagged scores to characterize the disparity of the contributions in motocross-jump, blackswan, bmx-trees and soapbox. + +![](images/35713e6e023e3b9bf00bfea4d5e4059d990efc10601732ee104d4e727dd132b1.jpg) + +![](images/bd542b0087d117e44cfd599219e00c1d4b385fdd013e766e66079c1081fa0f09.jpg) + +![](images/2f8ec2a6a9c316179c0e967ae080d997282c8a290ee5a7cecf39c891acaa5228.jpg) + +![](images/72be008a84e5712188c964397f56f06d221115209398336b6eeca30d7fc850eb.jpg) + +![](images/067f7dad49b3c54881e9568c048c5b354080796b6ff597cb9a8b65e75269a04f.jpg) + +![](images/a78dadae4a3fe981b001d957cdc5746abe294df7a276a656cd18e7ca8258b97f.jpg) + +![](images/ccfeeaaab3179cdfac0eb1662654d419b0978e67fc5fd64746bb182376e87c32.jpg) + +![](images/5a4cf80a486e79de4b2c4920768bc61ef8e4df0376f6fda9876c8e5ddf36b145.jpg) + +![](images/73654cc9b001fcc324d68067f4b397d2568cb060f8ef37e4aa383db0078822dc.jpg) + +of the motion branch, ensuring the effectiveness of motion features during the long-term spread. + +In order to capture the global features of primary objects, we compute the similarity between temporal and spatial information on the last encoder block. Specifically, we calculate a similarity matrix $P$ to establish dense correspondences between each pair of pixels from gated motion feature $G_{4}^{m}$ and enhanced appearance feature $E_{4}$ . Similarly to [44], we combine the similarity matrix $P$ with $E_{4}$ to yield the attention-enhanced feature map $\hat{E}_{4}$ , + +$$ +\hat {E} _ {4} = \operatorname {s o f t m a x} \left(\frac {1}{\sqrt {c}} G _ {4} ^ {m} \odot E _ {4} ^ {T}\right) \odot E _ {4}, \tag {6} +$$ + +where $\odot$ indicates matrix multiplication. Following [23, 40], we scale the dot product by $\frac{1}{\sqrt{c}}$ , where $c$ is the channel size of $G_4^m$ and $E_4$ . + +# 3.3. Motion Correction Module + +With the adaptively multi-modality interaction by MCG, we obtain effective spatial-temporal correspondence encoder features, which may be well-aligned with the primary foreground objects in frames. Considering the complex scenes in video sequences, we unify the visual and motion significant areas to correct the intermediate features. We employ Motion Correction Module (MCM) to leverage appearance and motion features to supplement effective details and suppress the activation of non-salient regions. Besides, we construct visual-motion attention to emphasize the features of foreground objects by combining visual and motion cues. The details of MCM are shown in Figure 4. + +Taking the gated motion feature $G_{i}^{m}$ , enhanced appearance feature $E_{i}$ from MCG and the decoder feature $D_{i-1}$ from the previous decoder block as input, MCM aims to promote deep collaboration further to generate accurate results. When the previous decoding step is not available, we use $\hat{E}_{4}$ as the decoder feature to provide global information. One branch of the parallel branch aims to fuse visual saliency and motion saliency to extract visual-motion attention. This operations could be formulated as + +$$ +F = \operatorname {C a t} \left(U p \left(D _ {i - 1}\right), G _ {i} ^ {m}\right), \tag {7} +$$ + +where $Up(\cdot)$ is the upsampling operation with stride 2. Then we exploit the inter-channel relationship of fused feature $F$ to improve the channel response of the significant information (visual or motion), + +$$ +F ^ {\prime} = \sigma \left(M L P _ {f c} (A v g (F))\right) * F. \tag {8} +$$ + +We select and strengthen the responses with higher significance. Then we utilize the inter-spatial relationship to calculate the comprehensive responses (visual and motion) of each pixel to generate attention maps, + +$$ +A = \sigma \left(M L P _ {c o n v} \left(\operatorname {M a x} \left(F ^ {\prime}\right)\right), \right. \tag {9} +$$ + +where $A$ refers to the visual-motion attention, which can be viewed as salient areas to suppress the activation of background and facilitate the feature learning of foreground objects. We argue these attention maps should be consistent with the final mask and equally weigh the cross-entropy loss for both the intermediate attention maps and the final prediction. + +The other branch is designed as a residual structure, which is used to enhance the details of $D_{i-1}$ by encoder features $E_i$ with higher resolution. Finally, we combine $A$ with the fused feature to correct feature and add $D_{i-1}$ to obtain $D_i$ . The entire process can be formulated as + +$$ +D _ {i} = \operatorname {C o n v} \left(\operatorname {C a t} \left(U p \left(D _ {i - 1}\right), E _ {i}\right)\right) \cdot A + D _ {i - 1}, \tag {10} +$$ + +where $\cdot$ refers to element-wise multiplication. + +# 3.4. Training and Inference + +Implementation details. Following the most state-of-the-art flow-based methods, we take the ResNet-101 [8] pre-trained on ImageNet [3] as backbone. Given the current frame $I_{t}$ and next frame $I_{t + 1}$ , we adopt PwCNet [35] to formulate optical flow maps $O_{t}$ . Unlike the training strategy of other methods, we only use DAVIS-16 for training without applying any image datasets [47, 2, 22]. + +Training. Given images and optical flow maps as input, we train the model for 100 epochs with a mini-batch size as 4. We resize the images and flow maps to $384 \times 384$ for the balance between speed and performance. We adopt stochastic gradient descent (SGD) to train our AMC-Net, where the momentum, weight decay, and initial learning rate are set as 0.9, 0.0005 and 0.001. We use the "poly" policy [24] with the power of 0.9 to adjust the learning rate during training. We conduct data augmentation with random horizontally flipping and random rotation to avoid over-fitting and make the learned model more robust. + +Inference. We use the same resolution $384 \times 384$ for each testing video sequence without any data augmentation and human interaction. Following the common protocol in ZVOS, we employ the fully-connected CRF [17] to obtain the final binary segmentation results. + +
MethodJ mean ↑F mean ↑J&F ↑
Baseline77.477.477.4
+ Multi-Modality Co-Attention Gate
w/o gate78.5(+1.1)78.9(+1.5)78.7(+1.3)
w/ gate80.7(+3.3)81.3(+3.9)81.0(+3.6)
+ Motion Correction Module
single MCM81.1(+0.4)81.7(+0.4)81.4(+0.4)
3 stacked MCMs81.9(+1.2)83.9(+2.6)82.9(+1.9)
5 stacked MCMs83.0(+2.3)84.3(+3.0)83.7(+2.7)
+ Fully-Connected CRF
AMCpwc w/ crf84.2(+1.2)84.5(+0.2)84.4(+0.7)
+ Better Quality Optical Flow
AMCraft w/ crf84.5(+0.3)84.6(+0.1)84.6(+0.2)
+ +![](images/e897d905c85370fe20e95ccf756be0ff06ffe845013e843cf6f35e1d573f8b01.jpg) +Figure 6. Distribution of the co-attention scores at each stage. With the convolution stage as the horizontal axis, we statistically demonstrate the curves about $g^a / g^m$ in (a), evaluating the relative importance between multi-modality features. Meanwhile, we demonstrate the curves of co-attention scores $g_i^a$ and $g_i^m$ in (b). + +![](images/5bf5ced1601f4078ea56ecb993ddaa9711968702fca30e94e17e2bc03a668d61.jpg) + +Runtime. For each test image of size $384 \times 384 \times 3$ , the forward inference of our AMC-Net takes about 0.057s with a single Nvidia 1080Ti GPU. + +# 4. Experiments + +# 4.1. Dataset and Metrics + +To evaluate the performance of our proposed method AMC-Net, we conduct comparison experiments on three public challenging benchmark datasets, including DAVIS-16 [31], Youtube-Objects [33] and FBMS [29]. + +DAVIS-16 consists of total 50 high-quality video sequences with 3455 densely annotated frames. We use 30 video sequences for training and the remaining 20 for testing. Each frame contains pixel-precise annotation of only one foreground object. + +Youtube-Objects contains 126 video sequences of 10 object categories. The ground-truth in Youtube-Objects is sparsely labeled in every ten frames. + +FBMS is comprised of 59 video sequences, with only 720 frames sparsely annotated. Certain video sequences are annotated with multiple target foreground objects. + +Table 1. Ablation analysis of our proposed AMC-Net on DAVIS-16, measured by the $\mathcal{I}$ mean, $\mathcal{F}$ mean and $\mathcal{J} \& \mathcal{F}$ . Red indicates the performance improvement compared to the previous setting. + +
Stagew/o00-10-20-30-4
J&F81.182.782.883.283.583.7
+ +Table 2. Effectiveness of the Multi-Modality Co-Attention Gate (MCG) at multiple encoder side on DAVIS-16. + +
Supervision012345
J&F81.582.682.782.783.583.7
+ +Table 3. Performance comparisons with different numbers of supervision for visual-motion attention on DAVIS-16. + +
ModelMATNet [53]AMC-NetAMC-NetAMC-Net
Flow ModelPWCNet [35]FlowNetS [4]FlowNet2CS [10]PWCNet [35]
J&F81.680.583.184.4
+ +Table 4. Performance comparisons with different quality of optical flow maps on DAVIS-16. + +# 4.2. Ablation Study + +In this section, we conduct ablation studies of AMC-Net on the DAVIS-16. We add each component into the network in turn to verify the effectiveness. In Table 1, we report detailed results in terms of $\mathcal{I}$ mean, $\mathcal{F}$ mean and their average $\mathcal{J} \& \mathcal{F}$ . To analyze the contribution of each component, we implement a simple baseline by employing bilateral encoder branches with performing a concatenation to integrate the multi-modality cues (as shown in Figure 1 (a)). + +Effectiveness of Multi-Modality Co-Attention Gate. By adding MCG into the baseline, the model ("w/ gate") significantly outperforms the baseline by $3.6\%$ on $\mathcal{J}\& \mathcal{F}$ . To investigate the effect of our proposed gate function, we implement a variant ("w/o gate") without the gate function. This variant encounters a huge performance degradation ( $2.2\%$ in $\mathcal{J}$ mean and $2.4\%$ in $\mathcal{F}$ mean), which demonstrates the effectiveness of the gate function. Furthermore, we add MCG into the bilateral encoder branches in turn from the first stage and use simple feature aggregation at other stages. As shown in Table 2, MCG propagates more valuable information while minimizing interference. + +Effectiveness of Motion Correction Module. To explore the impact of the number of stacked MCMs on performance, we first deploy a single MCM on the last decoder block, which has an improvement of $0.4\%$ on $\mathcal{I}\& \mathcal{F}$ . The variant ("3 stacked MCMs") with MCMs staked at last three decoder blocks achieves gains of $1.2\%$ and $2.6\%$ on $\mathcal{I}$ mean and $\mathcal{F}$ mean, respectively. When we use MCMs on all decoder blocks, the variant ("5 stacked MCMs") achieves the highest performance with a $\mathcal{J}$ mean score of 83.0. In addition, we explore the impact of the visual-motion attention mechanism on performance with five stacked MCMs. In Table 3, we report the results of adding supervision for visual-motion attention in turn from the first decoder block. + +Effect of the quality of optical flow maps. To verify the effect of the optical flow quality on our full model, we first implement a variant $(AMC_{raft})$ by using the op + +
ModelOperationsMetrics JMetrics FJ & F
SDYPPMean ↑Recall ↑Decay ↓Mean ↑Recall ↑Decay ↓
SFL [1]✓✓67.481.46.266.777.15.167.1
LMP [37]✓✓✓70.085.01.365.979.22.568.0
PDB [34]✓✓✓77.290.10.974.584.4-0.275.9
ARP [14]✓76.289.17.070.683.57.973.4
AGS [43]✓✓✓79.791.11.977.485.81.678.6
COSNet [26]✓✓✓80.593.14.479.589.55.080.0
AGNN [41]✓✓✓80.794.00.079.190.50.079.9
ANDiff [48]✓✓✓81.790.92.280.585.10.681.1
MATNet [53]✓✓*✓82.494.55.580.790.24.581.6
EGMN [25]✓✓✓82.594.34.281.290.35.681.9
WCS [50]✓✓82.2--80.7--81.5
DFNet [52]✓✓✓83.4--81.8--82.6
3DC-Seg [28]✓------82.2
3DC-Seg* [28]✓✓✓84.395.77.484.792.65.284.5
Ours✓✓84.296.03.584.594.42.284.4
Ours-raft✓✓84.596.42.884.693.82.584.6
+ +Table 5. Overall comparison with the state-of-the-arts on DAVIS-16 validation dataset. Use “√” in the table to indicate whether the method uses the static segmentation datasets (S), DAVIS-16 (D), Youtube-VOS (Y) or Post-processing (PP). The “√*” in the Y-column indicates that MATNet uses a subset of 12K frames selected from the training set of Youtube-VOS. + +
ModelAeroplaneBirdBoatCarCatCowDogHorseMotorbikeTrainAvg ↑
ARP [14]73.656.157.833.930.541.836.844.348.939.246.2
FST [30]70.970.642.565.252.144.565.353.544.229.653.8
SFL [1]65.665.459.964.058.951.154.164.852.634.057.0
PDB [34]78.080.058.976.563.064.170.167.658.335.265.4
FSEG [12]81.763.872.374.968.468.069.460.462.762.268.4
MATNet [53]72.977.566.979.073.767.475.963.262.651.069.0
AGS [43]87.776.772.278.669.264.673.364.462.148.269.7
COSNet [26]81.175.771.377.666.569.876.867.467.746.870.5
AGNN [41]81.175.970.778.167.969.777.467.368.347.870.8
WCS [50]81.881.267.679.565.866.273.469.569.349.770.9
EGMN [25]86.175.768.682.465.970.577.172.263.847.871.4
Ours78.980.967.482.069.069.675.863.063.457.871.1
+ +Table 6. Overall comparison with the state-of-the-arts on Youtube-Objects dataset. We report the per-category performance and the average result of the 10 categories with $\mathcal{J}$ mean. + +tical flow maps generated by a more accurate network RAFT [36]. Compared to $AMC_{pwc}$ , $AMC_{raft}$ has an improvement of $0.3\%$ , $0.1\%$ in terms of the $\mathcal{J}$ mean and $\mathcal{F}$ mean, respectively. Furthermore, we implement several variants to use the optical flow maps in slightly inferior quality calculated by FlowNetS [4] and FlowNet2CS [10]. As shown in Table 4, all of the network variants produce competitive results, which demonstrates that our proposed model can benefit from optical flow of different quality and adaptively fuse multi-modality features. + +Effect of optical flow quality on co-attention scores. In order to qualitatively measure the effect of optical flow quality on co-attention scores, we calculate the average scores of appearance and motion features from $AMC_{pwc}$ and $AMC_{raft}$ . As shown in Figure 6 (a), we compute $g^{a} / g^{m}$ to evaluate the relative importance between ap + +Pearance and motion features. For both $AMC_{pwc}$ and $AMC_{raft}$ , the high-level ratios $g^{a} / g^{m}$ are significantly smaller than the low-level ones. The relative importance of optical flow maps gradually increases with the promotion of levels. More importantly, compared to $AMC_{pwc}$ , $AMC_{raft}$ gets lower ratios at low-level. In Figure 6 (b), we statistically demonstrate the curves of co-attention scores $g_{i}^{a}$ and $g_{i}^{m}$ . It can be seen that the high-level motion features contribute more effective guidance than low-level ones. This trend is just the opposite of the appearance features. Since $AMC_{raft}$ uses flow maps with more precise image boundary details, its gate values corresponding to low-level motion features significantly increase. It can be seen that AMC-Net can adaptively and fully combine the merits of appearance and motion features. + +![](images/2ea6e37b6588042589aa2038af86bbf591e7095c0e01b24a967d6a72c69126b9.jpg) + +![](images/03e543d49906e4f6bac19e386a602ed3f0a56bf58da9ab7d853cb5a6177c02ea.jpg) + +![](images/90399b4e80db1f9a1e9154e889c3e110211bb6ce466f46cb4a4b5fc3d7472c39.jpg) + +![](images/9845ca9bac7838b08e3e8411670299ac99d63fb35539dd471cd96bd8b12271e5.jpg) + +![](images/4c370d47fe1648c62292475bc0f34a1f2bf88b40fd7ede8e22c3eea4ff9bd674.jpg) + +![](images/3f0f09878c2e334f7b165293633d959dd2c31651ed388a13c20d7e81d9448ef8.jpg) + +![](images/c656ac07e0e5d92d1ff08e73d9203efbd78c4820f37fb68e9995a200c758704d.jpg) + +![](images/6ac72469eb205e9bf1b38a6a06ef7c91a682bd047cda8875cd2ac4285a87a7b2.jpg) + +![](images/cd55f94ccbc73c21edc7ad60dce245963e485b6b04465c49fb5cf6a60da7ce84.jpg) + +![](images/a188bd6080716ac082131b3cb51afacac1aa2f0dac6e127fbe9718d63cbf2a8f.jpg) + +![](images/ba027d2987d0ddf2a05e800908849a9344f898beeaa9a6ba1918b1f42191c353.jpg) + +![](images/f3b706ec4be3b8e1f47286b0929b573680e7d24a5abcf041383946994c82b385.jpg) + +![](images/ecbfe4f80fe0b0e6d4a1eceb15be09ea1eccab50a67fe4f781b687c3927b2e69.jpg) +Figure 7. Qualitative results on three video sequences from DAVIS-16. From top to bottom: motocross-jump, dance-twirl, horsejump-high. + +![](images/a697b0a4b26d11be327ee7b667e351e65983158fe851b950addb063b152e5656.jpg) + +![](images/3d3f3b768376989dfba3de8584db4bb3bee247bd9b333d8fb166deba297f7ab0.jpg) + +![](images/462cbbcd64b107ebf488cb0554f9ee2cdce867487ab767ace4172587c9c160e4.jpg) + +![](images/21fd6c5ddc2375ca72f15d772f03f6ad4bffac71c8912c0bc5e222e3a5ed2d38.jpg) + +![](images/ea53ab528af5858fcfb6afc8939740083f06473f4e1c6ec71e3312a759da0941.jpg) + +
MethodNLC [5]FST [30]SFL [1]ARP [14]
J mean ↑44.555.556.059.8
MethodMSTP [9]FSEG [12]IET [20]OBN [21]
J mean ↑60.868.471.973.9
MethodPDB [34]COSNet [26]MATNet [53]Ours
J mean ↑74.075.676.176.5
+ +Table 7. Overall comparison with the state-of-the-arts on FBMS. We use the mean region similarity $(\mathcal{I}$ mean) to measure the segmentation performance. + +# 4.3. Quantitative and Qualitative Results + +Evaluation on DAVIS-16. We compare the performance of our proposed method with the state-of-the-art methods. In Table 5, we list comparison results with ZVOS methods. We list the datasets widely used in existing methods, including DAVIS-16 [31], Youtube-VOS [46], and static segmentation datasets (DUT [47], MSRA10k [2], COCO [22], etc). Besides, we provide the indicator of post-processing (PP) in the existing methods. Compared with the existing ZVOS methods, our model outperforms the best performance 3DC-Seg [28] by $0.1\%$ on $\mathcal{J}\& \mathcal{F}$ . In addition, compared to our proposed method, 3DC-Seg uses pre-trained weights from much larger video datasets IG-65M [7] and Kinetics [15] (65.8M video clips), and further fine-tunes jointly on three datasets [22, 46, 31] to yield the best score. + +Evaluation on Youtube-objects. Table 6 illustrates the results of all compared methods for different categories. Our proposed method is comparable with recent ZVOS methods AGS [43], AGNN [41] and WCS [50] across all categories. Since memory mechanism can better handle static objects in video sequences, EGMN [25] achieves a higher $\mathcal{J}\&\mathcal{F}$ score $(0.3\%)$ on YTB-Objects. + +Evaluation on FBMS. Multiple target objects labeled in the video sequence share a similar appearance but have different motion patterns (moving or non-moving), which weakens the role of optical flow in the corresponding scene. In order to deal with the above problem, we design a variant by adding a separate FCN-like decoder that uses the gated appearance features from MCG. We train the entire network + +variant on DAVIS-16 and combine two decoder branches to produce the final results. Table 7 shows that our proposed method performs better than the state-of-the-art methods. + +Qualitative results. As shown in Figure 7, we illustrate the segmentation results of our proposed method on three video sequences. These three video sequences contain some tough challenges: Deformation, Scale-Variation, etc. The qualitative results show that our method can cope well with the tough challenges posed by the tricky motion conditions in the video sequences and generate precise segmentation masks with well-defined details. + +# 5. Conclusion + +In this paper, we propose an Attentive Multi-Modality Collaboration Network for ZVOS, which adopts a novel mechanism to achieve deep collaboration between appearance and motion. AMC-Net adaptively fuses robust information from multi-modality features and promotes their collaboration in two stages. We first adopt multi-level MCG to balance the contributions of multi-modality features at each stage and suppress redundant and misleading information, propagating valid spatio-temporal feature representations while minimizing interference. Then we adopt five stacked MCMs with a visual-motion attention mechanism to emphasize the features of foreground objects utilizing the spatio-temporal correspondence between appearance and motion cues. The experimental results on three benchmarks demonstrate that AMC-Net learns from fewer data and outperforms existing competitors. We yield a neat yet effective framework with a novel strategy for the interaction of motion and appearance information, which will generalize well to ZVOS in complex scenes. + +# Acknowledgments + +The paper is supported by the National Natural Science Foundation of China under Grant No.U1903215, No.61829102, No.61725202, and the Dalian Innovation leader's support Plan under Grant No.2018RD07. This research is also supported by Meituan. + +# References + +[1] Jingchun Cheng, Yi-Hsuan Tsai, Shengjin Wang, and Ming-Hsuan Yang. Segflow: Joint learning for video object segmentation and optical flow. In ICCV, pages 686-695, 2017. +[2] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, Philip HS Torr, and Shi-Min Hu. Global contrast based salient region detection. IEEE transactions on pattern analysis and machine intelligence, 37(3):569-582, 2014. +[3] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009. +[4] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In ICCV, pages 2758-2766, 2015. +[5] Alon Faktor and Michal Irani. Video segmentation by non-local consensus voting. In BMVC, page 8, 2014. +[6] Huazhu Fu, Dong Xu, Bao Zhang, and Stephen Lin. Object-based multiple foreground video co-segmentation. In CVPR, pages 3166-3173, 2014. +[7] Deepti Ghadiyaram, Du Tran, and Dhruv Mahajan. Large-scale weakly-supervised pre-training for video action recognition. In CVPR, pages 12046-12055, 2019. +[8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. +[9] Yuan-Ting Hu, Jia-Bin Huang, and Alexander G Schwing. Unsupervised video object segmentation using motion saliency-guided spatio-temporal propagation. In ECCV, pages 786-802, 2018. +[10] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, pages 2462-2470, 2017. +[11] Laurent Itti. Automatic foveation for video compression using a neurobiological model of visual attention. IEEE transactions on image processing, 13(10):1304-1318, 2004. +[12] Suyog Dutt Jain, Bo Xiong, and Kristen Grauman. Fusion-seg: Learning to combine motion and appearance for fully automatic segmentation of generic objects in videos. In CVPR, pages 2117-2126, 2017. +[13] Won-Dong Jang, Chulwoo Lee, and Chang-Su Kim. Primary object segmentation in videos via alternate convex optimization of foreground and background distributions. In CVPR, pages 696-704, 2016. +[14] Yeong Jun Koh and Chang-Su Kim. Primary object segmentation in videos based on region augmentation and reduction. In CVPR, pages 3442-3450, 2017. +[15] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. +[16] Margret Keuper, Bjoern Andres, and Thomas Brox. Motion trajectory segmentation via minimum cost multicuts. In ICCV, pages 3271-3279, 2015. + +[17] Philipp Krahenbuhl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge potentials. In Advances in neural information processing systems, pages 109-117, 2011. +[18] Yong Jae Lee, Jaechul Kim, and Kristen Grauman. Key-segments for video object segmentation. In ICCV, pages 1995-2002, 2011. +[19] Haofeng Li, Guanqi Chen, Guanbin Li, and Yizhou Yu. Motion guided attention for video salient object detection. In ICCV, pages 7274-7283, 2019. +[20] Siyang Li, Bryan Seybold, Alexey Vorobyov, Alireza Fathi, Qin Huang, and C-C Jay Kuo. Instance embedding transfer to unsupervised video object segmentation. In CVPR, pages 6526-6535, 2018. +[21] Siyang Li, Bryan Seybold, Alexey Vorobyov, Xuejing Lei, and C-C Jay Kuo. Unsupervised video object segmentation with motion-based bilateral networks. In ECCV, pages 207-223, 2018. +[22] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740-755, 2014. +[23] Tsung-Yu Lin, Aruni RoyChowdhury, and Subhransu Maji. Bilinear cnn models for fine-grained visual recognition. In ICCV, pages 1449-1457, 2015. +[24] Wei Liu, Andrew Rabinovich, and Alexander C Berg. Parsenet: Looking wider to see better. arXiv preprint arXiv:1506.04579, 2015. +[25] Xinkai Lu, Wenguan Wang, Martin Danelljan, Tianfei Zhou, Jianbing Shen, and Luc Van Gool. Video object segmentation with episodic graph memory networks. In ECCV, 2020. +[26] Xiankai Lu, Wenguan Wang, Chao Ma, Jianbing Shen, Ling Shao, and Fatih Porikli. See more, know more: Unsupervised video object segmentation with co-attention siamese networks. In CVPR, pages 3623–3632, 2019. +[27] Tianyang Ma and Longin Jan Latecki. Maximum weight cliques with mutex constraints for video object segmentation. In CVPR, pages 670-677, 2012. +[28] Sabarinath Mahadevan, Ali Athar, Aljoša Osep, Sebastian Hennen, Laura Leal-Taixe, and Bastian Leibe. Making a case for 3d convolutions for object segmentation in videos. In BMVC, 2020. +[29] Peter Ochs, Jitendra Malik, and Thomas Brox. Segmentation of moving objects by long term video analysis. IEEE transactions on pattern analysis and machine intelligence, 36(6):1187-1200, 2013. +[30] Anestis Papazoglou and Vittorio Ferrari. Fast object segmentation in unconstrained video. In ICCV, pages 1777-1784, 2013. +[31] Federico Perazzi, Jordi Pont-Tuset, Brian McWilliams, Luc Van Gool, Markus Gross, and Alexander Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In ICCV, pages 724-732, 2016. +[32] Federico Perazzi, Oliver Wang, Markus Gross, and Alexander Sorkine-Hornung. Fully connected object proposals for video segmentation. In ICCV, pages 3227-3234, 2015. + +[33] Alessandro Prest, Christian Leistner, Javier Civera, Cordelia Schmid, and Vittorio Ferrari. Learning object class detectors from weakly annotated video. In CVPR, pages 3282-3289, 2012. +[34] Hongmei Song, Wenguan Wang, Sanyuan Zhao, Jianbing Shen, and Kin-Man Lam. Pyramid dilated deeper convlstm for video salient object detection. In ECCV, pages 715-731, 2018. +[35] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In CVPR, pages 8934-8943, 2018. +[36] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In ECCV, pages 402-419, 2020. +[37] Pavel Tokmakov, Karteek Alahari, and Cordelia Schmid. Learning motion patterns in videos. In CVPR, pages 3386-3394, 2017. +[38] Pavel Tokmakov, Karteek Alahari, and Cordelia Schmid. Learning video object segmentation with visual memory. In ICCV, pages 4481-4490, 2017. +[39] Yi-Hsuan Tsai, Guangyu Zhong, and Ming-Hsuan Yang. Semantic co-segmentation in videos. In ECCV, pages 760-775, 2016. +[40] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008, 2017. +[41] Wenguan Wang, Xiankai Lu, Jianbing Shen, David J Crandall, and Ling Shao. Zero-shot video object segmentation via attentive graph neural networks. In ICCV, pages 9236-9245, 2019. +[42] Wenguan Wang, Jianbing Shen, and Fatih Porikli. Saliency-aware geodesic video object segmentation. In CVPR, pages 3395-3402, 2015. +[43] Wenguan Wang, Hongmei Song, Shuyang Zhao, Jianbing Shen, Sanyuan Zhao, Steven CH Hoi, and Haibin Ling. Learning unsupervised video object segmentation through visual attention. In CVPR, pages 3064-3074, 2019. +[44] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, pages 7794-7803, 2018. +[45] Hefeng Wu, Guanbin Li, and Xiaonan Luo. Weighted attentional blocks for probabilistic object tracking. The Visual Computer, 30(2):229-243, 2014. +[46] Ning Xu, Linjie Yang, Yuchen Fan, Jianchao Yang, Dingcheng Yue, Yuchen Liang, Brian Price, Scott Cohen, and Thomas Huang. Youtube-vos: Sequence-to-sequence video object segmentation. In ECCV, pages 585–601, 2018. +[47] Chuan Yang, Lihe Zhang, Huchuan Lu, Xiang Ruan, and Ming-Hsuan Yang. Saliency detection via graph-based manifold ranking. In CVPR, pages 3166-3173, 2013. +[48] Zhao Yang, Qiang Wang, Luca Bertinetto, Weiming Hu, Song Bai, and Philip HS Torr. Anchor diffusion for unsupervised video object segmentation. In ICCV, pages 931-940, 2019. +[49] Dong Zhang, Omar Javed, and Mubarak Shah. Video object segmentation through spatially accurate and temporally dense extraction of primary object regions. In CVPR, pages 628-635, 2013. + +[50] Lu Zhang, Jianming Zhang, Zhe Lin, Radomír Měch, Huchuan Lu, and You He. Unsupervised video object segmentation with joint hotspot tracking. In ECCV, 2020. +[51] Rui Zhao, Wanli Ouyang, and Xiaogang Wang. Unsupervised salience learning for person re-identification. In CVPR, pages 3586-3593, 2013. +[52] Mingmin Zhen, Shiwei Li, Lei Zhou, Jiaxiang Shang, Haoan Feng, Tian Fang, and Long Quan. Learning discriminative feature with crf for unsupervised video object segmentation. ECCV, 2020. +[53] Tianfei Zhou, Jianwu Li, Shunzhou Wang, Ran Tao, and Jianbing Shen. Matnet: Motion-attentive transition network for zero-shot video object segmentation. IEEE Transactions on Image Processing, 29:8326-8338, 2020. \ No newline at end of file diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/images.zip b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..94dfc795b660d5fac6839dd35067a36bb8ebc9d5 --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ab413be590d97f34792595da6130fae51c563b4d826ec821f641842168e1a8e +size 730460 diff --git a/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/layout.json b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..299cb968a187ec8a15447549bc0beced2be10405 --- /dev/null +++ b/learningmotionappearancecoattentionforzeroshotvideoobjectsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7c5ec9c7f708e7d472957c18106b62c495a0b2c4298c87a38a52d500cdc152b +size 441434 diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_content_list.json b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..821f3332ccdee9e9f900c3aedec45403c642d133 --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb7abe7fa16c2591171df6d12757a29663076dba2fe5aee9b8d12eb8186420a0 +size 89580 diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_model.json b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e335691db4a368d743b249787b500adfcbe1dd2c --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ad4008d98a43d73e7c52fe03f572d9c4576476de36a01c77101a0a6f8483f6 +size 111971 diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_origin.pdf b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5e538c24cb058f341567f555354bf0d247169400 --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/074e3bf1-1448-4769-a57e-7613606f3790_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:320ce8b5021abb6a67e1c1a94701660e57f3830409b70658173a89b9d78f9fe4 +size 1909296 diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/full.md b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0779580e74395a948934bac75e6f5293433670e7 --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/full.md @@ -0,0 +1,377 @@ +# Learning Motion Priors for 4D Human Body Capture in 3D Scenes + +Siwei Zhang1 Yan Zhang1 Federica Bogo2 Marc Pollefeys1,2 Siyu Tang1 +1ETH Zürich 2Microsoft + +{siwei.zhang, yan.zhang, marc.pollefeys, siyu.tang}@inf.ethz.ch febogo@microsoft.com + +![](images/ca325bafc73fd9c0d11c273c0c0fe1f0f2c75f3f747b53e9fb9bf9336347b75e.jpg) +Figure 1: By leveraging data-driven motion priors learned from the large-scale mocap dataset AMASS [38], we reconstruct high-quality human motions in complex 3D scenes from monocular RGB(D) input. Our proposed method (second row) robustly deals with occlusions and achieves more accurate motion reconstructions compared with PROX [19] (first row). + +![](images/69038d41ce3224f05a093f9172ef6aeceb87ce524a6584b833588496d537fd35.jpg) + +# Abstract + +Recovering high-quality 3D human motion in complex scenes from monocular videos is important for many applications, ranging from AR/VR to robotics. However, capturing realistic human-scene interactions, while dealing with occlusions and partial views, is challenging; current approaches are still far from achieving compelling results. We address this problem by proposing LEMO: LEarning human MOtion priors for 4D human body capture. By leveraging the large-scale motion capture dataset AMASS [38], we introduce a novel motion smoothness prior, which strongly reduces the jitters exhibited by poses recovered over a sequence. Furthermore, to handle contacts and occlusions occurring frequently in body-scene interactions, we design a contact friction term and a contact-aware motion infiller obtained via per-instance self-supervised training. To prove the effectiveness of the proposed motion priors, we combine them into a novel pipeline for 4D human body capture in 3D scenes. With our pipeline, we demonstrate high-quality 4D human body capture, reconstructing smooth motions and physically plausible body-scene interactions. The code and data are available at https://sanweiliti.github.io/LEMO/LEMO.html. + +# 1. Introduction + +Recovering realistic human motions in everyday 3D scenes is essential for human behaviour understanding, human-scene interaction synthesis, and virtual avatar creation. Marker-based optical motion capture systems (mocap) have the proven capability of recovering highly accurate human motions. However, such systems require expert knowledge and expensive setup, making it impractical to capture people in their everyday environments, e.g. recording people in their living rooms, offices or kitchens. + +Recently, PROX [19] has been proposed as a lightweight pipeline to capture everyday person-scene interactions from monocular sequences given pre-scanned 3D scene geometries. With affordable commodity sensors like an RGB or RGBD camera, it is quite easy to scan a scene and record how humans move in and interact with it. This shows a promising setup for capturing large-scale human motions in everyday environments. However, as shown in this work1, the recovered human motions exhibit severe skating and jitters. The reconstruction quality is far behind that obtained with commercial mocap systems. Building a multi-view setup or using additional wearable sensors (e.g. Inertial Measurement Unit (IMUs)) can help improve motion reconstruction quality. However, most multi-view settings + +require careful calibration and synchronization in a controlled environment and IMUs suffer from heading drift and interference. Furthermore, human motions obtained by IMUs [60] or multi-view setups [23] still exhibit jitters and are less compelling than the ones from mocap systems. + +To improve the naturalness and accuracy of human motions reconstructed from monocular RGBD sequences (e.g. the PROX pipeline [19]) and to close the performance gap between the monocular RGBD setup and marker-based mocap systems, we argue that it is essential to leverage data-driven approaches and learn powerful motion priors from high-quality large-scale mocap data (e.g. AMASS [38]). To this end, we propose LEMO (LEarning human MOtion priors), which has two key innovations: a marker-based motion smoothness prior and a contact-aware motion infiller which is fine-tuned per-instance in a self-supervised fashion. As shown in the experiments, LEMO can effectively capture the intrinsic properties of human motions and regularize the noisy and partial observations. As a result, the reconstructed human motions are smooth, physically plausible and robust to occlusions which are inevitable when capturing human motions in everyday 3D scenes. + +Marker-based motion smoothness prior. 3D human bodies reconstructed by PROX [19] have severe jitters over time. Although some heuristic methods like penalizing joint velocity/acceleration can improve temporal smoothness, they also degrade the motion naturalness. As shown in our experiments, they can introduce foot-ground skating artifacts, and may result in invalid body configurations like joint hyperextension. To capture the holistic full-body dynamics, we use a fully convolutional autoencoder to aggregate local motion cues in a bottom-up manner, and derive latent motion patterns that cover a large spatio-temporal receptive field. Then, we design a motion smoothness constraint which works in this latent space rather than directly on the body. To incorporate body shape information and model important degrees-of-freedom (DoFs), e.g. rotation about limb axes, as in [71] we represent the body in each frame by surface markers instead of body joints. We learn this convolutional motion smoothness prior on the AMASS [38] dataset. As shown in our experiments, the proposed prior not only significantly increases the reconstruction quality on the PROX dataset, but also improves the motion naturalness on the IMU-based 3DPW dataset [60], suggesting its effectiveness and potential usage for other motion capture and reconstruction settings. + +Contact-aware motion infiller via per-instance self-supervised learning. When capturing humans moving in and interacting with everyday 3D environments (e.g. living rooms or offices), partial body occlusions are almost inevitable. They pose a challenge for reconstruction algorithms, causing invalid poses and foot-ground skating artifacts. By leveraging AMASS [38], we learn a neural mo + +tion infiller that is able to infer plausible motions of occluded body parts given partial observations. Our network is inspired by [28], but goes beyond the previous work to jointly predict the foot contact status and body motion. Combined with a contact friction term motivated by intuitive physics, the infilled motion is natural, realistic and has proper foot-ground interaction, eliminating the foot skating artifacts. Furthermore, inspired by [24], we propose a per-instance network fine-tuning scheme. For a test instance which contains partial observations (e.g. only the upper body motion as the lower body parts are occluded by the sofa in a 3D scene), we fine-tune the pre-trained motion infilling network by minimizing a self-supervised loss that is defined on the visible body parts. In this way, we effectively adapt the general motion infilling "prior" to per-test-instance, achieving notable improvements both for AMASS [38] and PROX [19]. + +We further carefully combine the learned motion priors and the contact friction term into a novel multi-stage optimization pipeline for 4D human body capture in 3D scenes. + +Contributions. In summary, our contributions are 1) a novel marker-based motion smoothness prior that encodes the "whole-body" motion in a learned latent space, which can be easily plugged into an optimization pipeline; 2) a novel contact-aware motion infiller that can be adapted to per-test-instance via self-supervised learning; 3) a new optimization pipeline that explores both learned motion priors and the physics-inspired contact friction term for scene-aware human motion capture. We extensively evaluate the proposed priors and the optimization pipeline. The results show both the wide applicability of the learned motion priors and the efficacy of the optimization pipeline for monocular RGBD human motion capture in 3D scenes. + +# 2. Related Work + +Human motion recovery from RGB(D) sequences. Human motion recovery extends the problem of reconstructing per-frame body 3D shape and pose [2, 5, 16, 17, 19, 26, 32, 42, 44, 53, 56, 58, 66] to sequences of frames, requiring temporal consistency between estimates. A number of works tackle the problem adopting skeleton/joint-based representations for the body [7, 8, 11, 13, 14, 29, 35, 39-41, 45, 46, 54, 63, 65, 70, 73]. Working with 3D joints instead of surfaces, these representations cannot adequately model the 3D shape of the body and body-scene interactions. Other works propose to use parametric 3D human models (e.g. SMPL [36]) to obtain complete 3D body meshes from multi-view [12, 15, 22, 25, 50, 64] or monocular RGB(D) sequences [10, 27, 31, 34, 37, 55, 67]. Kanazawa et al. [27] learn a temporal context representation to predict motion in past and future frames. Kocabas et al. [31] use a bi-directional gated recurrent unit (GRU) + +to temporally encode per-frame image features, and couple it with an adversarial discriminator to distinguish between real and predicted motions. Choi et al. [10] propose to better integrate past and future frames' temporal information to increase temporal consistency. Sun et al. [55] introduce a multi-level framework to decouple body skeleton and more detailed shape and pose information. Luo et al. [37] propose a two-step encoding scheme, which first captures the coarse overall motion by a pretrained motion representation, and then refines these estimates. Nevertheless, these methods focus only on human body motion reconstruction, ignoring person-scene interactions. + +Person-scene interaction. Hasler et al. [18] obtain scene constraints for body pose estimation by reconstructing the scene in 3D with multiple unsynchronized moving cameras. Some works rely on physics-inspired error terms (e.g. contact and collision terms [68]), game physic engines [61], and scene semantic labels [51]. Related to us, PROX [19] captures person-scene interactions at a very detailed level, modelling contacts and collisions between SMPL-X body [44] and 3D scenes. Based on such contact and collision modelling, Zhang et al. [69, 72] generate human body meshes in scenes without people in a physically and semantically plausible manner. + +Human motion priors. A large number of priors for smooth and natural motion have been proposed in the literature [3, 4, 22, 41, 43, 47, 48, 52, 59]. Some priors directly apply to body joint velocity or acceleration [4, 41]. Akhter et al. [3] propose a bilinear model with discrete cosine transform (DCT) basis to provide motion spatio-temporal regularity. Along this line, Huang et al. [22] introduce a DCT prior to reconstruct body motion from multi-view input. Some recent work exploits physical simulation to regularize human motion. Shimada et al. [52] assume a pre-defined virtual character as input, and fit it to monocular sequences via physics-based optimization. Rempe et al. [47] regress body joints and foot-ground contact from images to conduct physics-based trajectory optimization. Kaufmann et al. [28] design a convolutional autoencoder to infill motion of unobserved body joints and remove noise. + +Ours versus others. In our work we design a motion smoothness prior and a motion infiller, and use them to recover realistic motions of person-scene interactions from RGB(D) videos. Compared to existing smoothness priors, ours is trained with high-quality AMASS sequences and the smoothness regularization is applied in the latent space. Consequently, we can produce smooth motions without degrading per-frame body pose accuracy. Our motion infiller has a similar architecture to Kaufmann et al. [28], but processes body markers and predicts foot-ground contact states. Since body markers better constrain body DoFs, and the contact states are jointly learned with body motions, our method consistently outperforms [28] w.r.t. motion re + +covery and foot skating (as shown in Sec. 4). Compared with [47, 52] which predict contact states by 2D joints detected from RGB images, our jointly learned contact states are better coupled with body dynamics. + +# 3. Method + +# 3.1. Overview + +We provide an overview of our approach in Fig. 2. Given a sequence of RGB-D frames $\{I_t, D_t\}_{t=1}^T$ , capturing a subject moving in a 3D scene, our goal is to reconstruct a high-quality motion, which is smooth, physically plausible, and natural. To this end, we fit the SMPL-X parametric body model to sequence data by proceeding in three stages. + +SMPL-X. SMPL-X [44] represents the body as a function $\mathcal{M}_b(\gamma, \beta, \theta, \phi)$ , whose output is a triangle mesh with vertices $V_b \in \mathbb{R}^{10475 \times 3}$ . SMPL-X parameters are global translation $\gamma \in \mathbb{R}^3$ , body shape $\beta \in \mathbb{R}^{10}$ , body and hand pose $\theta$ , and facial expression $\phi \in \mathbb{R}^{10}$ . We denote by $J(\beta)$ the 3D body skeleton joints in the neutral pose, and by $R_{\theta \gamma}(J(\beta)_i)$ the $i$ -th joint posed according to pose $\theta$ and translation $\gamma$ . + +Multi-stage pipeline. Given the complexity of our task, we address it in a multi-stage fashion, as done in previous work [6, 52]. In Stage 1, we fit SMPL-X parameters to each RGB-D frame independently. This gives us a reasonable initialization, but does not ensure motion smoothness, nor deals with body-scene occlusions. We achieve temporally consistent motions in Stage 2 by introducing our smoothness prior and contact-friction term. Finally, in Stage 3 we recover plausible motions even for occluded body parts and alleviate foot skating with our motion infiller. + +# 3.2. Per-frame Fitting + +Stage 1 adopts the approach proposed in PROX [19]. Given a RGB-D sequence, PROX fits SMPL-X to each frame separately by minimizing the objective function: + +$$ +\begin{array}{l} E _ {P R O X} (\boldsymbol {\gamma}, \boldsymbol {\beta}, \boldsymbol {\theta}, \boldsymbol {\phi}) = E _ {J} + \lambda_ {D} E _ {D} + E _ {p r i o r} \tag {1} \\ + \lambda_ {c o n t a c t} E _ {c o n t a c t} + \lambda_ {c o l l} E _ {c o l l}. \\ \end{array} +$$ + +$E_{J}$ penalizes the distance between the 2D joints estimated from the RGB image with OpenPose [9], and the 2D projection of SMPL-X joints onto the image. $E_{D}$ penalizes the 3D distance between the human point cloud obtained from the depth frame and SMPL-X surface points visible from the camera. $E_{prior}$ combines a set of priors regularizing body pose, shape and facial expression [44]. $E_{contact}$ encourages contact between scene vertices and a pre-defined set of body "contact" vertices. $E_{coll}$ penalizes scene-body interpenetration. For more details, we refer the reader to [19]. + +# 3.3. Temporally Smooth Motion + +In Stage 2, we process the output of Stage 1. In order to obtain smooth and realistic motion, we design a mo + +![](images/ded87e520813d158409050d8f1e53b9b2e00f4c966674ac25e4f064feada0e1e.jpg) + +![](images/59abb039c6637955b8117cc50c0b80bb3501f94cde2632fc2784daf7c46e1fc5.jpg) + +![](images/520243aec6f3d1b1cbf3bac992f8c9842d3b68bb16e58a9eaeda3df8237b234c.jpg) + +![](images/36dffbd0b6d08a24ff8585aedcca68fc57dabfdec92cff42e444b6888a83b4e0.jpg) +Figure 2: Illustration of our multi-stage pipeline. Provided a scene mesh and an RGBD sequence with body occlusion, our method recovers a realistic global motion, with natural person-scene interactions. The markers trajectories (left) and accelerations (right) of each stage are shown at the bottom, as well as a walking sequence from AMASS [38] (pink). Note that the results from Stage 1 show large and unrealistic motion accelerations (blue). The recovered motion (green) in Stage 2 is significantly smoother. However, it also loses the realistic accelerations (peaks in the acceleration plot) that can happen when the body interacts with the scene (e.g. foot-to-ground contact during walking). Our recovered motion from Stage 3 (orange) is similar to the high-quality AMASS motion w.r.t. both the trajectory smoothness and the acceleration patterns. + +![](images/ea352784ee585e889621396b5934c37d675d9c27b1797f7044b26895c949c09b.jpg) + +![](images/7482ff6b45c33cb8068a62a0c38d65c7585c92b65686c24b30e685fdc76aa73b.jpg) + +![](images/68db1b3eaebfe3dedd7b5a060312e9f2d18096db7b11503f9520dedba55d3eae.jpg) + +![](images/2212f2e5d5afd797ba91de3a47d4d9f50ac257c0662ccf3441df2f3457417ff1.jpg) + +![](images/5c8eebc18fad9aa938bccf7ff852e3d7ac6df520fb0ccbcabe48479e615dae99.jpg) + +![](images/04ec5f16bab1ed5cb9f6fc624a8221b3b38f8c48a902d3d21cb9a94add82016d.jpg) + +![](images/3d2262e9f8e01ea4ff42eea85e4f7dc09ac1e4836eeffd25b8e2914153fed1fe.jpg) + +tion smoothness prior and a physics-inspired friction term, which are then used in an optimization algorithm. + +Motion smoothness prior. Instead of enforcing smoothness explicitly on body joints as in [4, 41, 52], we propose to learn a latent space of smooth motion. To this end, we train an autoencoder with high-quality data from AMASS [38]. + +The input to our network is a sparse set of body surface markers, as in [38, 71]. We represent the body with the locations of 81 markers (see marker placement in Supp. Mat.). Given a sequence of $T$ frames, at each time $t$ we compute the time difference of marker locations and concatenate them to a vector of length $S$ . Then the entire sequence is represented by a 2D feature map $X_{\Delta} \in \mathbb{R}^{S \times (T - 1)}$ . The network encoder $F_{s}$ converts $X_{\Delta}$ to its latent representation $Z$ . Here we regard the time series $X_{\Delta}$ as an image and perform 2D convolutions as in [28]. We do not downsample the input, so $X_{\Delta}$ and $Z$ have identical temporal resolution. Therefore, the network captures spatio-temporal correlations with a large receptive field in the latent space, which can represent motion of overlapped body parts. The decoder $D_{s}$ has a symmetric architecture with deconvolution layers. More details can be found in the Supp. Mat.. + +We train our autoencoder on the AMASS dataset with the following loss: + +$$ +\mathcal {L} _ {s} \left(F _ {s}, D _ {s}\right) = \left| X _ {\Delta} - X _ {\Delta} ^ {r e c} \right| + \alpha_ {s} \frac {1}{S (T - 2)} \sum_ {t = 1} ^ {T - 2} \left| z _ {t + 1} - z _ {t} \right| ^ {2}, \tag {2} +$$ + +where the first term is the reconstruction loss minimizing discrepancy between $X_{\Delta}$ and $X_{\Delta}^{rec} = D_s(F_s(X_{\Delta}))$ , and the second term minimizes the 1st order derivative of the + +latent sequence $Z = F_{s}(X_{\Delta}) = [z_{1},z_{2},\dots,z_{T - 1}]$ . $\alpha_{s}$ weights the contribution of the second term. + +With a pretrained autoencoder, we design a smoothness loss to regularize motions over time. Specifically, we take the per-frame bodies obtained from Stage 1, and concatenate their markers into a velocity map $X_{\Delta}^{opt}$ . We feed this map into $F_{s}$ , encoding it into $Z^{opt} = F_{s}(X_{\Delta}^{opt}) = [z_{1}^{opt}, z_{2}^{opt}, \dots, z_{T-1}^{opt}]$ . The smoothness loss is given by + +$$ +E _ {s m o o t h} (\boldsymbol {\gamma}, \boldsymbol {\theta}, \phi) = \frac {1}{S (T - 2)} \sum_ {t = 1} ^ {T - 2} \left| \boldsymbol {z} _ {t + 1} ^ {o p t} - \boldsymbol {z} _ {t} ^ {o p t} \right| ^ {2}. \tag {3} +$$ + +Compared to the methods working in joint space locally, our prior can better capture longer-range correlations between the motion of different body parts, hence encoding full-body dynamics. + +Contact friction modelling. The contact term used in Eq. 1 only considers body-scene proximity, and hence cannot prevent skating artifacts (e.g. a person slides when sitting on a chair). To overcome this issue, we design a contact term that incorporates stationary frictions. Compared to methods which work with foot joints [47, 52], our contact friction term is based on the body and scene mesh, with a more generic human-scene interaction setting, and considers also other body parts such as gluteus. + +Specifically, we pre-define a set of "contact friction" vertices $V_{c} \subset V_{b}$ , corresponding to 194 foot and 113 gluteus vertices. When contact occurs (i.e. the distance between a body vertex to the scene mesh is smaller than $0.01\mathrm{m}$ ), the velocity $\mathbf{v}_{t}$ of the contacted vertex in $V_{c}$ is regularized: the component $\mathbf{v}_{t}$ along the scene normal $\mathbf{n}$ should be non + +Algorithm 1: smooth motion recovery in Stage 2. +Result: Smooth motion w.r.t. SMPL-X body parameters +Init: Fitted meshes from Stage 1, scene mesh, smoothness prior $F_{s}(\cdot)$ ; +for $i = 1:N$ do +\[ +Z^{opt} = F_{s}(X_{\Delta}^{opt}); +compute E_{smooth} with Eq. (3); +compute E_{fric} with Eq. (5); +minimize E_{PROX_M} + E_{smooth} + E_{fric} +end + +![](images/1d4d83ace7621c9f1f49763a97f7ce578a62671a279924bd7f39389a86ffa1ae.jpg) +Figure 3: Illustration of our motion infilling network. The blue and green color denote the marker local coordinate and the foot-ground contact state, respectively. Yellow, gray and orange color represent the root translational velocity $[t_1, t_2]$ and rotational velocity $\gamma$ , respectively. Note that masking is only applied to the local motion. The motion infiller takes global motion as input, and predicts local motion. + +negative to prevent interpenetration, and the component tangential to the scene, $\boldsymbol{v}_t^{tan}$ , should be small to prevent sliding. Formally, this gives us: + +$$ +\boldsymbol {v} _ {t} \cdot \boldsymbol {n} \geq 0, \quad | \boldsymbol {v} _ {t} ^ {\text {t a n}} | \leq \sigma \quad \text {f o r} \quad t \in T _ {f}, \tag {4} +$$ + +where $T_{f}$ is the set of frames in which vertex and scene are in contact, and $\sigma$ is a small number as a threshold. Based on this, we formulate our contact friction term as: + +$$ +E _ {f r i c} (\boldsymbol {\gamma}, \boldsymbol {\theta}, \phi) = \sum_ {t \in T _ {f}} \left(\sum_ {\boldsymbol {v} _ {t} \cdot \boldsymbol {n} < 0} | \boldsymbol {v} _ {t} \cdot \boldsymbol {n} | + \sum_ {| \boldsymbol {v} _ {t} ^ {t a n} | \geq \sigma} | | \boldsymbol {v} _ {t} ^ {t a n} | - \sigma |\right). \tag {5} +$$ + +Stage 2 fitting. We combine $E_{smooth}$ and $E_{fric}$ with the error terms in Eq. 1, from which we remove $E_{contact}$ and $E_{D}$ to obtain a modified function $E_{PROX_M}$ . We optimize the resulting objective for $N$ iterations as shown in Alg. 1. + +# 3.4. Recovering Motion under Occlusion + +Although Alg. 1 produces smooth motions, it cannot recover realistic body motion under occlusion, which frequently happens in person-scene interactions. Therefore, we design a motion infilling network, train it on AMASS, and exploit it as a prior in an optimization algorithm. + +Motion infilling network. Figure 3 shows an overview of our convolutional infilling network. Unlike other motion infilling models e.g. [28], our infiller takes body surface markers as input, and infers motions and contact states jointly. + +Here we represent markers in a local coordinate system as in [21, 28]: for each frame $t$ , marker locations are relative to the position of the body root, which is the pelvis projected to the ground. In addition, the body global configuration is represented by the root's translational velocity $\pmb{t} \in \mathbb{R}^2$ and rotational velocity $\gamma \in \mathbb{R}$ around the up-axis. Moreover, we select two markers per foot and check whether they contact with the ground at each frame. The marker is deemed in contact with the ground if its velocity is smaller than $20\mathrm{cm/s}$ and its height above the ground is lower than $10\mathrm{cm}$ . Finally, we arrange the motion sequence into a 3D tensor $Y \in \mathbb{R}^{P \times T \times 4}$ with 4 channels. In the first channel $Y_{local}$ , each column denotes a vector concatenating local body marker positions and contact labels of this frame, and $P$ is the vector dimension. The last three channels $Y_{root}$ consist of the repeated entries of global trajectory velocities $t_1$ , $t_2$ and $\gamma$ respectively, which allows us to couple global and local motion more closely than [21, 28]. + +During training, we set a spatio-temporal visibility mask $M \in \{0,1\}^{P \times T}$ (1 denotes visible, and 0 otherwise) to corrupt the local motion with $\tilde{Y}_{local} = Y_{local} \odot M$ , where $\odot$ denotes element-wise matrix multiplication. Since most (upper) body parts are often visible in practice and it is easy to estimate the root's motion, we assume the global trajectory is given, and only mask local pose. To generate plausible occlusion masks for training on AMASS, we sample masks computed from the PROX dataset [19], where we leverage depth to reason about occlusions. Note that contact labels are masked whenever feet are not visible. With the masked motion $\tilde{Y} = [\tilde{Y}_{local}, Y_{root}]$ , we train the infiller autoencoder $G$ to reconstruct the full local motion by minimizing: + +$$ +\mathcal {L} _ {\text {i n f i l l}} (G) = h \left(G (\tilde {Y}), Y _ {\text {l o c a l}}\right), \tag {6} +$$ + +where $h(\cdot)$ is the L1 loss for local marker coordinates, and the binary cross entropy (BCE) loss for the contact labels. + +Per-instance self-supervised learning. To better leverage visible body parts during testing, we fine-tune the pretrained motion infiller on each individual test motion sequence to adapt the learned general prior to per-instance. Unlike [24], our fine-tuning procedure is self-supervised. Specifically, given a partially occluded test sequence $Y$ , and occluded markers described by mask $M$ , we fine-tune the network parameters by exploiting the visible markers in the sequence via minimizing + +$$ +\mathcal {L} _ {\text {f i n e t u n e}} (G) = h \left(G (\tilde {Y}), Y _ {\text {l o c a l}}\right) \odot M. \tag {7} +$$ + +We show in Sec. 4 that this per-instance self-supervised learning effectively increases prediction accuracy for both visible and invisible body parts. + +Stage 3 fitting (Alg. 2). Given results from Stage 2, we combine the global configurations and local markers produced by the fine-tuned infiller, and reconstruct marker + +Algorithm 2: occluded motion recovery in Stage 3. +Result: Infilled motion in the presence of occlusions +Init: Results from Stage 2, scene mesh, smoothness prior $F_{s}(\cdot)$ , motion infiller $G(\cdot)$ ; +Step 1: fine-tune $G(\cdot)$ according to Eq. (7); +Step 2: compute $\hat{X}, \hat{C}$ from $G(\cdot)$ ; +Step 3: the optimization loop; +for $i = 1:N$ do + $Z^{opt} = F_{s}(X_{\Delta}^{opt})$ ; + compute $E_{smooth}$ with Eq. (3); + compute $E_{fric}$ with Eq. (5); + compute $E_{infill}$ with Eq. (8); + minimize $E_{PROX_{M}} + E_{smooth} + E_{fric} + E_{infill}$ +end + +global locations $\hat{X}$ and foot contact labels $\hat{C}$ . We define an error term as + +$$ +\begin{array}{l} E _ {i n f i l l} (\boldsymbol {\gamma}, \boldsymbol {\theta}, \phi) = | \hat {X} - X ^ {o p t} | \odot (1 - M _ {b}) \\ + \sum_ {t = 1} ^ {T} \sum_ {k \in K} \hat {c} _ {k} ^ {t} \cdot d \left(v _ {k} ^ {t}, a\right), \tag {8} \\ \end{array} +$$ + +where $X^{opt}$ is the marker global location from the SMPL-X body to optimize, $M_{b}$ is the occlusion mask for the body, and $K$ is the set of foot vertices. For foot vertex $k$ , $\hat{c}_k^t = 1$ if its nearest foot marker contact label is 1, 0 otherwise, and $v_k^t$ is the absolute magnitude of velocity at frame $t$ . $d(v_k^t, a)$ corresponds to $|v_k^t - a|$ if $v_k^t \geq a$ , 0 otherwise. We set the foot velocity threshold $a$ as $10\mathrm{cm / s}$ . + +# 4. Experiments + +# 4.1. Datasets + +AMASS [38]. AMASS collects 15 high-quality mocap datasets, with 11263 motions from 344 subjects. For each sequence, AMASS provides per-frame SMPL-H [49] parameters obtained via $\mathrm{MoSh}++$ (i.e. fitting SMPL-H to mocap markers). We downsample the sequences to 30fps, and trim them to clips of 120 frames for training. Similar to [71], for each clip we reset the world coordinate to the pelvis joint in the first frame. The $x$ -axis is the horizontal component of the direction from the left hip to right hip, the $y$ -axis points forward, and the $z$ -axis points upward. We exclude TCD_handMocap, TotalCapture, SFU, SSM_SYNC, KIT and EKUT, and use the rest to train our motion smoothness and infilling models. We exclude TCD_handMocap, TotalCapture, SFU from training since we use them to evaluate our motion infilling method. We do not use EKUT, KIT and SSM_SYNC due to their inconsistent frame rate. + +PROX [19]. We use this dataset to test our models and optimization algorithms in Stage 2 and Stage 3. PROX collects monocular RGB-D sequences from 20 subjects moving in and interacting with 12 different indoor scenes. A + +Kinect-One sensor [1] is employed to capture the sequences at 30fps, and the 3D reconstructions of the static scenes are provided. SMPL-X parameters are fitted to RGB-D data in each frame (see Sec. 3.2) to reconstruct 3D bodies. Following the same pre-processing procedure for AMASS, we trim the sequences, reset the pelvis coordinate, and obtain 205 clips of 100 frames each for evaluation. + +3DPW [60]. As with PROX, we use this dataset for evaluation. 3DPW fits SMPL to IMUs and RGB videos, mostly captured in in-the-wild scenario. Although the provided per-frame SMPL fits are accurate, the motion across frames has jitters and temporal discontinuities. As above, we preprocess the motion sequences and obtain 300 clips of 100 frames for evaluation. Since sequences are captured with a moving camera, global SMPL body configurations are not reconstructed accurately. Hence, for 3DPW we test our priors applying them only on local motions. Namely, the body pelvis joints in different frames are aligned, and joint positions are defined with respect to the local coordinate system of each individual frame. + +# 4.2. Evaluation of Motion Smoothness Prior + +We compare our motion smoothness prior (denoted by 'Ours-SP') against three optimization-based baselines: the DCT-based prior from [22]; minimizing velocity magnitude (L2-V) [4, 33, 57, 73]; minimizing acceleration magnitude (L2-A) [33, 41, 52]. For all methods, we combine them with $E_{J}$ , $E_{prior}$ in Eq. 1 and minimize the resulting objective function to fit SMPL-X to data. Specifically, the objective function of Ours-SP consists of $E_{J}$ , $E_{prior}$ and $E_{smooth}$ in Eq. 3. We evaluate the fits on both PROX and 3DPW. + +# 4.2.1 Metrics + +2D joint accuracy. This metric is only used for PROX. We manually annotate 2D body joints on 542 frames via Amazon Mechanical Turk (AMT). The AMT annotations are in the OpenPose [9] coco-25 format (including 25 body joints), and are converted to the SMPL-X body joint format for evaluation. Following [44], the neck, left and right hip joints are excluded from evaluation due to their definition ambiguity. We report the average L2 norm of 2D joint errors (2DJE) between our results and annotations. + +3D accuracy. This metric is only used for 3DPW. Following [60], we report the mean per joint position error (MPJPE) and per vertex error (PVE) with aligned body pelvis between our estimated motions and the ones provided by 3DPW. We expect that an effective motion smooth prior can improve motion temporal consistency while preserving the original body configuration quality. Therefore, the lower these two scores are, the better. However, for an exhaustive evaluation, 3D accuracy should be combined with a metric assessing motion smoothness. + +Motion smoothness. Ideally, recovered motions should resemble real ones as much as possible. Translating this into a metric, we use the Power Spectrum KL divergence (PSKL) [20] to measure the distribution distance between our results and AMASS motion sequences. Specifically, we evaluate PSKL w.r.t. the acceleration distribution for both body markers and SMPL-X joints on PROX, and for SMPL joints on 3DPW. Since PSKL is not a symmetric measure, we report the numbers for both directions. Smaller values of PSKL indicate better performance (see Supp. Mat. for more details). + +Human-scene interpenetration. We assess the degree of human-scene interpenetration on PROX by using the non-collision score adopted in [69, 72]. It measures the ratio between the number of body vertices with non-negative scene SDF values, and the total number of body vertices, i.e., the ratio of body vertices that do not interpenetrate with the scene mesh. We report the average non-collision scores over all frames, and denote it as 'NonColl'. A higher value indicates fewer human-scene interpenetration. + +# 4.2.2 Results + +Tab. 1 and Tab. 2 show the results of motion smoothness evaluation on PROX and 3DPW, respectively. For both datasets, the originally provided motions have the largest PSKL score measured w.r.t AMASS, indicating that motions are not natural. Compared to all baselines, our method achieves the lowest PSKL scores in both directions, suggesting that it produces more natural motions. On PROX, all methods achieve comparable non-collision scores. Our method achieves a lower 2D pose error compared to the original PROX data and baseline methods. On 3DPW, our method has small MPJPE/PVE while reporting the best PSKL scores. These results demonstrate that our method can generalize well over different datasets for both global motions and local motions. + +Overall, our method consistently outperforms other baselines, by significantly improving motion naturalness while preserving per-frame pose accuracy. This is due to the fact that we learn our smoothness prior from the rich and diverse AMASS data, and apply regularization in latent space. In contrast, baseline methods only encourage motion smoothness of disjoint local body parts, and hence have larger gaps to high-quality AMASS motions. Fig. 4 shows examples of latent sequences obtained from PROX sequences. After fitting using our prior, latent sequences become smoother along the time axis and jitters are removed. + +# 4.3. Evaluation of Motion Infilling Prior + +We compare our proposed motion infilling prior (denoted by 'Ours-IP') with the infiller from Kaufmann et al. [28] on AMASS. On top of these networks, we addition + +Table 1: Evaluation of motion smoothness and infilling priors on PROX. PSKL-M and PSKL-J denote PSKL computed on markers and joints, respectively. (P, A) denotes PSKL(PROX, AMASS), and (A, P) the reverse direction. For each metric, the best result is in boldface. + +
Methods2DJE ↓PSKL-M ↓PSKL-J ↓NonColl ↑
(P,A)(A,P)(P,A)(A,P)
PROX [19]20.941.4392.4411.4642.4910.955
DCT [22]20.960.8471.0830.9371.1690.955
L2-A21.680.4290.3960.4810.4410.955
L2-V21.650.5510.5250.5710.5360.954
Ours-SP20.640.2490.2560.2720.2750.954
Ours-S220.400.2730.2550.2970.2750.977
Ours-S320.230.2360.2340.2560.2550.979
+ +![](images/889662fd24501762ffcedbd9f2a06b726f0b22684da534afeea836b65891c275.jpg) +Figure 4: Illustration of two channels ((a) and (b)) of our motion smoothness model latent sequences $Z$ . In each subfigure, the left and right plots show the result before and after Alg. 1, respectively. The row and column in each plot denote feature dimension and time, respectively. + +![](images/e0931ada38fbfdd2492bd7d60b1be67d0a6526a931ed1fa6e8225071036caa6d.jpg) + +![](images/8c4bfffa741d4d387630f5d7986c6623ce3775cbe84aedf0ca7db79158834d6e.jpg) + +![](images/78038f5f255f7dfd9bd7cd5f45f059e1f334b73e455356311962afe76263a216.jpg) + +Table 2: Evaluation of our motion smoothness prior on 3DPW. PSKL-J denotes PSKL of joints. (3D, A) denotes PSKL(3DPW, AMASS), and (A, 3D) the reverse direction. For each metric, the best result is in boldface. + +
MethodsMPJPE↓PVE↓PSKL-J ↓
(3D, A)(A, 3D)
3DPW [60]--0.3480.376
DCT [22]0.0050.0070.2420.273
L2-A0.0060.0090.1770.204
L2-V0.0190.0250.2570.271
Ours-SP0.0050.0080.1730.197
+ +ally fit SMPL-X parameters to the filled markers/joints, so as to perform fair comparison. The fitting function is: + +$$ +E _ {a m a s s} = E _ {3 D} + E _ {p r i o r} + E _ {s m o o t h} + E _ {f o o t}, \tag {9} +$$ + +where $E_{3D}$ is the error between infilled marker positions and the corresponding markers on the SMPL-X body to optimize, and $E_{prior}$ is the prior term for body and hand pose. For our method, $E_{foot}$ is the second term in Eq. 8. For the baseline method, we define $E_{foot}$ using a heuristic: foot-ground contact happens if the foot marker distance from the ground is smaller than $10\mathrm{cm}$ (see Supp. Mat.). + +Table 3: Evaluation for motion infilling prior on AMASS. MPJPE-L / MPMPE-L denotes MPJPE / MPMPE for the masked lower body part. Finetune denotes per-instance self-supervised learning. For each metric, the best result is in boldface. + +
MethodsMPJPE ↓MPMPE ↓VPE ↓MPJPE-L ↓MPMPE-L ↓Foot Skating ↓
Ours vs baselineKaufmann et al. [28]0.0220.0260.0250.0370.0360.237
Ours-IP0.0140.0160.0120.0340.0330.182
Ablation studyOurs-IP w/o Opt w/o finetune-0.025--0.040-
Ours-IP w/o Opt-0.015--0.036-
Ours-IP w/o finetune heuristic contact0.0200.0240.0210.0400.0380.257
Ours-IP w/o finetune0.0200.0230.0210.0380.0360.178
Ours-IP heuristic contact0.0140.0170.0130.0360.0350.265
+ +We randomly select 130 sequences from our AMASS test set, in order to remove redundant motions and reduce computational cost. To simulate the occlusions occurring in real person-scene interactions and absent in AMASS, at evaluation time, for the network input of both methods, we mask out all markers belonging the lower part of the body and the contact labels in all frames. Furthermore, we evaluate the proposed motion infilling prior on PROX in terms of 2D joint accuracy, PSKL and non-collision score. + +# 4.3.1 Metrics + +3D accuracy. We report the mean position error for joints (MPJPE), body markers (MPMPE) and body vertices (PVE) in global coordinates between the infilled motions and the motions from AMASS. We compute these three metrics for the full body, and also compute MPJPE and MPMPE for the masked body parts. + +Foot skating. Following [71], we adopt the "foot skating ratio" as another measure of motion naturalness. We compute it by considering the two markers located on the left and right foot heels. We define skating as happening when the velocity of both foot markers exceeds $10\mathrm{cm/s}$ and their height above the ground is lower than $10\mathrm{cm}$ . + +# 4.3.2 Results + +The results on AMASS are shown in Tab. 3. Our infiller consistently outperforms the baseline for all metrics. In particular, our model reconstructs more accurate motions with all the three representations (body marker, joint and vertex). Besides, we obtain smaller reconstruction errors for the lower part of the body (MPJPE-L and MPMPE-L). + +Compared to the heuristic foot-ground contact rule used for the baseline, our predicted contact labels alleviate foot skating more effectively, and recover foot dynamics during optimization. This is also verified in the ablation study (Ours-IP heuristic contact), where we replace the predicted contact labels by the same heuristic contact rule used in the baseline. A probable reason is that our model learns foot + +ground contact and whole body motion jointly, and hence can predict the two more consistently. + +In addition, the ablation study suggests that our model performance is consistently improved by the self-supervised fine-tuning (see Sec. 3.4), before SMPL-X fitting (Ours w/o Opt) and after, for both whole body and occluded parts. This indicates that our motion infiller effectively adapts itself to test instances, exploiting more useful information from the unmasked body parts of the input. + +The last two rows in Tab. 1 show results of the motion infilling prior on PROX. Compared with results of Stage 2 without motion infilling (Ours-S2), Stage 3 (Ours-S3) has an acceleration closer to AMASS, and lower 2D joint errors. Finally, to assess the stages of our pipeline, we swap Stage 2 and Stage 3, and find that the motion infiller works poorly when taking jittered PROX data as input (see Supp. Mat.). Also, the model overfits to the noisy input when performing the self-supervised test fine-tuning. + +# 5. Conclusion + +In this paper, we propose a novel motion smoothness prior and a contact-aware motion infilling prior learned from high-quality motion capture data, which effectively learn intrinsic full-body dynamics of smooth motions and recover body parts occluded from the camera view. On top of that, we introduce a new multi-stage optimization pipeline which incorporates the motion priors and a physics-inspired contact friction term, and reconstructs smooth, accurate and occlusion-robust global motions with physically plausible human-scene interactions in complex 3D environments. Nevertheless, there are limitations in the current approach. For instance, human movement is rooted in physics. The current pipeline only incorporates intuitive physics terms (e.g. contact, interpenetration and friction); it is a very promising and challenging research direction to employ more physics inspired motion modeling, in combination with the powerful data-driven motion priors. + +Acknowledgements. This work was supported by the Microsoft Mixed Reality & AI Zürich Lab PhD scholarship. We sincerely thank Shaofei Wang and Jiahao Wang for proofreading. + +# References + +[1] Kinect for docker. https://en.wikipedia.org/wiki/Kinect#Kinetc_for_Xbox-One_(2013).6 +[2] Ankur Agarwal and Bill Triggs. Recovering 3d human pose from monocular images. IEEE transactions on pattern analysis and machine intelligence, 28(1):44-58, 2005. 2 +[3] Ijaz Akhter, Tomas Simon, Sohaib Khan, Iain Matthews, and Yaser Sheikh. Bilinear spatiotemporal basis models. ACM Transactions on Graphics (TOG), 31(2):1-12, 2012. 3 +[4] Anurag Arnab, Carl Doersch, and Andrew Zisserman. Exploiting temporal context for 3d human pose estimation in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3395-3404, 2019. 3, 4, 6 +[5] Alexandru O Balan and Michael J Black. The naked truth: Estimating body shape under clothing. In European Conference on Computer Vision, pages 15-29. Springer, 2008. 2 +[6] Federica Bogo, Michael J Black, Matthew Loper, and Javier Romero. Detailed full-body reconstructions of moving people from monocular rgb-d sequences. In Proceedings of the IEEE international conference on computer vision, pages 2300-2308, 2015. 3 +[7] Magnus Burenius, Josephine Sullivan, and Stefan Carlsson. 3d pictorial structures for multiple view articulated pose estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3618-3625, 2013. 2 +[8] Yujun Cai, Liuhao Ge, Jun Liu, Jianfei Cai, Tat-Jen Cham, Junsong Yuan, and Nadia Magnenat Thalmann. Exploiting spatial-temporal relationships for 3d pose estimation via graph convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2272-2281, 2019. 2 +[9] Z. Cao, G. Hidalgo Martinez, T. Simon, S. Wei, and Y. A. Sheikh. Openpose: Realtime multi-person 2d pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 3, 6 +[10] Hongsuk Choi, Gyeongsik Moon, and Kyoung Mu Lee. Beyond static features for temporally consistent 3d human pose and shape from a video. arXiv e-prints, pages arXiv-2011, 2020. 2, 3 +[11] Rishabh Dabral, Anurag Mundhada, Uday Kusupati, Safeer Afaque, Abhishek Sharma, and Arjun Jain. Learning 3d human pose from structure and motion. In Proceedings of the European Conference on Computer Vision (ECCV), pages 668-683, 2018. 2 +[12] Junting Dong, Qing Shuai, Yuanqing Zhang, Xian Liu, Xiaowei Zhou, and Hujun Bao. Motion capture from internet videos. In European Conference on Computer Vision, pages 210-227. Springer, 2020. 2 +[13] Ahmed Elhayek, Edilson de Aguiar, Arjun Jain, Jonathan Thompson, Leonid Pishchulin, Micha Andriluka, Chris Bregler, Bernt Schiele, and Christian Theobalt. Efficient convnet-based marker-less motion capture in general scenes with a low number of cameras. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3810-3818, 2015. 2 +[14] Ahmed Elhayek, Carsten Stoll, Kwang In Kim, and Christian Theobalt. Outdoor human motion capture by simultaneous + +optimization of pose and camera parameters. In Computer Graphics Forum, volume 34, pages 86-98. Wiley Online Library, 2015. 2 +[15] Juergen Gall, Bodo Rosenhahn, Thomas Brox, and Hans-Peter Seidel. Optimization and filtering for human motion capture. International journal of computer vision, 87(1-2):75, 2010. 2 +[16] Kristen Grauman, Gregory Shakhnarovich, and Trevor Darrell. Inferring 3d structure with a statistical image-based shape model. In ICCV, volume 3, page 641, 2003. 2 +[17] Riza Alp Guler and Iasonas Kokkinos. Holopose: Holistic 3d human reconstruction in-the-wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10884-10894, 2019. 2 +[18] Nils Hasler, Bodo Rosenhahn, Thorsten Thormahlen, Michael Wand, Jürgen Gall, and Hans-Peter Seidel. Markerless motion capture with unsynchronized moving cameras. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 224-231. IEEE, 2009. 3 +[19] Mohamed Hassan, Vasileios Choutas, Dimitrios Tzionas, and Michael J Black. Resolving 3d human pose ambiguities with 3d scene constraints. In Proceedings of the IEEE International Conference on Computer Vision, pages 2282-2292, 2019. 1, 2, 3, 5, 6, 7 +[20] Alejandro Hernandez, Jurgen Gall, and Francesc Moreno-Noguer. Human motion prediction via spatio-temporal inpainting. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7134-7143, 2019. 7, 1 +[21] Daniel Holden, Jun Saito, and Taku Komura. A deep learning framework for character motion synthesis and editing. ACM Transactions on Graphics (TOG), 35(4):1-11, 2016. 5, 3 +[22] Yinghao Huang, Federica Bogo, Christoph Lassner, Angjoo Kanazawa, Peter V Gehler, Javier Romero, Ijaz Akhter, and Michael J Black. Towards accurate marker-less human shape and pose estimation over time. In 2017 international conference on 3D vision (3DV), pages 421-430. IEEE, 2017. 2, 3, 6, 7 +[23] Hanbyul Joo, Hao Liu, Lei Tan, Lin Gui, Bart Nabbe, Iain Matthews, Takeo Kanade, Shohei Nobuhara, and Yaser Sheikh. Panoptic studio: A massively multiview system for social motion capture. In Proceedings of the IEEE International Conference on Computer Vision, pages 3334-3342, 2015. 2 +[24] Hanbyul Joo, Natalia Neverova, and Andrea Vedaldi. Exemplar fine-tuning for 3d human pose fitting towards in-the-wild 3d human pose estimation. arXiv preprint arXiv:2004.03686, 2020. 2, 5 +[25] Hanbyul Joo, Tomas Simon, and Yaser Sheikh. Total capture: A 3d deformation model for tracking faces, hands, and bodies. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8320-8329, 2018. 2 +[26] Angjoo Kanazawa, Michael J Black, David W Jacobs, and Jitendra Malik. End-to-end recovery of human shape and pose. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7122-7131, 2018. 2 +[27] Angjoo Kanazawa, Jason Y Zhang, Panna Felsen, and Jitendra Malik. Learning 3d human dynamics from video. In Proceedings of the IEEE Conference on Computer Vision and + +Pattern Recognition, pages 5614-5623, 2019. 2 +[28] Manuel Kaufmann, Emre Aksan, Jie Song, Fabrizio Pece, Remo Ziegler, and Otmar Hilliges. Convolutional autoencoders for human motion infilling. In 2020 International Conference on 3D Vision (3DV). IEEE, 2020. 2, 3, 4, 5, 7, 8 +[29] Sena Kiciroglu, Helge Rhodin, Sudipta N Sinha, Mathieu Salzmann, and Pascal Fua. Activemocap: Optimized viewpoint selection for active human motion capture. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 103-112, 2020. 2 +[30] Seong Uk Kim, Hanyoung Jang, and Jongmin Kim. Human motion denoising using attention-based bidirectional recurrent neural network. In SIGGRAPH Asia 2019 Posters, pages 1-2. 2019. 3 +[31] Muhammed Kocabas, Nikos Athanasiou, and Michael J Black. Vibe: Video inference for human body pose and shape estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5253-5263, 2020. 2 +[32] Nikos Kolotouros, Georgios Pavlakos, Michael J Black, and Kostas Daniilidis. Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In Proceedings of the IEEE International Conference on Computer Vision, pages 2252-2261, 2019. 2 +[33] Zongmian Li, Jiri Sedlar, Justin Carpentier, Ivan Laptev, Nicolas Mansard, and Josef Sivic. Estimating 3d motion and forces of person-object interactions from monocular video. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8640-8649, 2019. 6 +[34] Miao Liu, Dexin Yang, Yan Zhang, Zhaopeng Cui, James M Rehg, and Siyu Tang. 4d human body capture from egocentric video via 3d scene grounding. arXiv preprint arXiv:2011.13341, 2020. 2 +[35] Ruixu Liu, Ju Shen, He Wang, Chen Chen, Sen-ching Cheung, and Vijayan Asari. Attention mechanism exploits temporal contexts: Real-time 3d human pose reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5064-5073, 2020. 2 +[36] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J Black. Smpl: A skinned multiperson linear model. ACM transactions on graphics (TOG), 34(6):1-16, 2015. 2 +[37] Zhengyi Luo, S Alireza Golestaneh, and Kris M Kitani. 3d human motion estimation via motion compression and refinement. In Proceedings of the Asian Conference on Computer Vision, 2020. 2, 3 +[38] Naureen Mahmood, Nima Ghorbani, Nikolaus F Troje, Gerard Pons-Moll, and Michael J Black. Amass: Archive of motion capture as surface shapes. In Proceedings of the IEEE International Conference on Computer Vision, pages 5442-5451, 2019. 1, 2, 4, 6 +[39] Dushyant Mehta, Oleksandr Sotnychenko, Franziska Mueller, Weipeng Xu, Mohamed Elgharib, Pascal Fua, Hans-Peter Seidel, Helge Rhodin, Gerard Pons-Moll, and Christian Theobalt. Xnect: Real-time multi-person 3d motion capture with a single rgb camera. ACM Transactions on Graphics (TOG), 39(4):82-1, 2020. 2 +[40] Dushyant Mehta, Oleksandr Sotnychenko, Franziska + +Mueller, Weipeng Xu, Srinath Sridhar, Gerard Pons-Moll, and Christian Theobalt. Single-shot multi-person 3d pose estimation from monocular rgb. In 2018 International Conference on 3D Vision (3DV), pages 120-130. IEEE, 2018. +[41] Dushyant Mehta, Srinath Sridhar, Oleksandr Sotnychenko, Helge Rhodin, Mohammad Shafiei, Hans-Peter Seidel, Weipeng Xu, Dan Casas, and Christian Theobalt. Vnect: Real-time 3d human pose estimation with a single rgb camera. ACM Transactions on Graphics (TOG), 36(4):1-14, 2017. 2, 3, 4, 6 +[42] Mohamed Omran, Christoph Lassner, Gerard Pons-Moll, Peter Gehler, and Bernt Schiele. Neural body fitting: Unifying deep learning and model based human pose and shape estimation. In 2018 international conference on 3D vision (3DV), pages 484-494. IEEE, 2018. 2 +[43] Dirk Ormoneit, Hedvig Sidenbladh, Michael J Black, and Trevor Hastie. Learning and tracking cyclic human motion. In Advances in Neural Information Processing Systems, pages 894-900, 2001. 3 +[44] Georgios Pavlakos, Vasileios Choutas, Nima Ghorbani, Timo Bolkart, Ahmed AA Osman, Dimitrios Tzionas, and Michael J Black. Expressive body capture: 3d hands, face, and body from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10975-10985, 2019. 2, 3, 6 +[45] Dario Pavllo, Christoph Feichtenhofer, David Grangier, and Michael Auli. 3d human pose estimation in video with temporal convolutions and semi-supervised training. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7753-7762, 2019. 2 +[46] Mir Rayat Imtiaz Hossain and James J Little. Exploiting temporal information for 3d human pose estimation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 68-84, 2018. 2 +[47] Davis Rempe, Leonidas J Guibas, Aaron Hertzmann, Bryan Russell, Ruben Villegas, and Jamei Yang. Contact and human dynamics from monocular video. In European Conference on Computer Vision, pages 71-87. Springer, 2020. 3, 4 +[48] Liu Ren, Alton Patrick, Alexei A Efros, Jessica K Hodgins, and James M Rehg. A data-driven approach to quantifying natural human motion. ACM Transactions on Graphics (TOG), 24(3):1090-1097, 2005. 3 +[49] Javier Romero, Dimitrios Tzionas, and Michael J. Black. Embodied hands: Modeling and capturing hands and bodies together. ACM Transactions on Graphics, (Proc. SIGGRAPH Asia), 36(6):245:1-245:17, Nov. 2017. 6 +[50] Nitin Saini, Eric Price, Rahul Tallamraju, Raffi Enficiaud, Roman Ludwig, Igor Martinovic, Aamir Ahmad, and Michael J Black. Markerless outdoor human motion capture using multiple autonomous micro aerial vehicles. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 823-832, 2019. 2 +[51] Manolis Savva, Angel X Chang, Pat Hanrahan, Matthew Fisher, and Matthias Nießner. Pigraphs: Learning interaction snapshots from observations. ACM Transactions on Graphics (TOG), 35(4):1-12, 2016. 3 +[52] Soshi Shimada, Vladislav Golyanik, Weipeng Xu, and Christian Theobalt. Physcap: Physically plausible monocular 3d + +motion capture in real time. ACM Transactions on Graphics (TOG), 39(6):1-16, 2020. 3, 4, 6 +[53] L. Signal and M. J. Black. Predicting 3D people from 2D pictures. In Proc. IV Conf. on Articulated Motion and Deformable Objects (AMDO), volume LNCS 4069, pages 185-195, July 2006. 2 +[54] Leonid Sigal, Michael Isard, Horst Haussecker, and Michael J Black. Loose-limbed people: Estimating 3d human pose and motion using non-parametric belief propagation. International journal of computer vision, 98(1):15-48, 2012. 2 +[55] Yu Sun, Yun Ye, Wu Liu, Wenpeng Gao, YiLi Fu, and Tao Mei. Human mesh recovery from monocular images via a skeleton-disentangled representation. In Proceedings of the IEEE International Conference on Computer Vision, pages 5349-5358, 2019. 2, 3 +[56] Jun Kai Vince Tan, Ignas Budvyitis, and Roberto Cipolla. Indirect deep structured learning for 3d human body shape and pose prediction. 2017. 2 +[57] Shashank Tripathi, Siddhant Ranade, Ambrish Tyagi, and Amit Agrawal. Posenet3d: Learning temporally consistent 3d human pose via knowledge distillation. arXiv preprint arXiv:2003.03473, 2020. 6 +[58] Hsiao-Yu Tung, Hsiao-Wei Tung, Ersin Yumer, and Katerina Fragkiadaki. Self-supervised learning of motion capture. In Advances in Neural Information Processing Systems, pages 5236–5246, 2017. 2 +[59] Raquel Urtasun, David J Fleet, and Pascal Fua. 3d people tracking with gaussian process dynamical models. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06), volume 1, pages 238-245. IEEE, 2006. 3 +[60] Timo von Marcard, Roberto Henschel, Michael J Black, Bodo Rosenhahn, and Gerard Pons-Moll. Recovering accurate 3d human pose in the wild using imus and a moving camera. In Proceedings of the European Conference on Computer Vision (ECCV), pages 601-617, 2018. 2, 6, 7 +[61] Marek Vondrak, Leonid Sigal, and Odest Chadwicke Jenkins. Dynamical simulation priors for human motion tracking. IEEE transactions on pattern analysis and machine intelligence, 35(1):52-65, 2012. 3 +[62] He Wang, Edmond SL Ho, Hubert PH Shum, and Zhanxing Zhu. Spatio-temporal manifold learning for human motions via long-horizon modeling. IEEE transactions on visualization and computer graphics, 27(1):216-227, 2019. 3 +[63] Jingbo Wang, Sijie Yan, Yuanjun Xiong, and Dahua Lin. Motion guided 3d pose estimation from videos. In European Conference on Computer Vision, pages 764-780. Springer, 2020. 2 +[64] Yangang Wang, Yebin Liu, Xin Tong, Qionghai Dai, and Ping Tan. Outdoor markerless motion capture with sparse handheld video cameras. IEEE transactions on visualization and computer graphics, 24(5):1856-1866, 2017. 2 +[65] Jingwei Xu, Zhenbo Yu, Bingbing Ni, Jiancheng Yang, Xiaokang Yang, and Wenjun Zhang. Deep kinematics analysis for monocular 3d human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 899–908, 2020. 2 +[66] Yuanlu Xu, Song-Chun Zhu, and Tony Tung. Denserac: Joint + +3d pose and shape estimation by dense render-and-compare. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7760-7770, 2019. 2 +[67] Andrei Zanfir, Eduard Gabriel Bazavan, Hongyi Xu, Bill Freeman, Rahul Sukthankar, and Cristian Sminchisescu. Weakly supervised 3d human pose and shape reconstruction with normalizing flows. arXiv preprint arXiv:2003.10350, 2020. 2 +[68] Andrei Zanfir, Elisabella Maroiniu, and Cristian Sminchisescu. Monocular 3d pose and shape estimation of multiple people in natural scenes-the importance of multiple scene constraints. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2148-2157, 2018. 3 +[69] Siwei Zhang, Yan Zhang, Qianli Ma, Michael J Black, and Siyu Tang. Place: Proximity learning of articulation and contact in 3d environments. In 8th international conference on 3D Vision (3DV 2020)(virtual), 2020. 3, 7 +[70] Yuxiang Zhang, Liang An, Tao Yu, Xiu Li, Kun Li, and Yebin Liu. 4d association graph for realtime multi-person motion capture using multiple video cameras. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1324-1333, 2020. 2 +[71] Yan Zhang, Michael J Black, and Siyu Tang. We are more than our joints: Predicting how 3d bodies move. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3372-3382, 2021. 2, 4, 6, 8, 1 +[72] Yan Zhang, Mohamed Hassan, Heiko Neumann, Michael J Black, and Siyu Tang. Generating 3d people in scenes without people. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6194-6204, 2020. 3, 7 +[73] Xiaowei Zhou, Menglong Zhu, Spyridon Leonardos, Konstantinos G Derpanis, and Kostas Daniilidis. Sparseness meets deepness: 3d human pose estimation from monocular video. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4966-4975, 2016. 2, 6 \ No newline at end of file diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/images.zip b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b0ce6f7605f89deb743ec617ba421100e0f5862d --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a8abecb26ca4d2afc9db37012b9049d10df58bfc0fb64ccd1def9101967ddd0 +size 394019 diff --git a/learningmotionpriorsfor4dhumanbodycapturein3dscenes/layout.json b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..025eb94c6cc7fe35084b521b09d33a65b2528dc2 --- /dev/null +++ b/learningmotionpriorsfor4dhumanbodycapturein3dscenes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b84d1cba73ed2664906982e1f95ec19163f6a808c9e864c3d108bfaea1882f45 +size 459310 diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_content_list.json b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3a7abf7e22c1e2f8d7f540080f46a8dd68937fdb --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51c026734ef8695adc92ac385fc79cca5c0947587ea77e107d4fa58963c1519b +size 83384 diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_model.json b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_model.json new file mode 100644 index 0000000000000000000000000000000000000000..680afc4e2de25554db56765307fb88a3e38911b0 --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cb5edab2ccc5b48494ec28ee81bb029256072d802cb56e51e99b1ce67c4bb99 +size 103552 diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_origin.pdf b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7c8e81d75c322b50e4ffaab879b72372caff4a93 --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/6fe926b3-9979-482e-893f-fbce4c6d4123_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bd8397519eaeb8e16930496516666a3b3a40946537bbbb7d0d1b283d851bbf7 +size 4010055 diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/full.md b/learningmultiplepixelwisetasksbasedonlossscalebalancing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d5bbd371d3a0fc7f43b5ea0e60df691d4f5a122d --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/full.md @@ -0,0 +1,404 @@ +# Learning Multiple Pixelwise Tasks Based on Loss Scale Balancing + +Jae-Han Lee + +Korea University + +jaehanlee@mcl.korea.ac.kr + +Chul Lee + +Dongguk University + +chullee@dongguk.edu + +Chang-Su Kim + +Korea University + +changsukim@korea.ac.kr + +# Abstract + +We propose a novel loss weighting algorithm, called loss scale balancing (LSB), for multi-task learning (MTL) of pixelwise vision tasks. An MTL model is trained to estimate multiple pixelwise predictions using an overall loss, which is a linear combination of individual task losses. The proposed algorithm dynamically adjusts the linear weights to learn all tasks effectively. Instead of controlling the trend of each loss value directly, we balance the loss scale — the product of the loss value and its weight — periodically. In addition, by evaluating the difficulty of each task based on the previous loss record, the proposed algorithm focuses more on difficult tasks during training. Experimental results show that the proposed algorithm outperforms conventional weighting algorithms for MTL of various pixelwise tasks. Codes are available at https://github.com/jaehanlee-mcl/LSB-MTL. + +# 1. Introduction + +Multi-task learning (MTL) is a machine learning technique to solve multiple learning tasks simultaneously while exploiting commonalities and differences across tasks. MTL can improve the learning efficiency and prediction accuracy for related tasks using an integrated model, as compared to separate models trained for the multiple tasks independently. The effectiveness of MTL has been proven both theoretically and experimentally [1-4, 11]. With the advances in deep learning, MTL has been employed in a wide range of applications, such as computer vision [14, 19, 32], natural language processing (NLP) [7, 10, 28], reinforcement learning [12, 17, 35], and speech recognition [8, 16, 39]. + +In computer vision, MTL models using convolutional neural networks (CNNs) have been proposed mainly. For example, MTL models have been developed to jointly perform three pixelwise tasks of depth estimation, surface normal estimation, and semantic segmentation from an input image [25, 46]. Also, the joint depth and motion estimation from a video [6, 44] and the classification of an image for multiple attributes [30, 37] have been studied. These re + +searches have advanced the learning of closely related tasks using a single MTL model. Since a large part of the network is shared between tasks, an MTL model is advantageous in terms of complexity, inference time, and learning efficiency. + +To develop an effective deep MTL algorithm, two factors should be considered: architecture and training scheme. First, the architecture should be designed to learn both task-across and task-specific representations by allocating network parameters appropriately for shared and task-specific purposes. Many architectures have been developed by considering various factors, such as the CNN capacity, data type, and relationship between tasks [12, 29, 34]. Second, a training scheme should discourage any bias toward a specific task [6, 18, 25]. Because an MTL model generates multiple estimates, the corresponding losses should be defined and then combined to form an overall loss. Since each loss has a different scale during training, the overall loss may be dominated by a specific loss. Moreover, the losses may vary in different directions or even fluctuate during training. It is hence important to balance loss contributions and thus enforce that MTL learns all tasks effectively. + +In this paper, we propose a novel loss weighting algorithm, called loss scale balancing (LSB), for MTL of pixelwise computer vision tasks (e.g. depth estimation and semantic segmentation), which can dynamically adjust weights to learn all tasks effectively. Based on the observation that balancing the loss scale, which is the product of a loss value and its weight, is more efficient than controlling the trend of each loss value directly, we adjust the loss scales to be balanced periodically. Besides, by evaluating the difficulty of each task using the previous loss record, the proposed algorithm can focus more on difficult tasks. Experimental results demonstrate that the proposed algorithm can successfully balance loss scales to improve the performance of each task. The proposed LSB algorithm outperforms conventional weighting algorithms. + +The main contributions of this paper are as follows: + +- We propose balancing loss scales, instead of losses themselves, to improve the performance of MTL of pixelwise vision tasks. +- We further improve the performance by tuning loss + +scales through the assessment of task difficulties. + +- It is shown experimentally that the proposed algorithm outperforms conventional ones consistently, regardless of MTL architecture, dataset, and encoder backbone. + +# 2. Related Work + +MTL architectures: A single MTL model should provide an estimate for each of the multiple tasks by considering both general and task-specific representations of input data. Thus, an MTL architecture should be designed to allocate limited parameters for shared and task-specific purposes appropriately. + +Figure 1 shows three typical MTL architectures, in comparison with single-task learning (STL). The simplest one is to add multiple estimation layers at the end of an STL network, as shown in Figure 1(b). Because of its simplicity and efficiency in computation and memory space, the full-sharing architecture has been widely employed for multilingual recognition [16], pose estimation and action detection [13], facial landmark detection [47], multiple classification [37], as well as for pixelwise visions. However, it may fail to learn task-specific representations effectively because all hidden layers are shared across tasks. + +Figure 1(c) is the multi-decoder architecture, composed of a shared encoder and multiple task-specific decoders. This architecture has been employed for computer vision [5, 18, 31] and NLP [7, 26] applications. Some models adopt feature selection modules to transfer the representations from shared encoder output selectively to task-specific decoders. Various techniques for selecting features for each task have been developed: linear combination of intermediate features [9], multi-scale fusion [19], connection of layers at different depths [14], and attention modules [25]. + +Finally, the multi-column architecture is in Figure 1(d), in which an encoder-decoder network is designed for each task and modules for sharing features across the networks are added. Thus, the encoder parameters are soft-shared across tasks. The main issue in this architecture is how to share features between tasks effectively; the linear combination of features [29, 33], one-way transfer between tasks [35], and distillation modules [43] have been tried. + +In addition to the MTL architectures in Figure 1, several others have been developed as well. In [12], previous approaches were extended by exploiting multiple input and output layers for different tasks and adopting many convolutional paths connecting them. In [48], a single-encoder-multi-decoder architecture was designed, but, similarly to the multi-column approach, features were transferred between layers for different tasks. + +MTL model training: When training an MTL model, losses for different tasks interact intricately with one another via backpropagation. The weighting of these losses + +![](images/86d7388dd0bf21426340ce936376e40ea90db7623f86fff730558aee431df56f.jpg) +Figure 1. Typical architectures for MTL in the case of triple tasks. + +has a significant impact on the performance of each task [18]. These weights can be manually determined [13, 19, 39, 41], which, however, requires expert knowledge on individual loss functions and extensive trial-and-errors. + +Dynamic weighting, which adjusts weights of losses during training, can overcome this problem. Recent dynamic weighting algorithms update weights periodically based on the uncertainty of losses [18], the rates of change of losses [25], and the weighted geometric mean of losses [6]. In [40], an attempt was made to achieve the Pareto optimality between losses. GradNorm [5] also adjusts loss weights by monitoring loss reduction rates over time. However, unlike the proposed algorithm, it needs to access the gradients of losses with respect to shared network parameters. Thus, when tasks are connected in a complicated way, such as in the multi-column architecture in Figure 1(d), GradNorm may demand a high computational cost. Therefore, it is applied only to the multi-decoder architecture in Figure 1(c) in [5]. + +Curriculum learning [14, 23, 30, 37] is another effective approach to MTL that starts with easy tasks and gradually moves on to more difficult tasks. In [30, 37], the learning sequence of tasks was determined according to the correlation between tasks. In [23], instance difficulties, as well as task difficulties, were considered. In [14], difficulties of tasks were measured and used for learning schedule similarly to the proposed algorithm. However, the proposed algorithm differs from the training of other MTL algorithms in that it adjusts weights based on loss scales. In [22], loss scales were considered for training networks, but it only focused on the monocular depth estimation [15, 20, 21]. + +# 3. Proposed Algorithm + +We train a neural network performing multiple tasks in a supervised manner. Let $f$ be the network and $\theta$ be its parameters. We aim at determining optimal parameters + +$$ +\theta^ {*} = \arg \min _ {\theta} \sum_ {(I, J) \in \mathcal {D}} \ell (f (I; \theta), J) \tag {1} +$$ + +where $\mathcal{D}$ is a training dataset composed of $(I,J)$ pairs. $I$ is an input signal and $J$ represents the ground-truth labels for multiple tasks. Also, $\ell$ is a loss function between the estimate $\widehat{J} \triangleq f(I;\theta)$ and the ground-truth $J$ . + +![](images/9a8bed70cf0bf84bbab91d5851dc388cae6993b0533bc9306c662291cf1fd9bc.jpg) +Figure 2. A schematic diagram of an MTL model for three tasks. + +Figure 2 shows a schematic diagram of $f$ for three tasks involving depth, normal, and segmentation losses. In general, let $J_{k}$ , $\widehat{J_k}$ , and $\ell_{k}$ denote a ground-truth label, its estimate, and a loss function for the $k$ th task, respectively. The overall loss function $\ell$ in (1) is defined as a weighted sum of the loss functions for individual tasks, given by + +$$ +\ell (f (I; \theta), J) = \sum_ {k = 1} ^ {n} w _ {k} \ell_ {k} (\widehat {J} _ {k}, J _ {k}) \tag {2} +$$ + +where $w_{k}$ is a weight for the $k$ th task, and $n$ is the number of tasks. Either fixed or dynamic weighting can be adopted to determine $w_{k}$ in MTL. + +In fixed weighting, weights $w_{k}$ are fixed throughout the training. The simplest scheme, called equal weighting, is to fix all weights identically. In such a case, the overall loss may be dominated by a specific loss, since each loss may have a different scale. Figure 3(a) shows an example of equal weighting, in which depth and normal errors may generate too small gradients as compared with dominant segmentation errors. This imbalance between losses can be reduced by setting weights manually as in Figure 3(b), so that the contribution of each loss is equalized at the beginning. However, it requires trial and error to find such weights. Besides, it cannot reflect loss variations during training. In Figure 3(b), the segmentation loss decreases faster than the others, resulting in an imbalance in the end. + +Dynamic weighting can overcome these problems. By adjusting weights after each period, the contributions of losses can be equalized throughout the training, as in Figure 3(c). Let us define a loss scale as the product of a loss value and its weight. In Figure 3(c), the weights are determined adaptively to equalize the loss scales of all tasks. + +We propose a sophisticated dynamic weighting algorithm, which adjusts weights to balance loss scales and to make the MTL network learn all tasks effectively. Notice that the proposed algorithm requires neither extra network parameters nor expert knowledge of individual loss functions. It simply monitors the progress of loss scales during training and adjusts weights periodically with only a slight computational overhead, so that the trained network can undertake all tasks more effectively. In this work, a training + +![](images/1fa622db4277a4d32ab15acc13a6d38e3c6f38b4383b249fd92450e7ec2955a0.jpg) +(a) Equal weighting + +![](images/155fc86a963a64560482649075d976803faf38e8f2b0f8903379b8438f0fa679.jpg) +(b) Fixed weighting with manual weight selection + +![](images/3ec2abaeeaba7e2c80d309b2027b8ae070d3d14c72a3f609ade297fcae362f21.jpg) +(c) Dynamic weighting for equalizing loss scales +Figure 3. Loss function graphs of three weighting schemes. + +epoch is defined as the period. + +The proposed LSB algorithm has three phases. In the first period, without prior information about losses, weights are set manually. In the second period, loss scales are balanced using the previous loss record. From the third period onward, the difficulty of each task is evaluated using the loss record of the previous two periods. Then, the training focuses on difficult tasks. + +Let $\{\pi_1,\pi_2,\dots,\pi_n\}$ be the set of priority factors for losses. Specifically, the priority factor $\pi_{k}$ represents the target contribution ratio of the $k$ th loss function $\ell_{k}$ to the overall loss function $\ell$ . Thus, $\sum_{k = 1}^{n}\pi_{k} = 1$ . In applications, these priority factors can be provided explicitly. If there is no such provision, we set $\pi_{k} = \frac{1}{n}$ for every $k$ . Also, let $L_{k}^{t}$ be the average loss of $\ell_{k}$ over the $t$ th period. Then, the average loss $L^t$ of $\ell$ over period $t$ is given by + +$$ +L ^ {t} = \sum_ {k = 1} ^ {n} w _ {k} ^ {t} L _ {k} ^ {t} \tag {3} +$$ + +where $w_{k}^{t}$ is the weight for $\ell_{k}$ in period $t$ . It is updated from $w_{k}^{t - 1}$ to $w_{k}^{t}$ at the start of period $t$ . + +1st period: There is no record of previous losses. Thus, equal weighting can be adopted as in Figure 4(a). In general, we set the weights using the priority factors by + +$$ +w _ {k} ^ {1} = \pi_ {k}, 1 \leq k \leq n. \tag {4} +$$ + +2nd period: We attempt to make the loss scale of the $k$ th task proportional to the priority factor $\pi_k$ . Suppose that + +![](images/3826d2db4eea992b4a3bde4d78d71bbfc924999298043bd652d252420b272a18.jpg) +Figure 4. Three phases of the proposed LSB algorithm. + +$\pi_{k} = \frac{1}{n}$ for every $k$ . Then, as shown in Figure 4(b), the loss scales can be equalized by adjusting each weight to be inversely proportional to the corresponding loss. Notice that, at period $t$ ( $\geq 2$ ), the loss record of the previous period $t - 1$ is available: $L^{t - 1}$ and $L_k^{t - 1}$ for $1 \leq k \leq n$ . + +At the start of period $t$ , we aim to balance the loss scales $w_{k}^{t}L_{k}^{t}$ by adjusting the weights $w_{k}^{t}$ . However, we do not know the losses $L_{k}^{t}$ yet. To address this problem, we assume that + +$$ +\frac {L ^ {t}}{L ^ {t - 1}} = \frac {L _ {1} ^ {t}}{L _ {1} ^ {t - 1}} = \frac {L _ {2} ^ {t}}{L _ {2} ^ {t - 1}} = \dots = \frac {L _ {n} ^ {t}}{L _ {n} ^ {t - 1}}. \tag {5} +$$ + +It is a reasonable assumption if all tasks are learned at a similar pace during period $t$ . We seek to train the MTL network to satisfy this assumption as much as possible, and it holds to some extent if the period is short enough. + +The loss scale $w_{k}^{t}L_{k}^{t}$ of task $k$ should contribute to the overall loss $L^t$ according to the priority factor $\pi_{k}$ ; + +$$ +w _ {k} ^ {t} L _ {k} ^ {t} = \pi_ {k} L ^ {t}. \tag {6} +$$ + +The weight $w_{k}^{t}$ is hence given by $w_{k}^{t} = \pi_{k}L^{t} / L_{k}^{t}$ . By the assumption in (5), we have $L^{t} / L_{k}^{t} = L^{t - 1} / L_{k}^{t - 1}$ . Thus, the proposed algorithm determines the weight $w_{k}^{t}$ using the previous loss record by + +$$ +w _ {k} ^ {t} = \pi_ {k} \frac {L ^ {t - 1}}{L _ {k} ^ {t - 1}} \tag {7} +$$ + +for $t\geq 2$ and $1\le k\le n$ + +The weighting rule in (7) has the following property. + +Proposition 1. For $t \geq 2$ , we have + +$$ +\sum_ {k = 1} ^ {n} w _ {k} ^ {t} L _ {k} ^ {t - 1} = \sum_ {k = 1} ^ {n} w _ {k} ^ {t - 1} L _ {k} ^ {t - 1}. \tag {8} +$$ + +Proof. From (7), $w_k^t L_k^{t-1} = \pi_k L^{t-1}$ . Since $\sum_{k=1}^n \pi_k = 1$ , $\sum_{k=1}^n w_k^t L_k^{t-1} = L^{t-1}$ . Then, (8) is established by (3). + +![](images/73ba3d96142b4adf68b24307eca9a59741a2e76e073bddf055fd98d02db6065f.jpg) +(a) Losses + +![](images/eb23029ccdc17392ab806d7752b80caeedeba9922a629263e9e8b92ac7f01281.jpg) +(b) Weights + +![](images/bfe2e412b800be6cb8990f8a06b3443ce6e0a9256d199982a2e8f1a581374968.jpg) +(c) Loss reduction rates +Figure 5. Illustration of the weighting rule in (7). + +![](images/fbe7683333a60107ff5c057974f370dac610f373c2a49b62ce2762c83d2816a1.jpg) +(d) Loss scales + +This proposition means that the overall loss $L^{t - 1}$ is unchanged when the weights $w_{k}^{t - 1}$ are updated to $w_{k}^{t}$ . Thus, the update of the weights does not change the magnitude of the overall loss, which makes the monitoring of the overall losses over periods easier. + +Figure 5 shows an example of the loss trends when the weighting rule in (7) is adopted. Three loss functions $\ell_{\mathbf{D}}$ , $\ell_{\mathbf{N}}$ , and $\ell_{\mathbf{S}}$ yield different values in Figure 5(a), but the corresponding loss scales are equalized after the first two periods in Figure 5(d) using the weights in Figure 5(b). Also, in Figure 5(c), loss reduction rates of the three tasks are similar to one another, as assumed in (5), except for the second period. Finally, after the first two periods, the overall loss $\ell$ in Figure 5(d) does not have big discontinuities between periods as predicted by Proposition 1. + +We use the weighting rule in (7) for all $t \geq 2$ . However, from the third period onward, more information is available about the characteristics of loss functions $\ell_k$ . To exploit such characteristics, we modify the overall loss function $\ell$ using the following scheme when $t \geq 3$ . + +3rd period onward: Using the loss record of the previous two periods, we quantify the difficulty of each task. Then, we focus on more difficult tasks by assigning bigger weights to them. Let $d_k^t$ denote the difficulty factor for task $k$ at period $t$ , which is computed by + +$$ +d _ {k} ^ {t} = \left(\frac {L _ {k} ^ {t - 1} / L _ {k} ^ {t - 2}}{L ^ {t - 1} / L ^ {t - 2}}\right) ^ {\beta} \tag {9} +$$ + +for $t \geq 3$ and $1 \leq k \leq n$ . Here, $\beta$ is a hyper-parameter. Suppose that $\beta = 1$ . Then, $d_k^t$ indicates whether the $k$ th loss $\ell_k$ decreases faster or slower than the overall loss $\ell$ . If $d_k^t > 1$ , $\ell_k$ decreases slower, implying that task $k$ is difficult. On the contrary, $d_k^t < 1$ implies that task $k$ is relatively easy. + +![](images/1ff785e30ee1f239862239d57e9555ce603d3ceaedf22468975ed0df44d61a7e.jpg) +Figure 6. Trends of difficulty factors, when $\beta = 1$ in (9). + +When $t \geq 3$ , by incorporating the difficulty factors, we define the overall loss function $\ell$ as + +$$ +\ell (f (I; \theta), J) = \alpha \sum_ {k = 1} ^ {n} d _ {k} w _ {k} \ell_ {k} (\widehat {J} _ {k}, J _ {k}) \tag {10} +$$ + +where $\alpha$ is a parameter to make the overall loss unchanged by the update of weights. Then, the average loss $L^t$ of $\ell$ over period $t$ is + +$$ +L ^ {t} = \alpha^ {t} \sum_ {k = 1} ^ {n} d _ {k} ^ {t} w _ {k} ^ {t} L _ {k} ^ {t} \tag {11} +$$ + +where $\alpha^t$ is the control parameter in period $t$ , given by + +$$ +\alpha^ {t} = \frac {1}{\sum_ {k = 1} ^ {n} \pi_ {k} d _ {k} ^ {t}}. \tag {12} +$$ + +Figure 4(c) illustrates this third phase. + +Similar to Proposition 1, we have the following property. Proposition 2. For $t \geq 3$ , we have + +$$ +\alpha^ {t} \sum_ {k = 1} ^ {n} d _ {k} ^ {t} w _ {k} ^ {t} L _ {k} ^ {t - 1} = \alpha^ {t - 1} \sum_ {k = 1} ^ {n} d _ {k} ^ {t - 1} w _ {k} ^ {t - 1} L _ {k} ^ {t - 1} \tag {13} +$$ + +Proof. From (7), $w_k^t L_k^{t-1} = \pi_k L^{t-1}$ . Also, by (12), + +$$ +\alpha^ {t} \sum_ {k} d _ {k} ^ {t} w _ {k} ^ {t} L _ {k} ^ {t - 1} = \frac {\sum_ {k} d _ {k} ^ {t} \pi_ {k} L ^ {t - 1}}{\sum_ {k = 1} ^ {n} \pi_ {k} d _ {k} ^ {t}} = L ^ {t - 1}. \tag {14} +$$ + +The proposition is then established by (11). + +Difficulty factors $d_k^t$ vary dynamically during training. Figure 6 illustrates difficulty trends during training when $\beta$ in (9) is fixed to 1. Two observations can be made: + +- Difficulty factors oscillate. A difficult task can become an easy one and vice versa, as the training goes on. +- The difficulty gaps between tasks are large at the start of training, but they get smaller gradually. Eventually, all difficulty levels become near 1. + +Because of these two properties, even though the loss function in (10) is used instead of (2), each loss scale converges to be proportional to its priority factor as the training progresses. However, large variations of $d_{k}$ in initial periods can affect the training adversely. Therefore, we adopt a curriculum learning scheme of smoothly increasing $\beta$ in (9) according to $t$ . Specifically, $\beta$ is initialized to 0 and incremented gradually. Thus, initially, the loss function in (10) is reduced to (2), but difficulty factors play more important roles in later periods. + +![](images/439a643a230e11ce38283f353557f541556b25a53558096a331b0296e6f3addf.jpg) +(a) NYUv2 + +![](images/c7a3d75d4c59081c480122c4b7049e5159ed0599f8a438735c8c1aabe8beccf3.jpg) +(b) Taskonomy +Figure 7. Examples of images and labels in the (a) NYUv2 [42] and (b) Taskonomy [45] datasets. + +Table 1. Summary of the network structures in experiments. + +
Full-sharingAn input image is processed by a single encoder and then a single decoder, which generates multi-channel output for each pixel representing the estimates of multiple tasks.
Multi-decoderMultiple identically structured decoders are linked to an encoder backbone. Each decoder outputs an estimate for the corresponding task.
Multi-columnThe cross-stich network [29] is used. It consists of multiple encoder-decoder columns for as many tasks and cross-stitch units connecting them.
+ +# 4. Experimental Results + +# 4.1. Dataset + +The proposed LSB algorithm is applied to joint learning of multiple pixelwise prediction tasks. We test MTL networks, which process an RGB image $\mathbf{I} \in \mathbb{R}^{w \times h \times 3}$ to estimate multiple maps of spatial resolution $w \times h$ . A different kind of map is generated according to the task, as illustrated in Figure 7. We employ two widely used datasets for MTL: the NYUv2 [42] and Taskonomy [45] datasets. + +The NYUv2 dataset consists of 795 training and 654 test RGB images with labels for depth, normal, and segmentation. Using NYUv2, we train networks to learn the three tasks jointly from input images, resized to $384 \times 288$ . + +The Taskonomy dataset provides labels for a wide range of tasks. From the tiny split, we build a mini dataset of 2,762 training images and 548 test images with a $\frac{1}{100}$ sampling ratio. We test two combinations of tasks: 4-task for depth, normal, curvature, and reshading and 8-task for depth, normal, curvature, reshading, 2D edge, 3D edge, 2D keypoint, and 3D keypoint. Images are resized to $256 \times 256$ . + +Table 2. Performance comparison of the proposed algorithm with the conventional algorithms on the NYUv2 dataset using various architectures with the MobileNet.v2 backbone. In each test, the performance rank is provided within parentheses. The best average rank is boldfaced, while the second-best one is underlined. + +
(a) Single-task learning
DepthNormalSegmentationRank
δ1RMSEδ30°∠meanmIoUAcc.MinMaxAvg.
Depth57.6%0.824-------
Normal--43.2%39.9-----
Segmentation----18.9%54.3%---
(b) Full-sharing
Equal weighting57.1% (3)0.841 (3)42.9% (4.5)40.8 (4)18.7% (4.5)53.4% (5)354.00
Uncert [18]56.1% (4.5)0.844 (4)42.9% (4.5)40.8 (4)19.3% (3)54.3% (3)34.53.83
DWA [25]57.7% (1)0.825 (1)43.0% (3)40.8 (4)18.7% (4.5)54.0% (4)14.52.92
GLS [6]56.1% (4.5)0.847 (5)43.1% (2)40.4 (1)19.6% (2)54.4% (2)14.52.75
Proposed57.6% (2)0.829 (2)43.3% (1)40.5 (2)19.8% (1)54.7% (1)121.50
(c) Multi-decoder
Equal weighting58.4% (4)0.821 (5)42.7% (3)40.6 (1)19.2% (3)54.6% (1.5)152.92
GradNorm [5]57.0% (6)0.829 (6)41.6% (6)40.9 (2.5)20.5% (1)53.3% (6)164.58
Uncert [18]58.1% (5)0.813 (3)42.0% (5)41.7 (6)19.0% (5)53.8% (5)364.83
DWA [25]58.9% (3)0.814 (4)42.5% (4)40.9 (2.5)19.1% (4)54.1% (4)2.543.58
GLS [6]59.6% (1)0.797 (1)42.8% (2)41.1 (5)18.7% (6)54.3% (3)163.00
Proposed59.2% (2)0.800 (2)43.0% (1)41.0 (4)19.5% (2)54.6% (1.5)142.25
(d) Multi-column (cross-stitch [29])
Equal weighting59.5% (5)0.801 (5)44.3% (2.5)40.0 (2)19.9% (4)55.7% (5)253.92
Uncert [18]60.9% (2)0.775 (2)44.1% (4)40.1 (3)20.8% (2)56.3% (3)242.67
DWA [25]59.9% (4)0.792 (4)43.7% (5)40.2 (4)20.5% (3)56.2% (2)253.67
GLS [6]60.6% (3)0.778 (3)44.3% (2.5)40.5 (5)19.6% (5)55.9% (4)2.553.75
Proposed61.6% (1)0.772 (1)44.8% (1)39.5 (1)21.0% (1)56.5% (1)111.00
+ +# 4.2. Implementation + +As a weighting algorithm for multi-task losses, the proposed LSB algorithm can be applied to various MTL networks. Table 1 summarizes three architectures for verifying the effectiveness of the LSB algorithm. Each structure corresponds to a category in Figure 1. In all architectures, the encoders down-sample an input image 5 times and extract features of spatial resolution $\frac{w}{32} \times \frac{h}{32}$ , while the decoders up-sample the encoder output 5 times. Thus, the output has the same resolution as the input. As the backbone networks, a lightweight network MobileNet.v2 [36] and a high capacity network PNASNet [24] are used, respectively. + +In training, we adopt a single loss function for each task. For example, the depth loss is defined as the absolute difference between a logarithmic ground-truth depth and its estimate, and the normal loss is computed from the inner product of ground-truth and estimated normal vectors. More detailed implementation including network architecture, loss functions, and training details are specified in Sections 1, 2, and 3, respectively, of the supplemental document. + +# 4.3. Performance Comparison + +We compare the proposed LSB algorithm with conventional MTL algorithms: equal weighting, Uncert [18], DWA [25], GLS [6], and GradNorm [5]. These algorithms are recent ones, and most of them can be applied to various MTL architectures. Thus, the comparison is possible under the same experimental conditions. To verify the versatility and reliability of the proposed algorithm, we adopt the + +two datasets [42, 45], the three networks in Table 1 and the two encoder backbones [24, 36] and conduct experiments on their various combinations. + +NYUv2: Table 2 summarizes the comparison results on NYUv2 using the MobileNet.v2 backbone. Six evaluation metrics (two for each task) in Table 3 are employed. GradNorm is tested for the multi-decoder architecture only, as done in [5]. Also, as a benchmark, we measure the performance of STL for each task. + +There is a trade-off between multiple tasks in MTL. By focusing on a specific task only, an algorithm can easily outperform the other algorithms on that task, but it may perform poorly on the other tasks. Thus, it is hard to compare MTL algorithms using a single metric. It is also unreasonable to average the scores of multiple metrics, which represent different physical quantities. Therefore, we adopt a rank-based evaluation protocol [38]. In Table 2, we provide the rank of each algorithm in each metric within parentheses and present the average rank in the rightmost column. + +The proposed algorithm consistently yields the best average ranks for all architectures. Also, the proposed algorithm ranks 1st or 2nd in most metrics. Especially, for the multicolumn architecture, the proposed algorithm ranks 1st in all metrics and thus has the best average rank $(= 1.00)$ , which is significantly better than the second-best one $(= 2.67)$ of Uncert. Also, it even outperforms the STL networks in all metrics. These results indicate that the proposed LSB algorithm is an effective approach to train MTL networks, without demanding additional network parameters or expert knowledge on loss functions. The average performances + +Table 3. Evaluation metrics: $d_{i}$ , $n_{i}$ , and $s_{i}$ are the ground-truth depth, normal vector, and segmentation class of pixel $i$ , while $\widehat{d_{i}}$ , $\widehat{n_{i}}$ , and $\widehat{s_{i}}$ are their estimates. $N$ is the number of pixels in an image. + +
Depthδn% of di such that max{di/di, di/di} < 1.25n
RMSE(1/N ∑i( di-di)2)1/2
Normalδt°% of ni such that ∠(n̂i, ni) < t°
∠meanMean of ∠(n̂i, ni)
SegmentationmIoUAverage IoU ratio over classes
Accuracy% of si such that ŝi = si
+ +Table 4. Performance comparison of the proposed algorithm with the conventional algorithms on the NYUv2 dataset using various architectures with the PNASNet backbone. + +
(a) Full-sharing
Depth δ1Normal δ30°Segmentation Acc.Rank Avg.
Equal weighting74.8% (3)44.8% (4)64.4% (2.5)3.17
Uncert [18]71.9% (5)44.6% (5)64.3% (4)4.67
DWA [25]73.3% (4)44.9% (3)64.4% (2.5)3.17
GLS [6]78.3% (1)46.8% (2)58.1% (5)2.67
Proposed77.5% (2)50.5% (1)65.0% (1)1.33
(b) Multi-decoder
Equal weighting77.6% (1.5)51.8% (4)65.6% (4)3.17
Uncert [18]77.1% (3)53.7% (3)65.6% (4)3.33
DWA [25]74.2% (4)51.6% (5)65.6% (4)4.33
GLS [6]73.0% (5)57.2% (1)66.3% (2)2.67
Proposed77.6% (1.5)56.6% (2)66.9% (1)1.50
(c) Multi-column (cross-stitch [29])
Equal weighting77.7% (5)60.5% (5)65.9% (2)4.00
Uncert [18]78.9% (3)61.4% (3)65.5% (4)3.33
DWA [25]78.6% (4)61.5% (2)65.1% (5)3.67
GLS [6]80.2% (1)61.1% (4)65.6% (3)2.67
Proposed79.0% (2)64.7% (1)66.4% (1)1.33
+ +over multiple trials are compared in Section 4 of the supplemental document, which confirm that the superiority of the proposed algorithm is statistically significant. + +Table 4 summarizes the comparison results using the PNASNet encoders, which have a much higher learning capacity than the MobileNet.v2 encoders. Regardless of encoder backbones, the proposed algorithm consistently outperforms the conventional algorithms. Figure 8 qualitatively compares depth, normal, and segmentation results of the proposed algorithm with those of the equal weighting scheme. The proposed algorithm provides more accurate prediction results with smaller errors. + +Taskonomy: Table 5 compares the results of 4-task learning and 8-task learning on the Taskonomy dataset using the multi-column structure with the MobileNet.v2 backbone. The evaluation protocols for these eight tasks are specified in Section 2 of the supplemental document. In both settings, the proposed algorithm yields the best average ranks 1.75 and 1.88. In the 8-task learning, the proposed algorithm provides the best results in four out of the eight tasks. Also, in terms of the 2D edge loss, the proposed algorithm yields 0.114, which is meaningfully lower than 0.119 of GLS. + +Table 5. Performance comparison of 4-task learning and 8-task learning settings on the Taskonomy dataset using the multi-column architecture with the MobileNet.v2 backbone. + +
(a) 4-task learning
Equal weightingUncertDWAGLSProposed
Depth0.298 (5)0.291 (3)0.292 (4)0.290 (2)0.289 (1)
Normal0.276 (1)0.280 (4)0.282 (5)0.278 (3)0.277 (2)
Curvature0.267 (5)0.264 (3)0.265 (4)0.263 (1.5)0.263 (1.5)
Reshading0.247 (5)0.244 (4)0.242 (2.5)0.239 (1)0.242 (2.5)
Rank Avg.4.003.503.881.881.75
(b) 8-task learning
Depth0.290 (4)0.286 (1)0.288 (3)0.299 (5)0.287 (2)
Normal0.301 (3)0.316 (5)0.300 (2)0.299 (1)0.309 (4)
Curvature0.269 (4)0.274 (5)0.268 (3)0.262 (1)0.267 (2)
Reshading0.238 (2.5)0.238 (2.5)0.239 (4)0.241 (5)0.235 (1)
2D edge0.145 (5)0.135 (3)0.144 (4)0.119 (2)0.114 (1)
3D edge0.552 (1)0.560 (5)0.558 (4)0.555 (2)0.557 (3)
2D keypoint0.126 (4)0.121 (3)0.129 (5)0.103 (2)0.101 (1)
3D keypoint0.106 (5)0.105 (3)0.105 (3)0.105 (3)0.104 (1)
Rank Avg.3.563.443.502.631.88
+ +![](images/b4065e60a982fc11d8b739ddb7af3d710f0dbf0db60b1d8eff51465290d7001a.jpg) +Figure 8. Qualitative comparison of the proposed algorithm with the equal weighting scheme on the NYUv2 dataset with the PNAS-Net backbone. For easier comparison, prediction error maps, as well as predicted results, are provided. In segmentation error maps, erroneously predicted regions are in red. + +![](images/16f273f309953aa29d1a174eae4bdbb9104a94f3d66dfa103250da59bbe243e3.jpg) + +# 4.4. Analysis + +Comparison of loss scale trends: Figure 9 compares the weight and loss scale trends on the NYUv2 dataset over periods. In equal weighting, the segmentation loss is dominant throughout the training. Although Uncert and DWA assign bigger weights to the depth and normal losses than the segmentation loss, the overall loss is still dominated by the segmentation loss. In contrast, the proposed algorithm equalizes the loss scales by adjusting the weights more effectively. Loss scale trends for more experiments are also available in Section 5 of the supplemental document. + +Hyper-parameter $\beta$ : In the default mode, we initialize the hyper-parameter $\beta$ in (9) to 0 and increase it each period. Table 6 compares different settings of $\beta$ . Note that a negative $\beta$ makes the proposed algorithm focus on easy tasks, + +![](images/1f85d8fa59c8778eecbfcd876cfef4d05e49f5b44a22320b0915f9d5fbe0a17e.jpg) + +![](images/461debc1904e8d7b37317fe36fa047184ae28fae9cfdec3692bc46f70b18b66e.jpg) + +![](images/bfbcdb13bcf590d974aa067925b9d7e8f01deef61078d3f5871d464da77ac655.jpg) + +![](images/d2143989f487954cf6fdc8353f14bd5e1300d86391a037ca5c5c41a937fe3462.jpg) + +![](images/13554dbc07da5a34e055507f1dba13bfed2e60209e91df5c7f31994f5f62da2b.jpg) + +![](images/df4210cb6cae138458b5814bbc3172ecb69e735799af2168440d2c49422fb09c.jpg) + +![](images/b32ed661f462cb213ded29d4b89a20584174531c748af879cb3eda4e29a90e34.jpg) +Figure 9. Illustration of weights and loss scales for equal weighting, Uncert [18], DWA [25], and the proposed algorithm. + +![](images/93b74ec86a06d9459f31b314e20a966b012ba02ba9b0da52f0c81d3588c1a339.jpg) + +Table 6. Comparison of various settings of $\beta$ . + +
βDepthNormalSegmentation
δ1RMSEδ30°∠meanmIoUAcc.
-376.3%0.53844.8%36.125.0%56.5%
-178.5%0.51945.3%36.125.5%56.4%
078.6%0.52846.6%36.227.5%58.4%
179.2%0.51048.0%35.628.1%61.6%
377.5%0.53947.6%36.027.1%60.3%
1077.9%0.53745.1%36.021.8%53.5%
Default77.5%0.52250.5%34.132.6%65.0%
+ +while a positive $\beta$ on difficult tasks. At $\beta = 0$ , the difficulty is not taken into account. From the three settings $\beta = -1$ , $\beta = 0$ , and $\beta = 1$ , it is observed that focusing on difficult tasks is more effective. However, as indicated by $\beta = 3$ and $\beta = 10$ , too large a $\beta$ degrades the results, since it causes loss scales to fluctuate excessively in early periods. Figure 10 shows difficulty trends in the default mode. At later periods, with bigger $\beta$ 's, difficulty factors experience larger variations. However, those factors help to balance loss scales more accurately in Figure 9. + +Further analysis and qualitative results are provided in Sections 6, 7, and 8 of the supplemental document. + +Non-pixelwise tasks: The proposed LSB algorithm can be applied to non-pixelwise tasks as well. If the design of appropriate network architecture is preceded, LSB can be applied to a wider range of tasks. We verify this extensibility by learning face landmark localization and face attribute classification using CelebA dataset [27]. Given a face image, the attribute classification performs binary clas + +![](images/58285c05b224f8681f3173d49698a7a028f24ab78214d4fd38184c237c2c04cb.jpg) +Figure 10. Trends of difficulty factors of the proposed algorithm, when $\beta$ gradually increases starting from 0 in the default mode. + +Table 7. Quantitative results on the CelebA dataset. Pixel distance and accuracy are used as the evaluation metrics for the localization and the classification, respectively. Compared with the equal weighting scheme, the proposed algorithm performs better in the localization, while also slightly better in the classification. + +
Landmark localizationAttribute
EyeNoseMouthclassification
Equal weighting0.8592.0441.29090.6%
Proposed0.6411.1720.96390.8%
+ +![](images/8024b7f000acdf33a2ed4948ab8e548b6a59ea3b126e5bce350b8819732bbbc6.jpg) +Figure 11. Qualitative comparison of the proposed algorithm with the equal weighting scheme on the CelebA dataset. The estimated landmark locations are highlighted, and some attribute classification results are provided. + +sification of each of 40 different attributes, which is a non-pixelwise task. The multi-column architecture is adopted for training. For classification, convolutional layers of decoders are substituted with fully connected layers and sigmoid operations. Table 7 and Figure 11 show that LSB can be applied effectively to these tasks as well. + +# 5. Conclusions + +We proposed the LSB algorithm for MTL that adjusts weights to make the network learn all tasks effectively. Instead of controlling the weight of each loss directly, the proposed algorithm balances loss scales periodically. Also, by assessing the difficulty factors of tasks in each period, the proposed algorithm focuses on learning more difficult tasks. Extensive experiments on various pixelwise vision tasks demonstrated that the proposed algorithm outperforms conventional algorithms regardless of architecture, dataset, and encoder backbone. + +# Acknowledgments + +This work was supported by the National Research Foundation of Korea (NRF) grants funded by the Korea government (MSIT) (No. NRF-2018R1A2B3003896 and No. NRF-2021R1A4A1031864). + +# References + +[1] R. K. Ando and T. Zhang. A framework for learning predictive structures from multiple tasks and unlabeled data. J. Mach. Learn. Res., 6:1817-1853, Nov. 2005. 1 +[2] A. Argyriou, T. Evgeniou, and M. Pontil. Multi-task feature learning. In NIPS, 2007. 1 +[3] S. Ben-David and R. Schuller. Exploiting task relatedness for multiple task learning. In Learning Theory and Kernel Machines, 2003. 1 +[4] R. Caruana. Multitask learning. Machine Learning, 28(1):41-75, 1997. 1 +[5] Z. Chen, V. Badrinarayanan, C. Y. Lee, and A. Rabinovich. GradNorm: Gradient normalization for adaptive loss balancing in deep multitask networks. In ICML, 2018. 2, 6 +[6] S. Chennupati, G. Sistu, S. Yogamani, and S. A Rawashdeh. MultiNet++: Multi-stream feature aggregation and geometric loss strategy for multi-task learning. In CVPR Workshops, 2019. 1, 2, 6, 7 +[7] R. Collobert and J. Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In ICML, 2008. 1, 2 +[8] L. Deng, G. Hinton, and B. Kingsbury. New types of deep neural network learning for speech recognition and related applications: An overview. In ICASSP, 2013. 1 +[9] C. Doersch and A. Zisserman. Multi-task self-supervised visual learning. In ICCV, 2017. 2 +[10] D. Dong, H. Wu, W. He, D. Yu, and H. Wang. Multi-task learning for multiple language translation. In Proc. ACL and IJCNLP, 2015. 1 +[11] T. Evgeniou and M. Pontil. Regularized multi-task learning. In Proc. KDD, 2004. 1 +[12] C. Fernando, D. Banarse, C. Blundell, Y. Zwols, D. Ha, A. A. Rusu, A. Pritzel, and D. Wierstra. PathNet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017. 1, 2 +[13] G. Gkioxari, B. Hariharan, R. Girshick, and J. Malik. R-CNNs for pose estimation and action detection. arXiv preprint arXiv:1406.5212, 2014. 2 +[14] M. Guo, A. Haque, D. A. Huang, S. Yeung, and L. Fei-Fei. Dynamic task prioritization for multitask learning. In ECCV, 2018. 1, 2 +[15] M. Heo, J. Lee, K.-R. Kim, and C.-S. Kim. Monocular depth estimation using whole strip masking and reliability-based refinement. In ECCV, 2018. 2 +[16] J. T. Huang, J. Li, D. Yu, L. Deng, and Y. Gong. Cross-language knowledge transfer using multilingual deep neural network with shared hidden layers. In ICASSP, 2013. 1, 2 +[17] M. Jaderberg, V. Mnih, W. M. Czarnecki, T. Schaul, J. Z. Leibo, D. Silver, and K. Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In ICLR, 2016. 1 +[18] A. Kendall, Y. Gal, and R. Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In CVPR, 2018. 1, 2, 6, 7, 8 +[19] I. Kokkinos. UberNet: Training a universal convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. In CVPR, 2017. 1, 2 + +[20] J. H. Lee, M. Heo, K.-R. Kim, and C.-S. Kim. Single-image depth estimation based on fourier domain analysis. In CVPR, 2018. 2 +[21] J. H. Lee and C.-S. Kim. Monocular depth estimation using relative depth maps. In CVPR, 2019. 2 +[22] J.-H. Lee and C.-S. Kim. Multi-loss rebalancing algorithm for monocular depth estimation. In ECCV, 2020. 2 +[23] C. Li, J. Yan, F. Wei, W. Dong, Q. Liu, and H. Zha. Self-paced multi-task learning. In AAAI, 2017. 2 +[24] C. Liu, B. Zoph, M. Neumann, J. Shlens, W. Hua, L. J. Li, L. Fei-Fei, A. Yuille, J. Huang, and K. Murphy. Progressive neural architecture search. In ECCV, 2018. 6 +[25] S. Liu, E. Johns, and A. J. Davison. End-to-end multi-task learning with attention. In CVPR, 2019. 1, 2, 6, 7, 8 +[26] X. Liu, P. He, W. Chen, and J. Gao. Multi-task deep neural networks for natural language understanding. In Proc. ACL, 2019, 2 +[27] Z. Liu, P. Luo, X. Wang, and X. Tang. Deep learning face attributes in the wild. In ICCV, 2015. 8 +[28] M. T. Luong, Q. V. Le, I. Sutskever, O. Vinyals, and L. Kaiser. Multi-task sequence to sequence learning. In ICLR, 2016. 1 +[29] I. Misra, A. Shrivastava, A. Gupta, and M. Hebert. Cross-stitch networks for multi-task learning. In CVPR, 2016. 1, 2, 5, 6, 7 +[30] A. Pentina, V. Sharmanska, and C. H. Lampert. Curriculum learning of multiple tasks. In CVPR, 2015. 1, 2 +[31] P. Rajeev R. Ranjan, V. M. Patel, and R. Chellappa. HyperFace: A deep multi-task learning framework for face detection, landmark localization, pose estimation, and gender recognition. IEEE Trans. Pattern Anal. Mach. Intell., 41(1):121-135, Dec. 2017. 2 +[32] S. A. Rebuffi, H. Bilen, and A. Vedaldi. Learning multiple visual domains with residual adapters. In NIPS, 2017. 1 +[33] S. Ruder, J. Bingel, I. Augenstein, and Anders A. Søgaard. Learning what to share between loosely related tasks. arXiv preprint arXiv:1705.08142, 2017. 2 +[34] S. Ruder, J. Bingel, I. Augenstein, and A. Søgaard. Latent multi-task architecture learning. In AAAI, 2019. 1 +[35] A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 1, 2 +[36] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. C. Chen. MobileNetV2: Inverted residuals and linear bottle-necks. In CVPR, 2018. 6 +[37] N. Sarafianos, T. Giannakopoulos, C. Nikou, and I. A. Kakadiaris. Curriculum learning for multi-task classification of visual attributes. In ICCV Workshops, 2017. 1, 2 +[38] D. Scharstein and R. Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. Int. J. Comput. Vis., 47:7-42, Apr. 2002. 6 +[39] M. L. Seltzer and J. Droppo. Multi-task learning in deep neural networks for improved phoneme recognition. In ICASSP, 2013. 1, 2 +[40] O. Sener and V. Koltun. Multi-task learning as multi-objective optimization. In NIPS, 2018. 2 + +[41] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun. OverFeat: Integrated recognition, localization and detection using convolutional networks. arXiv preprint arXiv:1312.6229, 2013. 2 +[42] N. Silberman, D. Hoiem, P. Kohli, and R. Fergus. Indoor segmentation and support inference from RGBD images. In ECCV, 2012. 5, 6 +[43] D. Xu, W. Ouyang, X. Wang, and N. Sebe. PAD-Net: Multi-tasks guided prediction-and-distillation network for simultaneous depth estimation and scene parsing. In CVPR, 2018. 2 +[44] Z. Yin and J. Shi. GeoNet: Unsupervised learning of dense depth, optical flow and camera pose. In CVPR, 2018. 1 +[45] A. R. Zamir, A. Sax, W. Shen, L. J. Guibas, J. Malik, and S. Savarese. Taskonomy: Disentangling task transfer learning. In CVPR, 2018. 5, 6 +[46] Z. Zhang, Z. Cui, and C. Xu. Pattern-affinitive propagation across depth, surface normal and semantic segmentation. In CVPR, 2019. 1 +[47] Z. Zhang, P. Luo, C. C. Loy, and X. Tang. Facial landmark detection by deep multi-task learning. In ECCV, 2014. 2 +[48] L. Zhou, Z. Cui, C. Xu, Z. Zhang, C. Wang, T. Zhang, and J. Yang. Pattern-structure diffusion for multi-task learning. In CVPR, 2020. 2 \ No newline at end of file diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/images.zip b/learningmultiplepixelwisetasksbasedonlossscalebalancing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c8a52583eb5a13b169464143107ecbd85d9fae18 --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45308eb9516181e4488a5974b9b9b3a86f44cb72c338e981d71c334c7804f646 +size 873954 diff --git a/learningmultiplepixelwisetasksbasedonlossscalebalancing/layout.json b/learningmultiplepixelwisetasksbasedonlossscalebalancing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..15b5ae62e2a4dc40ab06b9fc74f55a8845785b12 --- /dev/null +++ b/learningmultiplepixelwisetasksbasedonlossscalebalancing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:122b7f1e24975ac9e2c542613cf0af1210ce26cfa843cc9f058705e10a7365c6 +size 488587 diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_content_list.json b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fec6f2ac314f60dccfce77576259ce5809b8ee4a --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:657d3a7fe21d5b5fb17bc09bc77b191fa963d3ca229d24bc0bdbfad5e9d533a7 +size 74564 diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_model.json b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b4d4e0c9418d69fcb5f10c02396ad4fe572daad1 --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47540ad63e80d2804b6cb30fea37436ccca9e3ae378d019d3b85f8f2d30074ac +size 90349 diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_origin.pdf b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3bb79d5a4ac47f79553df9d6127133e14995187f --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/9aa4134b-1a7b-46b0-b1d3-c6e06362ce59_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94b775c0e8af94308cfa2781c3e0a1dc62270f0fe6ab00c06d26f64ed638888c +size 1649866 diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/full.md b/learningmultisceneabsoluteposeregressionwithtransformers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..40cd1407a5914015356c2eb28127cc78186b520c --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/full.md @@ -0,0 +1,299 @@ +# Learning Multi-Scene Absolute Pose Regression with Transformers + +Yoli Shavit Ron Ferens Yosi Keller + +Faculty of Engineering, Bar Ilan University, Ramat-Gan, Israel + +{yolisha, ronferens, yosi.keller}@gmail.com + +# Abstract + +Absolute camera pose regressors estimate the position and orientation of a camera from the captured image alone. Typically, a convolutional backbone with a multi-layer perceptron head is trained using images and pose labels to embed a single reference scene at a time. Recently, this scheme was extended for learning multiple scenes by replacing the MLP head with a set of fully connected layers. In this work, we propose to learn multi-scene absolute camera pose regression with Transformers, where encoders are used to aggregate activation maps with self-attention and decoders transform latent features and scenes encoding into candidate pose predictions. This mechanism allows our model to focus on general features that are informative for localization while embedding multiple scenes in parallel. We evaluate our method on commonly benchmarked indoor and outdoor datasets and show that it surpasses both multi-scene and state-of-the-art single-scene absolute pose regressors. We make our code publicly available from https://github.com/yolish/multi-scenePose-transformer. + +# 1. Introduction + +Localizing a camera using a query image is a key task in many computer vision applications, such as indoor navigation, augmented reality and autonomous driving, to name a few. Contemporary approaches for estimating the position and orientation of a camera offer different trade-offs between accuracy, runtime, and memory. For example, hierarchical localization pipelines [26, 30, 25] achieve state-of-the-art (SOTA) pose accuracy, but are relatively slow (response time of hundreds of milliseconds) and require a large memory footprint and client-server connectivity. These approaches employ image retrieval (IR) to fetch images that are similar to the query image, followed by local features extraction and matching. The extracted 2D-2D matches are mapped to 2D-3D correspondences via depth or a 3D point cloud, and are then used to estimate the camera pose with Perspective-n-Point (PnP) and RANSAC [13]. Absolute pose regressors (APRs), on the other hand, estimate + +![](images/31d6fc12d3875721721f16cee34faf3ecf13814fefc34d64987fe489da0e8190.jpg) +Figure 1: Multi-scene absolute pose regression with Transformers. Two Transformers separately attend to position- and orientation- informative features from a convolutional backbone. Scene-specific queries (0-3) are further encoded with aggregated activation maps into latent representations, from which a single output is selected. The strongest response, shown as an overlaid color-coded heatmap of attention weights, is obtained with the output associated with the input image's scene. The selected outputs are used to regress the position $x$ and the orientation $q$ . + +the camera pose with a single forward pass, using only the query image. They are an order of magnitude faster and can be deployed as a standalone application on a thin client due to their small memory footprint. Unfortunately, APRs are also an order of magnitude less accurate compared to hierarchical localization pipelines and to other methods utilizing 3D data at inference time [27]. Moreover, most APRs are designed to embed a single scene at a time, implying that for a dataset with $N$ scenes (for example, a hospital with many wards and rooms), $N$ models are required to be trained, deployed and chosen from during inference. In this work, we focus on improving the accuracy of APRs while extending the current single-scene paradigm for learning multiple scenes in parallel. + +The formulation of absolute camera pose regression was first suggested by Kendall et al. [17]. Following the success of convolutional neural networks (CNNs) in learning different computer vision tasks, the authors suggested to adapt + +a GoogLeNet architecture to camera pose regression by attaching a multi-layer perceptron (MLP) head to regress the camera position and orientation. The proposed architecture denoted PoseNet, offered a novel, fast and lightweight solution for camera localization. However, it also suffered from low accuracy and limited generalization. Various absolute pose regression methods were suggested to address these issues, proposing modifications to the backbone and MLP architecture [20, 21, 35, 37, 29, 36, 8], as well as different loss formulations and optimization strategies [15, 16, 28]. Despite their variety, such APRs share two common traits: (1) employing a CNN backbone to output a single global latent vector which is used for regressing the pose (2) training a model per scene (scene-specific APRs). + +Recently, Blanton et al. [3] suggested a method for extending single-scene absolute pose regression to a multi-scene paradigm. Similarly to existing APRs, this method applies a CNN backbone for generating a latent global descriptor of the image. However, instead of using a single scene-specific MLP, it trains a set of Fully Connected (FC) layers, with a layer per scene, which is indexed based on the predicted scene identifier. While offering a new general framework for optimizing a single model for multiple scenes, this method was unable to match the accuracy of contemporary SOTA APRs. + +In this work, we propose a novel formulation of multiscene absolute pose regression, inspired by recent successful applications of Transformers to computer vision tasks such as object detection [9] and image recognition [11]. These works demonstrated the effectivity of encoders in focusing on latent features (in image patches or activation maps) that are informative for particular tasks, through self-attention aggregation. In addition, decoders were shown to successfully generate multiple independent predictions, corresponding to queries, based on the input embedding [9]. Similarly, we propose to apply Transformers to multiscene absolute pose regression, using encoders to focus on pose-informative features and decoders to transform encoded scene identifiers to latent pose representations (Fig. 1). As pose estimation involves two different tasks (position and orientation estimation), related to different visual cues, we apply a shared convolutional backbone at two different resolutions and use two different Transformers, one per task. The decoders' outputs are used to classify the scene and select the respective position and orientation embeddings, from which the position and orientation vectors are regressed. + +We evaluate our approach on two commonly benchmarked datasets, consisting of multiple outdoor and indoor localization challenges. We show that our method not only provides a new SOTA accuracy for multi-scene $APR$ localization, but importantly provides a new SOTA for single-scene $APRs$ . Moreover, we show that our approach achieves competitive + +results even when trained across multiple datasets of significantly different characteristics. We further conduct multiple ablations to evaluate the sensitivity of our model to different design choices and analyze its scalability in terms of runtime and memory. In summary, our main contributions are as follows: + +- We propose a novel formulation for multi-scene absolute pose regression using Transformers. +- We experimentally demonstrate that self-attention allows aggregation of positional and rotational image cues. +- Our approach is shown to achieve new SOTA accuracy for both multi-scene and single-scene APRs across contemporary outdoor and indoor localization benchmarks. + +# 2. Related Work + +Camera pose estimation methods can be divided into several families, depending on the inputs at inference time and on their algorithmic characteristics. + +Image Retrieval methods learn global image descriptors for retrieving database images that depict the vicinity of the area captured by the query image. They are commonly employed by pose estimation methods such as structure-based hierarchical localization pipelines [30, 25, 22, 12] and relative pose regression methods [2, 18, 10]. IR can also be applied for estimating the camera pose by taking the pose of the most similar fetched image, or by interpolating the poses of several visually close images. Such approaches require both storing and searching through large databases with pose labels. Recently, Sattler et al. [27] proposed an IR-based baseline for camera pose regression to illustrate the limitations of APRs, as no regressor was able to consistently surpass it on multiple localization tasks. + +3D-based Localization methods, also referred to as structure-based methods [26, 27], include camera pose estimation techniques that utilize the correspondences between 2D image positions and 3D world coordinates for camera localization with PnP and RANSAC. Hierarchical pose estimation pipelines [30, 25, 22, 12] are based on a two-phase approach, utilizing global (IR) and local matching. Each query image to be localized, is first encoded using a CNN trained for IR, and a relatively small set of nearest neighbors is retrieved from a large-scale image dataset. Tentative 2D-2D correspondences are estimated by matching local image features, and are then mapped into 2D-3D matches. The resulting matches are passed to PnP-RANSAC for estimating the camera pose. Such pipelines were shown to achieve SOTA accuracy on large-scale benchmarks with challenging conditions [30, 25]. However, these approaches are slower than other localization methods by an order or + +two orders of magnitude and are typically deployed with a client-server architecture due to the large storage space needed. A different body of works directly regresses the 3D coordinates from 2D positions in the image. Brachmann and Rother derived the DSAC [4] and the follow-up DSAC++ [5] schemes, where a CNN architecture is trained to estimate the 3D locations of the pixels in the query image, in order to establish 2D-3D correspondences for estimating the camera pose with PnP-RANSAC. These methods only require the query image at inference time, and achieve SOTA accuracy, which is competitive with hierarchical localization pipelines. However, similar to APRs, a model needs to be trained per scene. In addition, these methods are challenging to implement, require a long time to converge and are slower (100ms) by order of magnitude compared to absolute pose regression approaches (10ms) at inference time [3]. They also suffer from a non-deterministic behavior due to the inherent randomness of RANSAC. + +Relative Pose Regression methods combine camera pose regression with an IR scheme. The absolute camera pose is computed by first estimating the relative motion (translation and rotation) between the query image and a set of reference images, for which the ground truth pose is known. An IR scheme is applied to retrieve a set of nearest neighbors images, and a relative motion regression is separately computed between the query image and each of the retrieved images, followed by pose interpolation. The learning thus focuses on regressing the relative pose given a pair of images [2, 18, 10]. These relative pose regressors (RPRs) were shown to generalize better than APRs and to improve the accuracy on small scale indoor benchmarks [10]. However, similar to other IR-based schemes, such approaches require a retrieval phase and a pose-labelled database during inference time. When the images are sequentially acquired over time, combining relative and absolute regression was shown to significantly improve the pose accuracy [33, 24]. + +Absolute Pose Regression was first proposed by [17] to directly regress the position and orientation of the camera, given the input image, by attaching an MLP head to a GoogLeNet backbone. The resulting architecture, named PoseNet, was far less accurate than 3D-based methods, but enabled pose estimation using a single forward pass, offering a much lighter and faster localization alternative. In order to improve the localization accuracy, contemporary APRs studied different CNN backbones [20, 21, 37, 29] and MLP heads [37, 21]. Overfitting was addressed by averaging the predictions of multiple models with randomly dropped activations [15], or by reducing the dimensionality of the global image encoding using Long-Short-TermMemory (LSTM) layers [35]. Other works focused on the loss formulation for absolute pose regression in order to enable adaptive weighing of the position and orientation associated errors. Kendall et al. [16] suggested to optimize + +the parameters balancing both losses for improving accuracy and avoiding manual fine-tuning. This formulation was adopted by many pose regressors. Alternative orientation representations were also proposed to improve the pose loss [37, 7]. The use of additional sensors, such as inertial sensors, was also suggested to improve the localization accuracy [7]. More recently, Wang et al. [36] proposed to use attention for guiding the regression process by applying self-attention on the output of the CNN backbone. The new attention-based representation was used to regress the pose with an MLP head. While many modifications were proposed to the architecture and loss originally formulated by Kendall et al., the main paradigm remained the same: (1) employing a CNN backbone to output a global latent vector which is used for absolute pose regression (2) training a separate model per scene. + +Multi-Scene Absolute Pose Regression methods aim to extend the absolute pose regression paradigm for learning a single model on multiple scenes. Blanton et al. proposed the Multi-Scene PoseNet (MSPN), a novel multi-scene absolute pose regression approach [3], where the network first classifies the particular scene related to the input image, and then uses it to index a set of scene-specific weights for regressing the pose. An activation map from a CNN backbone, which is shared across scenes, is used both for scene classification and regressing the pose. A fully connected layer with SoftMax predicts the scene and is trained via Binary Cross Entropy. A set of FC layers, one per scene, is trained for absolute camera pose regression with a set of scene-specific parameterized losses. The notion of multiscene camera pose estimation was also applied to 3D-based methods which regresses the 3D coordinates from image pixels. However, the suggested framework still involved training multiple models (one per scene) and then selecting the most appropriate model using a mixture-of-experts strategy [6]. + +In this work, we focus on learning a single unified deep learning model for absolute pose regression across multiple scenes. Our method is thus closely related to single- and multi-scene absolute pose regression and we compare it to leading architectures (APRs) in this field. We include additional background on Attention and Transformers in the supplementary material. + +# 3. Multi-Scene Absolute Camera Pose Regression with Transformers + +A single/multi-scene APR localizes the capturing camera with a forward pass on the input image. The camera pose $\mathbf{p}$ is typically represented by the tuple $<\mathbf{x}, \mathbf{q}>$ where $\mathbf{x} \in \mathbb{R}^3$ is the position of the camera in the world coordinates and $\mathbf{q} \in \mathbb{R}^4$ is the quaternion encoding of its 3D orientation. Following the success of recent visual Transformers [9, 11], we employ separate positional and orien + +![](images/45510baebc1fa066364087480b021226d1f0ed7a01c591e6c474f6c8f53eab47.jpg) +Figure 2: The architecture of our proposed model. + +tational Transformer Encoders for adaptive aggregation of (flattened) intermediate activation maps computed by a convolutional backbone. In particular, as depicted in Fig. 3, the positional and orientational encoders emphasize different image cues: corner and blob-like image cues are position-informative, in contrast to the elongated edges emphasized by the orientational encoder. In order to attend to $N$ scenes we also apply separate positional and orientational Transformer Decoders, that are queried by $\{\mathbf{x}_i\}_{1}^N$ and $\{\mathbf{q}_i\}_{1}^N$ , for the position and orientation embeddings per scene, respectively. The corresponding output sequences, $\{\mathbf{X}_i\}_{1}^N$ and $\{\mathbf{Q}_i\}_{1}^N$ , respectively, encode the localization parameters per scene. This architecture is inspired by the DETR approach [9], where a single activation map is queried by multiple queries, each related to a different task. Together, the encoder-decoder Transformer architecture allows to attend to localization-informative image content while learning multiple scenes at once. In order to regress the pose, the scene is first classified by concatenating $\{\mathbf{X}_i\}_{1}^N$ and $\{\mathbf{Q}_i\}_{1}^N$ , and the embeddings of the detected scene $\{\mathbf{X}_i, \mathbf{Q}_i\}$ are regressed by the MLP heads. + +# 3.1. Network Architecture + +The architecture of our model is shown in Fig. 2. Given an image $\mathbf{I} \in \mathbb{R}^{H \times W \times C}$ , we sample a convolutional backbone at two different resolutions and take an activation map per regression task: $A_{\mathbf{x}}$ and $A_{\mathbf{q}}$ , for position and orientation regression, respectively (Fig. 2a). In order to transform activation maps into Transformer-compatible inputs, we follow the same sequence preparation procedure as in [9]. An acti + +vation map $\mathbf{A} \in \mathbb{R}^{H_a \times W_a \times C_a}$ is first converted to a sequential representation $\widehat{\mathbf{A}} \in \mathbb{R}^{H_a \cdot W_a \times C_d}$ using a $1 \times 1$ convolution (projecting to dimension $C_d$ ) followed by flattening (Figure 2b). Each position in the activation map is further assigned with a learned encoding to preserve the spatial information of each location. In order to reduce the number of parameters, two one-dimensional encodings are separately learned for the $X,Y$ axes. Specifically, for an activation map $\mathbf{A}$ we define the sets of positional embedding vectors $\mathbf{E}_u \in \mathbb{R}^{(W_a) \times C_d/2}$ and $\mathbf{E}_v \in \mathbb{R}^{(H_a) \times C_d/2}$ , such that a spatial position $(i,j)$ , $i \in 1..H_a$ , $j \in 1..W_a$ , is encoded by the concatenating of the two corresponding embedding vectors: + +$$ +\mathbf {E} _ {p o s} ^ {i, j} = \left[ \begin{array}{l} \mathbf {E} _ {u} ^ {j} \\ \mathbf {E} _ {v} ^ {i} \end{array} \right] \in \mathbb {R} ^ {C _ {d}}. \tag {1} +$$ + +The processed sequence, serving as input to the Transformer is thus given by: + +$$ +\mathbf {Z} _ {\widehat {A}} ^ {0} = \widehat {\mathbf {A}} + \mathbf {E} _ {\mathbf {A}} \in \mathbb {R} ^ {H _ {a} \cdot W _ {a} \times C _ {d}} \tag {2} +$$ + +where $\mathbf{E}_{\mathbf{A}}$ is the positional encoding of $A$ . This processing is applied separately for each of the two activation maps (for the position and orientation Transformers, respectively). + +We use the Transformer architecture described in [9], using standard Encoder and Decoder architectures modified to add the position encodings at each attention layer. A Transformer Encoder is composed of $L$ identical layers each consisting of multi-head attention (MHA) and multi-layer perceptron (MLP) modules. Each layer $l$ , $l = 1..L$ , performs the following computation by applying a LayerNorm (LN) + +[1] before each module and adding back the input with residual connections: + +$$ +\mathbf {Z} _ {\widehat {A}} ^ {l ^ {\prime}} = M H A \left(L N \left(\mathbf {Z} _ {\widehat {A}} ^ {l - 1}\right)\right) + \mathbf {Z} _ {\widehat {\mathbf {A}}} ^ {\mathbf {l} - \mathbf {1}} \in \mathbb {R} ^ {H _ {a} \cdot W _ {a} \times C _ {d}} \tag {3} +$$ + +$$ +\mathbf {Z} _ {\widehat {A}} ^ {l} = M L P \left(L N \left(\mathbf {Z} _ {\widehat {A}} ^ {l ^ {\prime}}\right)\right) + \mathbf {Z} _ {\widehat {A}} ^ {1 ^ {\prime}} \in \mathbb {R} ^ {H _ {a} \cdot W _ {a} \times C _ {d}} \tag {4} +$$ + +At the final layer, $L$ the output is passed through an additional normalization: + +$$ +\mathbf {Z} _ {\hat {A}} ^ {L} = L N \left(\mathbf {Z} _ {\hat {A}} ^ {L}\right) \tag {5} +$$ + +Given a dataset with $N$ scenes, the Transformer Decoders first applies self-attention as in Eq. 3 to the two learnt query sequences, $\{\mathbf{x}_i\}_{1}^N$ and $\{\mathbf{q}_i\}_{1}^N$ (Fig. 2c), for the position and orientation decoders, respectively. Eqs. 3-4 are then applied again, but this time computing encoder-decoder attention instead of self-attention. As oppose to earlier auto-regressive decoders [34], this architecture outputs predictions in parallel for all positions. We refer the reader to [34, 9] for detailed definitions of the MHA operation and parallel decoding. The Transformers' Decoders output the sequences $\{\mathbf{X}_i\}_{1}^N$ and $\{\mathbf{Q}_i\}_{1}^N$ , with a latent embedding for each scene (Fig. 2d). However, given a query image, only one position corresponds to the scene from which the image was taken. In order to select the appropriate scene, we append the outputs of the two transformers (Fig. 2e) as $\{\mathbf{Z}_i\}_{1}^N$ such that + +$$ +\mathbf {Z} _ {i} = \left[ \begin{array}{l} \mathbf {X} _ {i} \\ \mathbf {Y} _ {i} \end{array} \right] \in \mathbb {R} ^ {2 C _ {d}}, \tag {6} +$$ + +and pass them through a fully connected layer followed by Log SoftMax. The vectors at the position with the maximal probability are then chosen (Fig. 2f). The selected Transformers outputs $\{\mathbf{X}_i, \mathbf{Q}_i\}$ are passed to a respective MLP head with one hidden layer and gelu non-linearity to regress the target vectors, $\mathbf{x}$ (Fig. 2g) or $\mathbf{q}$ . + +# 3.2. Multi-Scene Camera Pose Loss + +We train our model to minimize both the position loss $L_{\mathbf{x}}$ and the orientation loss $L_{\mathbf{q}}$ , with respect to a ground truth pose $\mathbf{p}_0 = < \mathbf{x}_0, \mathbf{q}_0 >$ , given by: + +$$ +L _ {\mathbf {x}} = \left\| \mathbf {x} _ {0} - \mathbf {x} \right\| _ {2} \tag {7} +$$ + +$$ +L _ {\mathbf {q}} = \left\| \mathbf {q} _ {0} - \frac {\mathbf {q}}{\| \mathbf {q} \|} \right\| _ {2} \tag {8} +$$ + +where $q$ is normalized to a unit norm quaternion in order to ensure it is a valid orientation encoding. We combine the two losses using the camera pose loss formulation suggested by Kendall et al. [16]: + +$$ +L _ {\mathbf {p}} = L _ {\mathbf {x}} \exp (- s _ {\mathbf {x}}) + s _ {\mathbf {x}} + L _ {\mathbf {q}} \exp (- s _ {\mathbf {q}}) + s _ {\mathbf {q}} \tag {9} +$$ + +where $s_{\mathbf{x}}$ and $s_{\mathbf{q}}$ are learned parameters controlling the balance between the two losses. Since our model is also required to classify the scene from which the image was taken, we further add a Negative Log Likelihood (NLL) loss term, computed with respect to the ground truth scene index $s_0$ . Given an estimated pose $p$ and the log probability distribution $s$ of the predicted scene, our overall loss is given by: + +$$ +L _ {\text {m u l t i - s c e n e}} = L _ {\mathbf {p}} + N L L (\mathbf {s}, \mathbf {s} _ {0}) \tag {10} +$$ + +# 3.3. Implementation Details + +Our model is implemented in PyTorch [23]. We use a pre-trained EfficientNet-B0 [31], available through an open source implementation [19], and take $A_{\mathbf{x}}$ and $A_{\mathbf{q}}$ at two different resolutions: $A_{\mathbf{x}} \in \mathbb{R}^{14 \times 14 \times 112}$ and $A_{\mathbf{q}} \in \mathbb{R}^{28 \times 28 \times 40}$ . We set $C_d = 256$ for the dimension of inputs of the Transformer components. All encoders and decoders consist of six layers with gelu non-linearity and with a dropout of $p = 0.1$ . Each (encoder/decoder) layer uses four heads MHA and a two-layers MLP with a hidden dimension $C_h = C_d$ . + +The two MLP heads, regressing the position and orientation vectors, respectively, expand the decoder dimension to 1024 with a single hidden layer. Our code is publicly available from https://github.com/yolish/multi-scene-posedetransformer, providing the model implementation along with a training and evaluation framework. + +# 4. Experimental Results + +# 4.1. Experimental Setup + +Datasets. We evaluate our approach using the Cambridge Landmarks [17] and the 7Scenes [14] datasets, which are commonly used for evaluating pose regression methods. The Cambridge Landmarks dataset consists of six medium-sized scenes ( $\sim 900 - 5500m^2$ ) set in an urban environment. For our comparative analysis, we consider four scenes that are typically benchmarked by APRs. The 7Scenes dataset includes seven small-scale scenes ( $\sim 1 - 10m^2$ ) set in an office indoor environment. + +Training Details. We optimize our model to minimize the loss in Eq. 10 using Adam, with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ and $\epsilon = 10^{-10}$ . The loss parameters (Eq. 9) are initialized as in [33]. Throughout all experiments we use a batch size of 8 and an initial learning rate of $\lambda = 10^{-4}$ . At train time, the decoder output is selected using the ground truth scene index, and the estimated scene index is used only for evaluating the NLL loss. During inference, the scene index is not known and we rely on the prediction of our model, taking the index with the highest (log) probability. Note that instead of training a model per scene (typically with scene-specific training hyper-parameters) as in single APRs, here we train a single model for all the scenes together. Ad + +Table 1: Comparative analysis of MSPN and our method on the Cambridge Landmarks dataset (outdoor localization). We report the median position/orientation error in meters/degrees for each method. Bold highlighting indicates better performance. + +
MethodK. CollegeOld HospitalShop FacadeSt. Mary
MSPN [3]1.73/3.652.55/4.052.92/7.492.67/6.18
MS-Transformer (ours)0.83/1.471.81/2.390.86/3.071.62/3.99
+ +Table 2: Comparative analysis of our method and MSPN on the 7Scenes dataset (indoor localization). We report the median position/orientation error in meters/degrees for each method. Bold highlighting indicates better performance. + +
MethodChessFireHeadsOfficePumpkinKitchenStairs
MSPN[3]0.09/4.760.29/10.50.16/13.10.16/6.80.19/5.50.21/6.610.31/11.63
MS-Transformer (ours)0.11/4.660.24/9.60.14/12.190.17/5.660.18/4.440.17/5.940.26/8.45
+ +Table 3: Localization results for the Cambridge Landmarks dataset. We report the average of median position/orientation errors in meters/degrees and the respective rankings. Best results are highlighted in bold. + +
MethodAverage [m/deg]Ranks
Single-scene APRs
PoseNet [17]2.09/6.8410/11
BayesianPN [15]1.92/6.288/10
LSTM-PN [35]1.30/5.522/9
SVS-Pose [21]1.33/5.173/7
GPoseNet [8]2.08/4.596/3
PoseNet-Learnable [16]1.43/2.855/2
GeoPoseNet [16]1.63/2.866/3
MapNet [7]1.63/3.646/5
IRPNet [29]1.42/3.454/4
Multi-scene APRs
MSPN [3]2.47/5.3411/8
MS-Transformer (Ours)1.28/2.731/1
+ +ditional details of augmentation and training are provided in the supplementary material. All experiments reported in this paper were performed on an 8Gb NVIDIA GeForce GTX 1080 GPU. + +# 4.2. Comparative Analysis of APRs + +Our method aims to offer a multi-scene absolute pose regression paradigm which also improves the accuracy obtained by current APRs. Hence, we compare our approach both to MSPN, which is, to the best of our knowledge, the only other multi-scene APR, as well as to leading single-scene APRs. We do not include the localization schemes detailed in Section 2, which are an order of magnitude slower (3D-based scene coordinate regression [4, 5]), or that utilize additional data at inference time (localization pipelines [30, 25, 22, 12] and relative pose regression [2, 18, 10]). Tables 1 and 2 show the results obtained with our method (MS-Transformer) and with MSPN on the CambridgeLandmarks and the 7Scenes datasets, respectively. + +Table 4: Localization results for the 7Scenes dataset. We report the average of median position/orientation errors in meters/degrees and the respective rankings. Best results are highlighted in bold. + +
MethodAverage [m/deg]Ranks
Single-scene APRs
PoseNet [17]0.44/10.410/11
BayesianPN [15]0.47/9.8111/8
LSTM-PN [35]0.31/9.868/9
GPoseNet [8]0.31/9.958/8
PoseNet-Learnable [16]0.24/7.877/4
GeoPoseNet [16]0.23/8.125/5
MapNet [7]0.21/7.784/3
IRPNet [29]0.23/8.495/7
AttLoc [36]0.20/7.562/2
Multi-scene APRs
MSPN [3]0.20/8.412/6
MS-Transformer (Ours)0.18/ 7.281/1
+ +Table 5: Localization results with single-scene, multi-scene and multi-dataset learning. We report the average of median position/orientation errors in meters/degrees for the CambridgeLandmarks and 7Scenes datasets. + +
APR MethodCambridgeLand. [m/deg]7Scenes [m/deg]
Single-scene [16]1.43/2.850.24/7.87
Multi-scene (Ours)1.28/2.730.18/7.28
Multi-dataset (Ours)1.50/ 2.570.22/6.78
+ +Since MSPN was trained on different scene combinations from the CambridgeLandmarks dataset, we take the best performing model reported by the authors on this dataset [3]. Our method consistently outperforms MSPN across outdoor and indoor scenes, reducing both position and orientation errors. + +We further compare our results to contemporary absolute pose regression solutions. Tables 3-4 show the performance obtained by different APRs, MSPN and our method on + +the CambridgeLandmarks and the 7Scenes datasets, respectively. We report the average of median position and orientation errors across all scenes in each dataset and the respective ranking (where top-1 corresponds to the smallest error). Our method ranks first on both indoor and outdoor localization, achieving the smallest position and orientation errors. Interestingly, the two best performing APRs on the 7Scenes dataset (AttLoc and our method) both use the attention mechanism for pose regression. + +We can further extend the notion of multi-scene learning to multi-dataset learning, where a single model is trained on completely separate datasets, potentially displaying different challenges and attributes. In order to evaluate the effect of such an extension, we train our model on both the 7Scenes and Cambridge Landmarks datasets together. Table 5 shows the average pose error per dataset for a state-of-the-art single-scene APR [16] and our model, trained in multi-scene and in multi-dataset modes. Although some degradation is observed when training on both datasets together, our model still maintains competitive performance and outperforms the single-scene model. This is despite the two datasets depicting significantly different environments and challenges (mid-scale outdoor versus small-scale indoor). We also evaluate the ability of our model to correctly classify the scene of the input query image. Our model achieves an average accuracy of $98.9\%$ (across scenes) allowing for a reliable selection of the decoder output, which is essential for regressing the pose. Additional analysis of our model scalability (runtime and memory) is provided in the supplementary material. + +# 4.3. Attention Maps Visualization and Interpretation + +The visualization of attention maps in attention-based schemes provides an intuitive interpretation of the visual cues captured by the Transformer Encoder. For this purpose, we visualize the upsampled attention weights of the last encoder layer as heatmaps that are overlaid on the input images. Figure 3 shows the attention map of an image taken from the Chess scene in the 7Scenes dataset. We show the activations when training on three and on seven scenes (top and bottom row, respectively). Training on more scenes allows the network to better capture informative image cues for both positional and orientational embedding. In particular, positional attention focuses on corner-like objects, while orientational attention emphasizes elongated edges. We also visualize the attentions $\{\mathbf{X}_i\}_{1}^N$ at the outputs of the positional decoder for an image from the OldHospital scene (Fig. 4). Each activation corresponds to a particular scene. Indeed, the activations corresponding to the OldHospital scene (Fig. 4b) are significantly stronger. We include additional analysis of the decoder attention in the supplementary material. + +![](images/55306b4a41541f996cc897ea93ce4105fdc9e56a39b539cffaad8c09cd2bbcfb.jpg) +(a) Input (3 scenes) + +![](images/a87f2b23836c6b10f8a93f1f50980ee499554eafe8ede6127e703360f638034e.jpg) +(b) Position + +![](images/bd086988f865663abd9bc9f4a486512c14f1080e24fb60641c16dc942b6fc8da.jpg) +(c) Orientation + +![](images/e563796c6d356434c280d57095c49552790ae0aadcaf10055b05b7c26b70d29e.jpg) +(d) Input (7 scenes) + +![](images/86ba10690b8b3967a99aac5ec1992c0060e09d94af7aa9d597dc7feb3ddef0a9.jpg) +(e) Position + +![](images/ed4ac4bcd94a345d732ff4ed7d8869c09deff6cf518c07190f15209e7d59e0f0.jpg) +(f) Orientation + +![](images/9955c190454e24c536a81ba91db9451f49964dc8457fcf4653ab7befd91934b1.jpg) +Figure 3: Transformer Encoder attention visualizations for a varying number of training scenes (three and seven). As we train our scheme using more scenes (second row), the positional attention is able to better localize corner-like image cues (e compared to b). The orientational attention is able to better localize elongated edges (f compared to c). + +![](images/3b6fad5401acb5b815daa7ecb29317cf64fc09286146dd3227d8aaccbb2a9e09.jpg) +(a) Kings C. + +![](images/eab40d5574bd25465f5917e86ec30bd2fff534867a16cb46c152ff1271dd4e69.jpg) +(b) Old Hospital +(c) Shop Facade + +![](images/a69873cbbddcfd5d146c301a310bf7129969e1083c7518ec7318c7ac4efc865f.jpg) +(d) St. Mary +Figure 4: Translational Decoder attention visualization $\{\mathbf{X}_i\}_{1}^{N}$ . Each activation relates to a different scene. The activations are due to an input image from the old Hospital scene. The activations of the corresponding scene are notably stronger. + +Table 6: Ablations of the convolutional backbone of our model, evaluated on the 7Scenes dataset. We report the average of median position and orientation errors, across all scenes. The model choice is highlighted in bold. + +
BackbonePosition [meters]Orientation [degrees]
Resnet500.198.6
EfficientNetB00.187.28
EfficientNetB10.177.26
+ +# 4.4. Ablation Study + +In order to study the effect of different architecture design choices, we conduct multiple ablation experiments on the 7Scenes dataset (Tables 6-9). On each experi + +Table 7: Ablations of activation maps evaluated on the 7Scenes dataset. $\mathbf{A}_{\mathbf{x}}$ and $\mathbf{A}_{\mathbf{q}}$ are sampled at different resolutions and passed to the respective transformer head. We report the average of median position and orientation errors, across all scenes. The model choice is highlighted in bold. + +
Resolution +Ax/AqPosition +[meters]Orientation +[degrees]
28x28x40/14x14x1120.227.47
14x14x112/28x28x400.187.28
14x14x112/14x14x1120.197.78
+ +Table 8: Ablations of the number of layers in the Encoder and Decoder components, evaluated on the 7Scenes dataset. We report the average of median position and orientation errors, across all scenes. The model choice is highlighted in bold. + +
Encoder/Decoder +# LayersPosition +[meters]Orientation +[degrees]
20.197.48
40.186.94
60.187.28
80.186.92
+ +Table 9: Ablations of the transformer's latent dimension, $C_d$ , evaluated on the 7Scenes dataset. We report the average of median position and orientation errors, across all scenes. The model choice is highlighted in bold. + +
Transformer DimensionPosition [meters]Orientation [degrees]
640.188.06
1280.197.56
2560.187.28
5120.187.19
+ +ment, we start from the architecture used for our comparative analysis (Section 4.2) and modify a single algorithmic component/hyper-parameter. We compute the median position and orientation errors for each scene and report the average across scenes. Our ablation study focuses on two main aspects of our approach: (a) the derivation of activation maps (backbone and resolution) and (b) the transformer architecture. + +Convolutional Backbone. We consider three convolutional encoders for our backbone choice: ResNet50, EfficientNetB0 and EfficientNetB1. The results obtained with these backbones are shown in Table 6. The two EfficientNet variants achieve a better performance compared to the ResNet50 backbone, either due to overfitting (26M parameters for ResNet50 compared to 5.3M and 7.8M for EfficientNetB0 and EfficientNetB1, respectively [32]) or a better learning capacity [32]. The best performance is achieved with the EfficientNetB1 backbone, suggesting that further + +improvements in accuracy can be obtained with appropriate deeper models (e.g., deeper EfficientNet models), on the expense of memory and runtime. + +Resolution of Activation Maps. The EfficientNet backbone can be sampled at different endpoints. As we move along these endpoints, the receptive field and the depth of each entry grow. Thus, activation maps sampled at different levels capture different features which may vary in how informative they are for position and orientation estimation. In order to evaluate this effect, we train our model by sampling the position and orientation activation maps, $A_{x}$ and $A_{q}$ , at different endpoints. Specifically, we consider sampling both $A_{x}$ and $A_{q}$ from the same endpoint, with a resolution of $14 \times 14 \times 112$ or when segregating the sampling from two different resolutions: $14 \times 14 \times 112$ and $28 \times 28 \times 40$ . Table 7 shows the results of these three combinations. The best performance is obtained when providing a combination of coarse and fine activation maps, for the position and orientation transformers, respectively. + +Transformer Architecture The main hyper-parameters of our Transformer architecture follow the standard choice. Thus, we further evaluate the sensitivity of our model performance to changes in two main hyper-parameters: the number of layers in the encoder and decoder components and the transformer dimension, $C_d$ . The results are shown in Table 8 and Table 9, respectively. All the considered variants, in terms of layer number and transformer dimension, maintain SOTA position and orientation accuracy, compared to other APR solutions (Table 4). The performance improves with the Transformer dimension, suggesting that larger models may achieve further improvement to localization accuracy. We note that regardless of the number of layers (Table 8), our model outperforms other solutions (see Table 4). We chose the standard 6-layers model for our ablations as we found it to be the most robust. + +# 5. Conclusions + +In this work we proposed a novel transformer-based approach for multi-scene absolute pose regression. Self-attention using two Transformer Encoders attends separately to the positional and orientational informative image cues. Thus, aggregating the activation maps computed by the backbone CNN in a task-adaptive way. Our formulation allows to agglomerate non-scene-specific information in the backbone CNN and Transformer Encoders. The scene-specific information is encoded by Transformer-Decoders, and is queried per scene. Our approach is shown to provide a new state-of-the-art localization accuracy for both single and multi-scene absolute regression approaches, across outdoor and indoor datasets. + +# References + +[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +[2] Vassileios Balntas, Shuda Li, and Victor Prisacariu. Relocnet: Continuous metric learning relocalisation using neural nets. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. +[3] Hunter Blanton, Connor Greenwell, Scott Workman, and Nathan Jacobs. Extending absolute pose regression to multiple scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 38-39, 2020. +[4] E. Brachmann, A. Krull, S. Nowozin, J. Shotton, F. Michel, S. Gumhold, and C. Rother. Dsac $\hat{\mathbf{a}}\mathbf{e}^{\prime \prime}$ differentiable ransac for camera localization. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2492-2500, Los Alamitos, CA, USA, jul 2017. IEEE Computer Society. +[5] E. Brachmann and C. Rother. Learning less is more - 6d camera localization via 3d surface regression. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4654-4662, 2018. +[6] Eric Brachmann and Carsten Rother. Expert sample consensus applied to camera re-localization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7525-7534, 2019. +[7] Samarth Brahmbhatt, Jinwei Gu, Kihwan Kim, James Hays, and Jan Kautz. Geometry-aware learning of maps for camera localization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. +[8] Ming Cai, Chunhua Shen, and Ian Reid. A hybrid probabilistic model for camera relocalization. In *British Machine Vision Conference* 2018, BMVC 2018, Newcastle, UK, September 3-6, 2018, page 238. BMVA Press, 2018. +[9] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision - ECCV 2020, pages 213-229, Cham, 2020. Springer International Publishing. +[10] Mingyu Ding, Zhe Wang, Jiankai Sun, Jianping Shi, and Ping Luo. Camnet: Coarse-to-fine retrieval for camera relocalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale, 2020. +[12] M. Dusmanu, I. Rocco, T. Pajdla, M. Pollefeys, J. Sivic, A. Torii, and T. Sattler. D2-net: A trainable cnn for joint description and detection of local features. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8084-8093, 2019. + +[13] Martin A. Fischler and Robert C. Bolles. Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Commun. ACM, 24(6):381-395, June 1981. +[14] B. Glocker, S. Izadi, J. Shotton, and A. Criminisi. Realtime rgb-d camera relocalization. In 2013 IEEE International Symposium on Mixed and Augmented Reality (ISMAR), pages 173-179, 2013. +[15] Alex Kendall and Roberto Cipolla. Modelling uncertainty in deep learning for camera relocalization. In Danica Kragic, Antonio Bicchi, and Alessandro De Luca, editors, 2016 IEEE International Conference on Robotics and Automation, ICRA 2016, Stockholm, Sweden, May 16-21, 2016, pages 4762-4769. IEEE, 2016. +[16] A. Kendall and R. Cipolla. Geometric loss functions for camera pose regression with deep learning. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6555-6564, 2017. +[17] A. Kendall, M. Grimes, and R. Cipolla. Posenet: A convolutional network for real-time 6-dof camera relocalization. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 2938-2946, 2015. +[18] Z. Laskar, I. Melekhov, S. Kalia, and J. Kannala. Camera relocalization by computing pairwise relative poses using convolutional neural network. In 2017 IEEE International Conference on Computer Vision Workshops (ICCVW), pages 920-929, 2017. +[19] Luke Melaskyriazi. efficientnet-pytorch. https://pypi.org/project/efficientnet-pytorch/, 2019. +[20] Iaroslav Melekhov, Juha Ylioinas, Juho Kannala, and Esa Rahtu. Image-based localization using hourglass networks. In 2017 IEEE International Conference on Computer Vision Workshops, ICCV Workshops 2017, Venice, Italy, October 22-29, 2017, pages 870-877. IEEE Computer Society, 2017. +[21] Tayyab Naseer and W. Burgard. Deep regression for monocular camera-based 6-dof global localization in outdoor environments. 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 1525-1530, 2017. +[22] H. Noh, A. Araujo, J. Sim, T. Weyand, and B. Han. Large-scale image retrieval with attentive deep local features. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 3476-3485, 2017. +[23] et al. Paszke, Adam. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. Alche-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32, pages 8026-8037. Curran Associates, Inc., 2019. +[24] N. Radwan, A. Valada, and W. Burgard. Vlocnet++: Deep multitask learning for semantic visual localization and odometry. IEEE Robotics and Automation Letters, 3(4):4407-4414, 2018. +[25] P. Sarlin, C. Cadena, R. Siegwart, and M. Dymczyk. From coarse to fine: Robust hierarchical localization at large scale. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 12708-12717, 2019. + +[26] T. Sattler, B. Leibe, and L. Kobbelt. Efficient effective prioritized matching for large-scale image-based localization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(9):1744-1756, 2017. +[27] T. Sattler, Q. Zhou, M. Pollefeys, and L. Leal-Taixe. Understanding the limitations of cnn-based absolute camera pose regression. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3297-3307, 2019. +[28] Yoli Shavit and Ron Ferens. Introduction to camera pose estimation with deep learning. In arXiv preprint arXiv:1907.05272, 2019. +[29] Yoli Shavit and Ron Ferens. Do we really need scene-specific pose encoders? In 2020 25th International Conference on Pattern Recognition (ICPR), pages 3186-3192. IEEE, 2021. +[30] H. Taira, M. Okutomi, T. Sattler, M. Cimpoi, M. Pollefeys, J. Sivic, T. Pajdla, and A. Torii. Inloc: Indoor visual localization with dense matching and view synthesis. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1-1, 2019. +[31] Mingxing Tan and Quoc Le. EfficientNet: Rethinking model scaling for convolutional neural networks. volume 97 of Proceedings of Machine Learning Research, pages 6105-6114, Long Beach, California, USA, 09-15 Jun 2019. PMLR. +[32] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105-6114. PMLR, 2019. +[33] Abhinav Valada, Noha Radwan, and Wolfram Burgard. Deep auxiliary learning for visual localization and odometry. ICRA, pages 6939-6946, 2018. +[34] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30, pages 5998-6008. Curran Associates, Inc., 2017. +[35] F. Walch, C. Hazirbas, L. Leal-Taixe, T. Sattler, S. Hilsenbeck, and D. Cremers. Image-based localization using lstms for structured feature correlation. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 627-637, 2017. +[36] Bing Wang, Changhao Chen, Chris Xiaoxuan Lu, Peijun Zhao, Niki Trigoni, and Andrew Markham. Atloc: Attention guided camera localization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 10393-10401, 2020. +[37] J. Wu, L. Ma, and X. Hu. Delving deeper into convolutional neural networks for camera relocalization. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pages 5644-5651, 2017. \ No newline at end of file diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/images.zip b/learningmultisceneabsoluteposeregressionwithtransformers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6ffc694183b36838c2f461aa23f439fb5e1d12b2 --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b193a1655f97a2a5be211505030228ecbc34d402f9ebfce23017311627fc49a5 +size 457586 diff --git a/learningmultisceneabsoluteposeregressionwithtransformers/layout.json b/learningmultisceneabsoluteposeregressionwithtransformers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..43d4bea96341d59116ff34201cf2ec1e4c3aabf6 --- /dev/null +++ b/learningmultisceneabsoluteposeregressionwithtransformers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37fe36bf474b91cc97ce74bfd55511affe7af2a1e675cee48337641d39a2c78f +size 357013 diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_content_list.json b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f2db87f5cb6b28c57ecc5f418dc5ba3d2f28dbb3 --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89448d255c8258347c478a151ecd3a14df5d582761ccc4dea6607d593377786f +size 79553 diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_model.json b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..99fdd517487e54b492d77057cd372fa64b7c3c23 --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca0d0a2eb01c8ce3caa30da974ae41e1147699a8e2de14aee7a19c70ef6119e7 +size 96900 diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_origin.pdf b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..87805e5a667945e67d90005c47aaf09ba08f1a8a --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/946880e4-56bf-4847-9a63-06445bbd41f9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8ab53a9450f51fd010177f9d2fe737d81ea965125e35b935d808b87736499b2 +size 5838830 diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/full.md b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..12ca220baa11cd9f02b2bf25416989d6c26305de --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/full.md @@ -0,0 +1,353 @@ +# Learning Object-Compositional Neural Radiance Field for Editable Scene Rendering + +Bangbang Yang $^{1}$ +Han Zhou $^{1}$ + +Yinda Zhang² Hujun Bao¹ + +Yinghao Xu3 +Guofeng Zhang1 + +Yijin Li1 +Zhaopeng Cui1* + +$^{1}$ State Key Lab of CAD&CG, Zhejiang University + +$^{2}$ Google $^{3}$ The Chinese University of Hong Kong + +![](images/bfcb68ca3c099880f86b32a1b14aa29290547937b56a843ae110a52248303ed8.jpg) +Figure 1. We propose a novel object-compositional neural radiance field that supports editable scene rendering on real-world datasets. To obtain a view with object manipulation, we jointly render the transformed objects from the conditioned object branch and the surrounding background from the scene branch. + +# Abstract + +Implicit neural rendering techniques have shown promising results for novel view synthesis. However, existing methods usually encode the entire scene as a whole, which is generally not aware of the object identity and limits the ability to the high-level editing tasks such as moving or adding furniture. In this paper, we present a novel neural scene rendering system, which learns an object-compositional neural radiance field and produces realistic rendering with editing capability for a clustered and real-world scene. Specifically, we design a novel two-pathway architecture, in which the scene branch encodes the scene geometry and appearance, and the object branch encodes each standalone object conditioned on learnable object activation codes. To survive the training in heavily cluttered scenes, we propose a scene-guided training strategy to solve the 3D space ambiguity in the occluded regions and learn sharp boundaries for each object. Extensive experiments demonstrate that our system not only achieves competitive performance for static scene novel-view synthesis, but also produces realistic rendering for object-level editing. + +# 1. Introduction + +Virtual tour in a real-world scene is one of the most desired experiences for virtual and augmented reality. While early works rely on laborious capturing and reconstruction of the physical world, e.g., geometry, texture, material, etc., + +the emerging neural rendering methods open great opportunities to ease this task by learning directly from a collection of posed images and achieve promising realistic images. A common follow-up question to ask is: Can we modify the scene, e.g., moving or adding furniture, while still maintaining the realistic rendering capability. + +Unfortunately, this is not well-supported by existing neural rendering methods. Early approaches tend to encode the entire visible scene into a single neural network, such as NeRF [17] and SRN [26]. While handling small objects perfectly, these models are hard to scale up for large-scale scenes due to the fixed network capacity. On the other hand, a family of neural rendering approaches utilizes volumetric representation [12] to densely encode local information at specific locations, which migrates the scalability burden from network parameters to the scene representation and empirically produces better rendering quality. However, the scene representation and rendering network are in general agnostic to the object identity, which does not support high-level editing tasks such as moving furniture. + +In this paper, we propose a neural rendering system that enables scene editing on real-world scenes. Taking a collection of posed images captured from the real scene and rough 2D instance masks, our model can render the whole scene as it is in reality, as well as with objects manipulated, such as moving, rotating, or duplicating. Most related to us, OSF [7] enables editable scene rendering in a bottom-up fashion by learning one model per-object and then perform joint rendering. However, their method does not learn the object arrangements in the real world and requires training images captured for each individual object beforehand, + +which is infeasible to obtain on cluttered scene images and thus only verified on synthetic data. In contrast, we aim to design a top-down approach that directly learns a unified neural rendering model for the whole scene which respects the object placement as in the captured scene. To support object manipulation, we design a novel conditional neural rendering architecture that is able to render each object standalone with everything else removed, which can be further rendered from a novel viewpoint, at a new location, or replicated. Note that to ensure realistic scene editing, each object has to be rendered with sharp boundaries without background bleeding, which is infeasible to achieve with only a rough 3D rendering mask or a bounding box (see Fig. 6 for an example). + +Indeed, it is non-trivial to learn such an object-compositional neural radiance field for a clustered and real-world scene even with rough 2D instance masks, mainly due to the 3D space ambiguity in the occluded region. Intuitively, the network could learn only from the rays casting within the instance mask of a particular object when aiming to render it. However, without known geometry, it is impossible to identify if a 3D location belongs to the object but occluded, which is common in a cluttered scene, or not even a part of it, since both cases are not marked by the instance mask. As a result, the network may overkill part of the object and produce cloudy results. In order to solve this challenge, we learn an extra compact scene branch, without editable capability, to provide biased sampling distribution along the ray and dense depth online during training, which helps to identify the occluded region where the no gradient is applied instead of being supervised as empty space. The scene branch also renders the contents that are not labeled by the instance segmentation to provide a seamless whole scene rendering. + +In summary, the contributions of this paper are as follows. Firstly, we propose the first editable neural scene rendering system given a collection of posed images and 2D instance masks, which supports high-quality novel view rendering as well as object manipulation. Secondly, we design a novel two-pathway architecture to learn object-compositional neural radiance field for a clustered and real-world scene resolving occlusion ambiguity. Lastly, the experiment and extensive ablation study demonstrate the effectiveness of our system and the design of each component. Our system performs on-par or even better than the SoTA methods in terms of standard novel-view synthesis while maintaining the capability of editable scene rendering with high quality. + +# 2. Related Work + +Neural Rendering. In these works, deep neural networks are employed to learn novel view synthesis from 2D images in various approaches, such as voxels [25, 15], point + +clouds [1, 20], textured meshes [27, 13, 11], multi-plane images [27, 31, 6], and implicit functions [26, 14, 18]. As a pioneer, SRN [26] represents a continuous scene as an opaque surface by implicitly mapping space coordinates to a feature vector with MLPs, and uses a differentiable ray marching algorithm to render 2D feature maps for image generation. NeRF [17] represent scenes with implicit fields of volume density and view-dependent color, and achieves photorealistic novel view synthesis results. To accelerate the rendering speed and enlarge the network capacity, NSVF [12] proposes a sparse voxel octree variant of NeRF, which implicitly encodes the local properties of a visible scene inside the voxel-bounded representations. However, as these methods tend to encode the entire scene, it is not trivial to render an individual object once the model has been trained. On the contrary, our proposed object-compositional neural radiance field naturally supports the standalone object rendering. On this basis, we realize the novel view synthesis with user-defined object manipulation. + +Object-Decomposite Rendering. Early approaches adopt the traditional modeling [3, 2, 10, 23, 24, 21, 22] and rendering pipeline [8] to support editing and novel view synthesis. For example, Karsch et al. [8] propose to realistically insert synthetic objects into photographs by estimating environment light conditions. Cossairt et al. [4] composite real and synthetic objects together with a light field interface, while the object light field is captured with a specific hardware system. Recently, some works adopt neural implicit representations for object-decomposite rendering. Guo et al. [7] propose a bottom-up method by learning one scattering field per-object and enables rendering scenes with moving objects and lights, but it needs to train each separate model on images that only contain a single specific object, which is impractical for real-world scenarios. Ost et al. [19] propose to use a neural scene graph to decompose dynamic objects in a street view dataset. their method relies on a dynamic scene, which is not capable of indoor scene scans. Besides, the latent class encoding restricts each model to represent only one class of objects with similar shapes and canonical coordinates, which limits the applications in general cases where the objects vary and do not share the same shape characteristics. In contrast, our method does not rely on the canonical coordinates of objects and can also simultaneously learn a compact object-compositional model which enables novel view synthesis with multi-objects manipulation in real-world scene scans. + +# 3. Method + +# 3.1. Overview + +Our framework consists of two pathways: the scene branch and the object branch, as illustrated in Fig. 2. The scene branch aims to encode the entire scene geometry and + +![](images/5ad95188764fe7f5a651a3e3db357c1773147099d192aeb456dce1a2145363a2.jpg) +Figure 2. We design a two-pathway architecture for object-compositional neural radiance field. The scene branch takes the spatial coordinate $\mathbf{x}$ , the interpolated scene voxel features $\pmb{f}_{scn}$ at $\mathbf{x}$ and the ray direction $\mathbf{d}$ as input, and output the color $\mathbf{c}_{scn}$ and opacity $\sigma_{scn}$ of the scene. The object branch takes additional object voxel features $\pmb{f}_{obj}$ as well as a object activation code $\pmb{l}_{obj}$ to condition the output only contains the color $\mathbf{c}_{obj}$ and opacity $\sigma_{obj}$ for a specific object at its original location with everything else removed. + +appearance, which renders the surrounding background in editable scene rendering and assists the object branch in identifying the occlusion region. With 2D instance masks as guidance, the object branch encodes each standalone object conditioned on several learnable object activation codes. At the rendering stage, when conditioning the scene branch with the object activation code, we can freely render a single object while removing everything else. It is noteworthy that our framework simultaneously learns to encode multiple objects by assigning a bunch of shuffled object activation codes to the training rays, without the need to train for each object separately. Since the framework is built upon NeRF, we refer to Mildenhall et al. [17] for the technical background. + +# 3.2. Framework of Object-Compositional NeRF + +As shown in Fig. 2, our framework adopts two separate branches for scene rendering and object rendering. We take the advantages both from the voxelized representation [12] and the coordinate-based positional encoding [17], and propose a hybrid space embedding as network input. Practically, for each point $\mathbf{x}$ sampled along the camera ray, we apply positional encoding $\gamma (\cdot)$ [17] on both of the scene voxel feature $f_{scn}$ interpolated from 8 nearest vertices and space coordinate $\mathbf{x}$ to get the hybrid space embedding. This hybrid space embedding, along with the embedded directions $\gamma (d)$ , will be fed into the scene branch and the object branch. By now, the scene branch function $F_{scn}$ can output the opacity $\sigma_{scn}$ and color $\mathbf{c}_{scn}$ of the scene at $\mathbf{x}$ . For the object branch function $F_{obj}$ , we additionally add embedded object voxel feature $\gamma (f_{obj})$ and object activation code $l_{obj}$ to the input, where $f_{obj}$ helps to broaden the ability of learning decomposition and is shared by all the objects, and $l_{obj}$ identifies feature space for different objects and is possessed by each individual. Take the object activation code $l_{obj}$ as a condition, the object branch precisely outputs color $\mathbf{c}_{obj}$ and opacity $\sigma_{obj}$ for the desired object while everything else remains empty. + +# 3.3. Object-Compositional Learning + +Object supervision. Ideally, an object radiance field should only be opaque at the area occupied by the object and transparent elsewhere (i.e., zero opacity). To achieve this goal, we leverage 2D instance segmentation as supervision signals for the object branch. For brevity, we assume a training process with $K$ annotated objects in a scene, along with a learnable object code library $\mathcal{L} = \{l_{obj}^k\}$ . For each ray $\pmb{r}$ in the batched training set $N_r$ , we select one object $k$ as a training target and assign the object activation code $l_{obj}^k$ to the object branch input. Then we forward the network and acquire the rendered color $\hat{C}(\boldsymbol{r})_{obj}^k$ , as well as the rendered 2D object opacity $\hat{O}(\boldsymbol{r})_{obj}^k$ by summing up the product of transmittance $T_i^k$ and alpha value $\alpha_i^k$ of $N$ sampled points along the ray, which follows [16, 17] and is defined as: + +$$ +\hat {C} (\boldsymbol {r}) _ {o b j} = \sum_ {i = 1} ^ {N} T _ {i} \alpha_ {i} \mathbf {c} _ {o b j i}, \quad \hat {O} (\boldsymbol {r}) _ {o b j} = \sum_ {i = 1} ^ {N} T _ {i} \alpha_ {i}, \tag {1} +$$ + +$$ +T _ {i} = \exp \left(- \sum_ {j = 1} ^ {i - 1} \sigma_ {o b j _ {j}} \delta_ {j}\right), +$$ + +where $\alpha_{i} = 1 - \exp (-\sigma_{obj,i}\delta_{i})$ and $\delta_{i}$ is the sampling distance between adjacent points along the ray. To encourage the rendered 2D object opacity $\hat{O} (\boldsymbol {r})^{k}_{obj}$ to satisfy the 2D instance mask, we minimize the squared distance to the corresponding instance mask $M(r)^{k}$ . We also minimize the squared distance between the rendered object color $\hat{C} (r)^{k}_{obj}$ and the ground-truth color $C(r)$ with $M(r)^{k}$ masked. The loss of object supervision is defined as: + +$$ +\begin{array}{l} \mathcal {L} _ {o b j} = \sum_ {\boldsymbol {r} \in N _ {r}} \sum_ {k \in [ [ 1.. K ] ]} \lambda_ {1} M (\boldsymbol {r}) ^ {k} \| \hat {C} (\boldsymbol {r}) _ {o b j} ^ {k} - C (\boldsymbol {r}) \| _ {2} ^ {2} \tag {2} \\ + \lambda_ {2} w (\pmb {r}) ^ {k} | | \hat {O} (\pmb {r}) _ {o b j} ^ {k} - M (\pmb {r}) ^ {k} | | _ {2} ^ {2}, \\ \end{array} +$$ + +where the instance mask $M(\boldsymbol{r})^k$ is constructed by setting 1 or 0 w.r.t. the instance label at the corresponding pixel + +![](images/908a92d0898e5119fb871b857c88509bb378281ca1a6c1a11da4c3ed4b5eff60.jpg) +Figure 3. 3D guard mask identifies the occluded region for the object branch. We render the scene depth $d_{scn}$ (gray lines in the left), and push forward it along the camera direction with $\epsilon$ . Then, we subtract the visible instance frustum (yellow area in the left) from the 3D space farther than $d_{scn} + \epsilon$ to construct the 3D guard mask (gray area). + +belongs to the object $k$ or not, and $w(\boldsymbol{r})^k$ is the balanced weight between 0 and 1 signals of the instance mask. + +Occlusion issue. The above object supervision is commonly sufficient for learning object radiance field from simple object-centric data (i.e., $360^{\circ}$ capturing towards a single object without any occlusion). However, in real-world scene scans, target objects are often occluded by other foregrounds, which yields incomplete instance masks. Therefore, for the pixel labels with "empty" (or 0) signal at the mask, it is ambiguous whether the ray does not hit the object or is blocked by other foregrounds, and directly using these incomplete masks as supervision may overkill part of the objects and learn a shattered radiance field (see Fig. 9 (c)). And it's also worth noting that we cannot simply neglect the supervision of the empty areas, or the model would render unexpected floats at the unsupervised area. + +Scene-guided occlusion identification. We exploit the geometric cues online from the scene branch to identify occlusion regions. First, we utilize the transmittance from the scene branch to guide the biased sampling of the object branch, which we name scene guidance. The scene guidance significantly reduces the point sampling inside the occluded region and mitigates the erroneous supervision to the object branch. However, when the target object is frequently occluded by other instances, the learned object radiance field is still affected (see Fig. 9 (d)). Thus, we propose a 3D guard mask to stop the gradient applied to the occluded region, as illustrated in Fig. 3. In practice, we render the scene depth $d_{scn}$ online by the scene branch and slightly push forward it along the camera direction with a small distance $\epsilon$ . We then utilize a 3D guard mask to protect the occluded part, which is constructed by subtracting the visible instance space from the 3D space farther than the pushed scene depth $d_{scn} + \epsilon$ . During the training process of the object branch, we explicitly prune the ray samples inside the 3D guard mask. Intuitively, we assume that the distance between two annotated objects is usually larger than $\epsilon$ . Thus, if the target object can be viewed without any occlusion, our 3D guard mask would permit sufficient + +point samples for objects and the surrounding space, so the instance supervision signal will guide the object branch to encode the target object and eliminate everything else. Otherwise, if the target object is occluded, the gradient of the "empty" signal at the occluded region will be blocked, while the visible region can still be supervised properly. + +# 3.4. Joint Optimization + +We jointly optimize the scene branch and object branch at the training stage. For the scene branch, we follow [17] and minimize the squared error between predicted color $\hat{C} (\pmb {r})_{scn}$ and true pixel color $C(r)$ , as: + +$$ +\mathcal {L} _ {s c n} = \sum_ {\boldsymbol {r} \in N _ {r}} | | \hat {C} (\boldsymbol {r}) _ {s c n} - C (\boldsymbol {r}) | | _ {2} ^ {2}, \tag {3} +$$ + +For the object branch, we use the loss introduced in Eq. (2). The total loss of the model is defined as: + +$$ +\mathcal {L} = \mathcal {L} _ {o b j} + \mathcal {L} _ {s c n}. \tag {4} +$$ + +# 3.5. Editable Scene Rendering + +Thanks to the object-compositional NeRF, we can readily obtain radiance fields for each annotated object by simply switching the applied optimized object activation code, making it easy to realize the editable scene rendering. As illustrated in Fig. 1, we divide the total editable scene rendering pipeline into the background stage and the object stage. At the background stage, we obtain the scene color and opacity $\{\mathbf{c}_{scni},\sigma_{scni}\}_{i = 1}^{N}$ from the scene branch while pruning the point sampling at the target region, so as to remove the original objects from the scene. At the object stage, we shoot rays on the $K$ target objects, and follow the user-defined manipulation to transform the object-specific color and opacity $\{\mathbf{c}_{obj_i}^k,\sigma_{obj_i}^k\}_{i = 1}^NK_{k = 1}$ to the desired location. Finally, we aggregate all the opacity and colors by ordering the distance along the ray directions and render pixel colors with the quadrature rules [16]: + +$$ +\hat {C} (\boldsymbol {r}) = \sum_ {i = 1} ^ {N \times (K + 1)} T _ {i} \alpha_ {i} \mathbf {c} _ {i}, \tag {5} +$$ + +where $T_{i}$ and $\alpha_{i}$ are transmittance and alpha value as defined in Sec. 3.3. + +# 4. Experiments + +We evaluate our method in two real-world datasets. First, we quantitatively and qualitatively compare our scene branch with SoTA methods on standard scene rendering. Then, we show the visualization of different ways to render the individual object and compare our editable scene rendering with point cloud based rendering method [6]. Finally, we perform ablation studies to inspect the design of our framework. + +# 4.1. Dataset + +ToyDesk. We created a dataset with instance annotations to evaluate our framework, which contains two sets of posed images with 2D instance segmentation for target objects. Specifically, we prepare two scenes of a desk by placing several toys with two different layouts, and $360^{\circ}$ capture images by looking at the desk center, where the toys are frequently occluded by each others from the image view. We use the SfM [21], multi-view stereo [28] and mesh generation technique [9] to recover camera poses and meshes, and also manually label the target object on the meshes. The 2D instance segmentation is obtained by directly projecting the annotated instance labels from the 3D meshes. + +ScanNet. ScanNet [5] dataset contains RGB-D indoor scene scans as well as 3D instance annotation and 2D instance segmentation by projection. To better evaluate the performance both of the scene branch and the object branch, we select frames with a viewing angle less than $40^{\circ}$ of a preset central object and distance within 3 meters from the central object, and randomly sample $80\%$ for training and other frames for testing. For the object opacity supervision, we directly use the instance segmentation provided in the ScanNet dataset, which is fairly rough (see Fig. 10) but can be fully leveraged by our method. + +Please refer to the supplementary material for more details of the datasets. + +# 4.2. Data Preparation and Experiment Details + +Our method does not require sensor depth for training as well as NeRF [17] and NSVF [12]², while NPCR [6] relies on the depth frames to generate voxel aggregation (according to the author's codebase) and dense point clouds to storage point descriptors. So for a fair comparison, we follow the training setup in NSVF by adding a depth loss to the training for all the other competitors (i.e., NeRF, NSVF, and our method) on the ScanNet dataset. However, as the depth loss is totally optional, we will show more results without depth supervision on the ScanNet dataset in the supplementary material. Besides, as NSVF also utilizes the point clouds for voxel initialization in their ScanNet experiment, we thus use the same point clouds as NPCR to initialize voxels for NSVF and our method. For the experiments on the ToyDesk dataset, we exclude the NPCR due to the lack of sensor depth and use the SfM point clouds for voxel initialization. + +# 4.3. Comparison of Scene Rendering + +To evaluate the rendering quality of the scene branch, we first compare with neural point cloud based rendering (NPCR) [6], the state-of-the-art implicit representation method NeRF [17] and the voxel-bounded extension + +
MethodsToyDeskScanNet
PSNR ↑SSIM ↑LPIPS ↓PSNR ↑SSIM ↑LPIPS ↓
NPCR [6]///25.1770.7540.225
NeRF [17]15.4530.5860.53728.9270.8150.249
Sparse Voxel* [12]14.4800.5320.57224.1430.7350.312
Our Method15.6070.5850.52229.0050.8150.243
+ +Table 1. To evaluate the full scene rendering quality, we quantitatively compare our scene branch with the SoTA neural rendering methods on ToyDesk dataset and ScanNet dataset. + +NSVF [12]. Since NSVF does not release the training codes for the ScanNet dataset, and we also fail to train the ScanNet data on the official codebase due to the GPU OOM error, we decide to use our implementation of voxel representations along with self-pruning and progressive training mechanism, which will be denoted as Sparse Voxel. + +We follow the standard metric in [12, 17, 6] by using PSNR, SSIM and LPIPS to measure the rendering quality. As shown in Table 1, our method is comparable or even better than the SoTA methods on the evaluated metrics. Note that the ToyDesk dataset contains a much larger portion of relatively far background (compared to ScanNet), which degenerates the positional encoding when the query point is far from the origin [29]. Therefore all NeRF-based approaches perform worse on ToyDesk. Meanwhile, we show rendered examples for ToyDesk dataset in Fig. 4 and ScanNet dataset in Fig. 5. For the results of ToyDesk, we find that NeRF's outputs look relatively complete, but the details are erased (e.g., the edges of the magic cube), and Sparse Voxel tends to encode more details but fails to produce reasonable texture for far-away backgrounds where the SfM point clouds are incomplete. Thanks to our hybrid space embedding which automatically adapts to varying sampling locations, we consistently show fine details of central objects and the surrounding environment textures. For the results of ScanNet in Fig. 5, it is noticeable that NPCR and Sparse Voxel both fail to produce the correct color at the first row, and NPCR even omitted the chair handle and the legs as shown in the second and the third row in Fig. 5. We consider it is mainly due to the incomplete point cloud, which makes it impossible for NPCR and Sparse Voxel to store descriptors in these areas without supporting geometry. On the contrary, our method both shows finer granularity where there are voxels and also correctly renders textures where voxel is missing. + +# 4.4. Comparison of Individual Object Rendering + +We argue that it is unnatural to render the individual object once the entire scene has been encoded to the model, even though the reconstructed 3D mesh or bounding box is available and can be acted as a 3D rendering mask. To prove this, we compare different approaches to render the individual object in Fig. 6, where (b) and (c) are rendered with points sampled close to the mesh surface, with radius $0.05\mathrm{m}$ and $0.1\mathrm{m}$ , respectively, and (e) is rendered with rays clipped by the bounding box, and (f) is the result from the + +![](images/70f0dcf6f6c5c138746b6a2944ff17301aaed9fcdf38477bf4d314a50103062f.jpg) +(a) NeRF + +![](images/4b3e899c18f0f5a6e6d443a6df813642316861b49f32a8642a294ee42cf5098a.jpg) +(b) Sparse Voxel + +![](images/9af1316db7068f21a216b86a98253b3a51692384e31fd7a6425796f03f5b2bf6.jpg) +(c) Our Method + +![](images/a4b8f52dffdbc070f699b16523ccfb4a5cf883fdb04fc2765b11171f3b8159d4.jpg) +(d) Ground truth + +![](images/1b6037e9fa5e7f9fcf7735d9822331a1b1ce0e33e8677d5a8af548be7e5aae56.jpg) + +![](images/8e134ebfe08d21e5d3e60aa98c6e50860fb35f66104ea99e7261ffc1cfafa084.jpg) + +![](images/c0914bf977b6257ed335672548e6ac88b2bf6703dbdcc4eba389e8f0e4234e9a.jpg) +(a) NPCR + +![](images/92abfbcce9c6c64a0518b8d98c6b8facda3acaa26b730ab13c5f9bc13c186cdc.jpg) + +![](images/868d3c40abf3e0a138ac566c2fa4aa761f7af7fb3a191947a6cfb251a8e35d06.jpg) + +![](images/080aa74d6854a15a7e2db17c0608983f870dbdde520ef2ca28d6a6af1ac3dc56.jpg) +(b) NeRF + +![](images/9ae53447271b5b9c8ce00b9fd391a8d346d8b553369444140aafad7fc7268ab8.jpg) +Figure 4. We compare scene rendering quality with NeRF [17] and Sparse Voxel [12] on the ToyDesk dataset. Our method consistently renders fine details of central objects as well as the surrounding environment textures. + +![](images/51b78aff95421ed4d7800e259ee09f305b4702b2bf159f0589442414af1ed93b.jpg) + +![](images/055fcdbcb1d04a0cbcc7e6ca83eb7f3c5f74253025929eb29e9a663b8cf401a0.jpg) +(c) Sparse Voxel + +![](images/c02fce0c68878eaf17c12d3485e96c422028a222321503e3257278ecf714e1db.jpg) + +![](images/fc0c6f0669401a551386213e78cde5ed464e0284021c61eaef5940b4d6282c3a.jpg) + +![](images/af72fafe3ed2491ac41c8a3910766520328e1264b0616ff3c32b77f1dfca867f.jpg) +(d) Our Method +Figure 5. We show scene rendering examples of NPCR [6], NeRF [17], Sparse Voxel [12] and our method on the ScanNet dataset. Please zoom in for more details. + +![](images/50beac0b5601a96f5ab0bdb4314ea9a3f9bd14cbfe471b7fafdf8afde8db4689.jpg) + +![](images/943d6c968918e4b00e3fa2a06a2cfcbea56d86dfffafed5bc5c99fad1b8670c7.jpg) + +![](images/ea0251882574b37aa9fea1f41dc836d9c7d573def33ae58353ff42841d438a91.jpg) +(e) Ground truth + +object branch. Since the reconstructed mesh is usually incomplete and inaccurate as shown in Fig. 6 (a), directly applying a strict 3D rendering mask (i.e. within a radius of $0.05\mathrm{m}$ ) would produce a mottled rendering result as Fig. 6 (b) due to the lack of precise point sampling on the main color components of the radiance field. When relaxing the radius to $0.1\mathrm{m}$ , though the rendered object becomes more vivid and realistic, the background texture is incidentally included as shown in Fig. 6 (c). Besides, restricting ray samples inside the bounding box would even include more background textures, as shown in Fig. 6 (e). In contrast, our object branch can render a clean object without background included, as shown in Fig. 6 (f). + +# 4.5. Comparison of Scene Editing + +We first show our object rendering and scene editing results on the ToyDesk dataset in Fig. 7. As shown in Fig. 7 (c), the rendered objects from the object branch vividly exhibit the objects with sharp boundaries, which demonstrates the effectiveness of our object-compositional design. We + +perform scene editing by rotating, moving, and duplicating objects following the proposed editable rendering pipeline. From Fig. 7 (b), we can see that the manipulated objects are seamlessly integrated into the scene while ensuring the correct spatial relationship. + +We then compare our editable scene rendering with neural point cloud based rendering method NPCR [6] on the ScanNet dataset. The NPCR takes the input of raw point clouds of a scene and outputs images of novel views. During training, NPCR also optimizes feature vectors for each 3D point which encodes scene appearance. Therefore, we perform scene editing by manually moving point clouds and the feature vectors inside the bounding box of the target objects. As shown in Fig. 8, we find that the manipulation of point clouds inside the bounding box also brings the movement of background texture (e.g., the pattern of the windows and the carpet under the chair have been moved in '0024 Translation' and '0113 Rotation'), which may be due to NPCR incidentally stores part of the background appearance feature to the points inside the bounding box. In + +![](images/243e5d49a7db8e425984a69014b2fdd5d283dc685e4abd09afddd55db7ff85b1.jpg) +(a) Reconstructed mesh + +![](images/5ed043f18f208d4ef9b6e0e17290a632c1088dd3489c17e0f15a1b7aebd8a039.jpg) +(b) Masked by mesh Radius 0.05m + +![](images/9047e488499f87abdfd1c1396023573cc9a2470a7c7ab60468a38fc962b14ebc.jpg) +(c) Masked by mesh Radius 0.1m + +![](images/527f0d75078b45a639494422fba1f9860abf6b86eee91cce501cd5b75a25f5a7.jpg) +(d) Image view + +![](images/517deb0579a02aa7361b863a213981a98ea353f9c8b8e3d22f1a722b4e83be30.jpg) +(e) Masked by bounding box + +![](images/74c36073c5c5d3bc9d506ce7f00d9cb7ed691e32fc57ab9c525b43998e65da02.jpg) +(f) Our method + +![](images/f89d7f52dcbb737b12f22045713e4d0ae0502eddbfd9165bf8dc67693ae7470f.jpg) +Figure 6. We compare different methods to render the individual object on the ScanNet dataset. + +![](images/a6ba25ac23b35f1c42db63fadcc1f4faab6e7d69eb3c2911feb84f24771b7e88.jpg) + +![](images/60ff36dee96da84c03ad9727af50de0b28c62569862b1932366a88b5d78247b0.jpg) +(a) Image View +(b) Scene Editing +(c) Rendered Objects +Figure 7. We show the original image view (a), scene editing result (b) by duplicating and moving toys on the ToyDesk dataset, and the decomposite objects (b) rendered by the object branch. + +contrast, our method moves the objects while keeping the textures of the background nearly unchanged, which produces more realistic editing results. Besides, NPCR also renders the images with severe artifacts in some cases (e.g., false occlusion relationship in '0038 Rotation', unexpected holes of chairs in '0192 Translation', and cloudy textures in '0113 Duplication'). We guess that it somehow encodes the visibility of 3D points with an implicitly fixed order rather than inferencing from the 3D space, and the aggregation from the mixture of object points and invisible noisy points also confuses the neural renderer. By the way, we also test scene editing with Sparse Voxel, but find the issue similar to the bounding box based approaches (Fig. 6). However, as we output the radiance field of each target objects independently and the rendering pipeline also takes the advantages of volumetric rendering, we consistently produce realistic editing results with correct space relationship and intact textures. Please refer to the supplementary material for more evaluation of our editing results. + +
Config.ScanNet 0033ScanNet 0038
PSNR ↑SSIM ↑LPIPS ↓PSNR ↑SSIM ↑LPIPS ↓
w/o SG, 3DGM19.7850.7500.11127.1000.8080.112
w/o 3DGM20.4500.7540.11733.9140.8840.056
w/o fobj22.2190.8170.05733.8610.8920.058
Complete22.6000.8220.04934.4350.8970.056
+ +Table 2. Ablation for the effectiveness of our proposed scene guidance, 3D guard mask and object voxel feature on learning object radiance field. + +
Config.ScanNet 0033ScanNet 0038
PSNR ↑SSIM ↑LPIPS ↓PSNR ↑SSIM ↑LPIPS ↓
ε = 0.02522.3640.8190.05134.0470.8950.057
ε = 0.0522.6000.8220.04934.4350.8970.056
ε = 0.122.1720.8180.05334.2990.8960.056
+ +Table 3. Quantitative evaluation w.r.t forward distance $\epsilon$ of 3D guard mask on learning object radiance field. + +# 4.6. Ablation Study + +Scene guidance and 3D guard mask. We analyze the effectiveness of scene guidance and 3D guard mask for learning object-compositional rendering when the target objects are frequently viewed with partial occlusion. Specifically, we choose two scenes (ScanNet 0033 and 0038) where the target objects are frequently occluded by foreground furniture. We first randomly select ten testing views for each scene and quantitatively inspect these strategies on the rendered objects in Table 2, where SG denotes the scene guidance (biased sampling distribution) provided by the scene branch, and 3DGM denotes the 3D guard mask. Practically, to block the influence of the background color during the evaluation, we use the instance segmentation to mask out the background and crop the ground truth and the rendered images to tightly fit the object area. The results in Table 2 show that our scene guidance and 3D guard mask significantly improve the rendering quality of the target objects. Besides, we also show a visual comparison in Fig. 9. Thanks to these strategies, we can learn an intact object radiance field even the target object is rarely observed completely. More qualitative and quantitative results can be found in the supplementary material. + +Choice of different $\epsilon$ in 3D guard mask. To study the impact of different $\epsilon$ in 3D guard mask, we vary the $\epsilon$ and report the metric evaluation of the object area as introduced above. From Table 3, we find that $\epsilon = 0.05$ achieves better rendering quality. As the other choices also produce very close results, we believe our proposed 3D guard mask is not sensitive to the choice of $\epsilon$ . + +Object voxel feature. To inspect the effectiveness of object voxel feature $\pmb{f}_{obj}$ illustrated in Fig. 2, we ablate it by removing the embedded $\pmb{f}_{obj}$ at the input of the object branch and quantitatively evaluate the object area as we introduced above. As shown in Table 2, the design of $\pmb{f}_{obj}$ further boosts the rendering quality of the objects, which indicates adding learnable parameters in 3D space can also broaden the network ability for compositional rendering. + +![](images/4b3d93bb3fd1e33fdcc7904aa9bdac65453a79ddc976cb25991b3a18d5d0817e.jpg) +Figure 8. We compare our method and NPCR [6] for scene editing by rotating, translating, and duplicating objects on the ScanNet dataset. + +![](images/2ae93ed1fd39ddbbb01fed7a3a0b5cd75d8d7c2b5872d0d00be518d1b1ea958d.jpg) + +![](images/4955ab95fa7fc51cd5d10d1f5171699fbefcaa182112c11325fab1656c2b626d.jpg) + +![](images/d2af56521111e190ab7d5ded155516497ebd4b96b5d4c84355eca6f350397ab1.jpg) + +![](images/49d513669ff642ac2a88c2337c0c706f39408a0f3ae68466880fbdc5dd4389b7.jpg) + +![](images/c38fb32d48bb14567b7b45e2a981c4d719ef5e2dd70897c43d0709fd3c5eb1d5.jpg) +(a) Image View +(b) Rendering in +bounding box + +![](images/bbb99dd47a90f949f890508b5fc86f261476a9b4e752e54dcc60f233fc9897f2.jpg) + +![](images/fed08a75c9db21a3b93c8f95b692c6296b38b41684fba071db3325d70f42ba85.jpg) +(c) Without scene +guard mask + +![](images/808bf010dbfd139e4cb722e8a382b1c783d0caab733bcd7b82ca87d0219340fb.jpg) +guidance and 3D +(d) Without 3D (e) C +guard mask + +![](images/e7eadc2b87c429bddbb8e123dc00f7fdd93bc42e133b65ae764f751cf0bae1ed.jpg) +Complete model + +![](images/3b129816b855ab10c4f0fb755d59511dc7ef906a92aaa163e493c9323cf60e28.jpg) + +![](images/67316303bedcebfbd06218ba0032e31b3428d6404e2567d82807812063be462c.jpg) +Figure 9. We visualize the effectiveness of scene guidance and 3D guard mask by ablating them on the training process of the ScanNet dataset. Note that (b) is produced by the scene branch with sampling rays clipped inside the bounding box and can be considered as a reference complete view of the target object. Our scene guidance and 3D guard mask effectively prevent the overkill of the occluded region and ensure a complete object rendering. +(a) Image View +Segmentation +Figure 10. We show the image view (a), input segmentation for supervision (b), our rendered segmentation (c), and the rendered object (d). Please zoom in for more details. + +![](images/a21cff1e1ba0727474a2fa1fb078d0890e398cb1e9b993b5dd27cb1f6d07a61a.jpg) +(b) Input + +![](images/6d8a91988867dde4671850f47ad883de97d52e4f3a68c0c5775cf47570413993.jpg) +(c) Rendered +Segmentation + +![](images/566b1564dfd1706ea1e40695227112540959ded17ff45a8244c6e4d29de8b3a9.jpg) +(d) Rendered +Object + +# 4.7. Visualization of Rendered Segmentation + +Since our method only relies on the 2D segmentation to learn the decomposition of the target objects, we visualize the input segmentation used for supervision and our rendered segmentation (2D object opacity) as well as the ren + +dered objects in Fig. 10. To our surprise, even though the input segmentation is fairly rough with jittery edges, our method can produce a smooth and accurate segmentation once the training converges while preserving high-fidelity details of the object (e.g., chair handle at the first row). We believe the multi-view supervision helps resist mask noise from a single view, and the converged 3D structure learned from images provides geometry cues for object decomposition, which is also observed in a parallel work by Zhi et al. [30]. This shed light on distilling fined-grained 3D segmentation only from the knowledge of 2D segmentation networks by the proposed learning pipeline. + +# 5. Conclusion and Future Works + +We present the first neural scene rendering framework which provides high-fidelity novel-view synthesis while supporting editable scene rendering on real-world scenes. By training with the posed images and rough 2D instance masks, we can freely utilize the model to render novel views with multiple objects manipulated (e.g. moving, rotating, or duplicating). Currently, due to the lack of observations, our method relies on the network spatial smoothness to render unseen textures under objects, which can be further optimized by adopting scene completion methods. To mitigate the influence of the pose noise and rolling shutter on the real-world data, we can further optimize camera poses and ray directions so as to render a clearer background. Besides, to achieve more realistic scene editing, it is also promising to integrate the scene lighting model into the framework in the future work. + +Acknowledgments: We thank Hanqing Jiang, Liyang Zhou and Jiaming Sun for their kind help in scene reconstruction and annotation for the ToyDesk dataset. This work was partially supported by NSF of China (No. 61932003). + +# References + +[1] Kara-Ali Aliev, Artem Sevastopolsky, Maria Kolos, Dmitry Ulyanov, and Victor S. Lempitsky. Neural Point-Based Graphics. In Proceedings of European Conference on Computer Vision, pages 696-712, 2020. 2 +[2] Michael Bleyer, Christoph Rhemann, and Carsten Rother. PatchMatch Stereo - Stereo Matching with Slanted Support Windows. In Proceedings of British Machine Vision Conference, pages 1-11, 2011. 2 +[3] Adrian Broadhurst, Tom Drummond, and Roberto Cipolla. A Probabilistic Framework for Space Carving. In Proceedings of IEEE International Conference On Computer Vision, pages 388-393, 2001. 2 +[4] Oliver Cossairt, Shree K. Nayar, and Ravi Ramamoorthi. Light Field Transfer: Global Illumination Between Real and Synthetic Objects. ACM Trans. Graph., 27(3):57, 2008. 2 +[5] Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas A. Funkhouser, and Matthias Nießner. ScanNet: Richly-Annotated 3D Reconstructions of Indoor Scenes. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 2432-2443, 2017. 5 +[6] Peng Dai, Yinda Zhang, Zhuwen Li, Shuaicheng Liu, and Bing Zeng. Neural Point Cloud Rendering via Multi-Plane Projection. In Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7827-7836, 2020. 2, 4, 5, 6, 8 +[7] Michelle Guo, Alireza Fathi, Jiajun Wu, and Thomas Funkhouser. Object-centric neural scene rendering. arXiv preprint arXiv:2012.08503, 2020. 1, 2 +[8] Kevin Karsch, Varsha Hedau, David A. Forsyth, and Derek Hoiem. Rendering synthetic objects into legacy photographs. ACM Trans. Graph., 30(6):157, 2011. 2 +[9] Michael M. Kazhdan, Matthew Bolitho, and Hugues Hoppe. Poisson Surface Reconstruction. In Proceedings of Eurographics Symposium on Geometry Processing, pages 61-70, 2006. 5 +[10] Kiriakos N. Kutulakos and Steven M. Seitz. A Theory of Shape by Space Carving. Int. J. Comput. Vis., 38(3):199-218, 2000. 2 +[11] Yiyi Liao, Katja Schwarz, Lars M. Mescheder, and Andreas Geiger. Towards Unsupervised Learning of Generative Models for 3D Controllable Image Synthesis. In Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5870-5879. IEEE, 2020. 2 +[12] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. In Proceedings of Advances in Neural Information Processing Systems, volume 33, 2020. 1, 2, 3, 5, 6 +[13] Lingjie Liu, Weipeng Xu, Michael Zollhöfer, Hyeongwoo Kim, Florian Bernard, Marc Habermann, Wenping Wang, and Christian Theobalt. Neural Rendering and Reenactment of Human Actor Videos. ACM Trans. Graph., 38(5):139:1-139:14, 2019. 2 +[14] Shaohui Liu, Yinda Zhang, Songyou Peng, Boxin Shi, Marc Pollefeys, and Zhaopeng Cui. DIST: Rendering Deep Implicit Signed Distance Function With Differentiable Sphere + +Tracing. In Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2016-2025, 2020. 2 +[15] Stephen Lombardi, Tomas Simon, Jason M. Saragih, Gabriel Schwartz, Andreas M. Lehrmann, and Yaser Sheikh. Neural volumes: learning dynamic renderable volumes from images. ACM Trans. Graph., 38(4):65:1-65:14, 2019. 2 +[16] Nelson L. Max. Optical Models for Direct Volume Rendering. IEEE Trans. Vis. Comput. Graph., 1(2):99-108, 1995. 3,4 +[17] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. In Proceedings of European Conference on Computer Vision, pages 405-421, 2020. 1, 2, 3, 4, 5, 6 +[18] Michael Niemeyer, Lars M. Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable Volumetric Rendering: Learning Implicit 3D Representations Without 3D Supervision. In Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3501-3512, 2020. 2 +[19] Julian Ost, Fahim Mannan, Nils Thuerey, Julian Knodt, and Felix Heide. Neural scene graphs for dynamic scenes. arXiv preprint arXiv:2011.10379, 2020. 2 +[20] Francesco Pittaluga, Sanjeev J. Koppal, Sing Bing Kang, and Sudipta N. Sinha. Revealing Scenes by Inverting Structure From Motion Reconstructions. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 145-154, 2019. 2 +[21] Johannes L. Schonberger and Jan-Michael Frahm. Structure-from-Motion Revisited. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 4104-4113. IEEE Computer Society, 2016. 2, 5 +[22] Johannes L. Schonberger, Enliang Zheng, Jan-Michael Frahm, and Marc Pollefeys. Pixelwise View Selection for Unstructured Multi-View Stereo. In Proceedings of European Conference on Computer Vision, pages 501–518, 2016. 2 +[23] Steven M. Seitz, Brian Curless, James Diebel, Daniel Scharstein, and Richard Szeliski. A Comparison and Evaluation of Multi-View Stereo Reconstruction Algorithms. In Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern, pages 519–528, 2006. 2 +[24] Steven M. Seitz and Charles R. Dyer. Photorealistic Scene Reconstruction by Voxel Coloring. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 1067-1073, 1997. 2 +[25] Vincent Sitzmann, Justus Thies, Felix Heide, Matthias Nießner, Gordon Wetzstein, and Michael Zollhöfer. DeepVoxels: Learning Persistent 3D Feature Embeddings. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 2437-2446, 2019. 2 +[26] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Representations. In Proceedings of Advances in Neural Information Processing Systems, pages 1119–1130, 2019. 1, 2 + +[27] Justus Thies, Michael Zollhöfer, and Matthias Nießner. Deferred neural rendering: image synthesis using neural textures. ACM Trans. Graph., 38(4):66:1-66:12, 2019. 2 +[28] Qingshan Xu and Wenbing Tao. Multi-Scale Geometric Consistency Guided Multi-View Stereo. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 5483–5492, 2019. 5 +[29] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. NeRF++: Analyzing and Improving Neural Radiance Fields. arXiv preprint arXiv:2010.07492, 2020.5 +[30] Shuaifeng Zhi, Tristan Laidlow, Stefan Leutenegger, and Andrew J Davison. In-Place Scene Labelling and Understanding with Implicit Scene Representation. arXiv preprint arXiv:2103.15875, 2021. 8 +[31] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snively. Stereo magnification: learning view synthesis using multiplane images. ACM Trans. Graph., 37(4):65:1-65:12, 2018. 2 \ No newline at end of file diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/images.zip b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..250b7e1f15e1e947e0d73eafb435a80f7b3c6543 --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e2f5dc5b557dbdb6b943effa9e5d032a53befcc6c291770f9687e1db7869c9f +size 620465 diff --git a/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/layout.json b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f0c62aabc65b5c54caa3f623e81b3ce65fce0dda --- /dev/null +++ b/learningobjectcompositionalneuralradiancefieldforeditablescenerendering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff36d1cd0664f088429fc46c24daa4b395a877a61952fa7763eb797e2b13a8fb +size 429150 diff --git a/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_content_list.json b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ba968e70e0d0d37f41beacb155eeb76bfbfd6e62 --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:127347c0d5b81b7d67f28794528fe379adf13c92a454b6bc98949f99fe3e3dc4 +size 82992 diff --git a/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_model.json b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a6f012f2f3b60f4d7b79bbc411a8a622add339ca --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feca1f75ce591b2675215c221fad2eb93029b5dce982a6c3a31a865f9d619af9 +size 101658 diff --git a/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_origin.pdf b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6388376996b58bd570d1de54f7b5e1bc82b0666a --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/012d2b87-b51a-4a2b-9621-3b9e3ce12c85_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fc8dbc70b54c2083d23c9645d69ec1e43afcd3575c316cfc43c988a165e05e0 +size 6993722 diff --git a/learningprivacypreservingopticsforhumanposeestimation/full.md b/learningprivacypreservingopticsforhumanposeestimation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4285bb43f930da031a1cdc51d3919d649cebb212 --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/full.md @@ -0,0 +1,342 @@ +# Learning Privacy-preserving Optics for Human Pose Estimation + +Carlos Hinojosa1, Juan Carlos Niebles2, Henry Arguello1 +1Universidad Industrial de Santander 2Stanford University https://carloshinojosa.me/project/privacy-hpe/ + +![](images/dd4ee7e951819e09dac87292d416784dc83b244368fd1649a50426fe60985b88.jpg) +Figure 1: Standard cameras acquire visual details from the scene that could lead to privacy issues. In this work, we propose to learn privacy-preserving optics to perform human pose estimation (HPE). Our optimized lens incorporates several optical aberrations that degrade the image to hide private visual details while it still captures enough visual information to perform human pose estimation. + +![](images/f38e78cf8c70b162801f00ade539ea83fa9a71e30a17bcb51986e2d28d3f0c60.jpg) + +# Abstract + +The widespread use of always-connected digital cameras in our everyday life has led to increasing concerns about the users' privacy and security. How to develop privacy-preserving computer vision systems? In particular, we want to prevent the camera from obtaining detailed visual data that may contain private information. However, we also want the camera to capture useful information to perform computer vision tasks. Inspired by the trend of jointly designing optics and algorithms, we tackle the problem of privacy-preserving human pose estimation by optimizing an optical encoder (hardware-level protection) with a software decoder (convolutional neural network) in an end-to-end framework. We introduce a visual privacy protection layer in our optical encoder that, parametrized appropriately, enables the optimization of the camera lens's point spread function (PSF). We validate our approach with extensive simulations and a prototype camera. We show that our privacy-preserving deep optics approach successfully degrades or inhibits private attributes while maintaining important features to perform human pose estimation. + +# 1. Introduction + +Cameras are ubiquitous and pervasive today: we have them in our smartphones, cars, homes, and cities. The tremendous amount of data collected from these devices enables a myriad of applications using computer vision-based technologies. We encounter such technologies in our daily life. At hospitals, visual sensors have given rise to ambient intelligence: physical spaces that are sensitive and responsive to the presence of humans. In this scenario, visual systems enable more efficient clinical workflows and improved + +patient safety in intensive care units and operating rooms [15]. In the context of gaming, camera devices use action and gesture recognition to create an interactive game experience [44, 50]. However, with all these cameras collecting images in an always-connected digital world, a big challenge has been raised: how to develop privacy-preserving computer vision systems? Specifically, we want to prevent the camera system from obtaining detailed visual data containing private information (such as faces), desirably at the hardware level. Simultaneously, we want the system to capture useful information that enables understanding surrounding objects and ongoing events. + +For decades, cameras have been engineered to imitate the human vision system. Once the optical system is fixed, we use the cameras to acquire multiple high-fidelity images. Then we tune computer vision algorithms to optimize their accuracy at specific tasks. Most computer vision applications, even privacy-preserving approaches, rely on such a traditional digital imaging system. For example, one can detect privacy-sensitive everyday situations and enable or disable an eye tracker's first-person camera using a mechanical shutter [43]. However, such a method performs software-level processing on high-resolution videos acquired by traditional cameras, which may already contain privacy-sensitive data that could be exposed in an attack. + +Instead of using traditional cameras to acquire the data and then using software-level processing to preserve privacy, a better idea would be to design a camera that directly obviates sensitive data while still obtaining useful information for a given task. Recently, thanks to various software and hardware advances, the entire system (camera's optical elements and image processing algorithms parameters) can be optimized in an end-to-end fashion, enabling the design + +of domain-specific computational cameras [8, 24, 41, 18]. In the literature, the end-to-end optimization of domain-specific computational cameras is known as Deep Optics. Prior work in this line aims to improve the optical elements to acquire high-resolution/high-fidelity images and simultaneously improve the performance of computer vision algorithms. Here, we are interested in extending this philosophy to design privacy-preserving optical systems. + +In this paper, we design a privacy-preserving computational camera via end-to-end optimization to capture useful information to perceive humans in the scene while hiding privacy-sensitive information. Since many computer vision applications need to analyze humans as the first step in their frameworks, we are interested in jointly optimizing a freeform lens (the spatially varying surface height of a lens) together with a human pose estimation (HPE) network to develop a privacy-preserving HPE system. The contributions of our work are the following: (i) We introduce a privacy-preserving end-to-end optimization framework to extract useful information from the scene yet preventing the imaging system from obtaining detailed and privacy-sensitive visual data. (ii) Using our end-to-end optimization framework, we optimize an optical encoder (Hardware-level protection) with a software decoder (convolutional neural net) to add a visual privacy protection layer to HPE. We jointly optimize the optical elements of the camera lens and fine-tune the backbone of a HPE network. We show that it is not necessary to retrain the HPE network layers to achieve privacy preservation. (iii) We perform extensive simulations on the COCO dataset to validate our proposed privacy-preserving deep optics approach for HPE. (iv) We built a proof-of-concept optical system. Our experimental results in hardware match the simulations. + +In principle, our main objective is to show the benefits of a deep-optics-inspired approach to develop robust privacy-preserving vision algorithms. We design the optical system lens to degrade the image quality and obscure sensitive private information, which is opposite from the traditional approach of improving the imaging quality. We do not aim to develop a new HPE network. Instead, we add a visual privacy protection layer to an already trained HPE network using the designed optics and fine-tune the backbone layers. Our experiments show that there is a trade-off between the attained scene degradation and the HPE precision. + +# 2. Related work + +Current computer-vision algorithms for human pose estimation (HPE) do not consider privacy and rely on high-resolution images. Most existing privacy-preserving computer vision approaches tackle the action recognition task, while privacy-preserving HPE is not widely explored yet. + +Human Pose Estimation. There are multiple approaches for addressing the multi-person HPE problem. Re + +cently, convolutional networks [28, 32, 45, 46, 47, 48] have shown superior performance over prior methods such probabilistic graphical models or pictorial structures [33, 54, 55]. In general, there are two broadly used approaches for tackling the multi-person HPE problem [31]: bottom-up, where the body keypoints are predicted first and then grouped into person instances [49, 53]; and top-down, where the human bodies are detected first and then, for each detected body, joints are obtained via single-person pose estimation. Among bottom-up representative works, the OpenPose architecture [5] proposes to link the keypoints that are likely to lie in the same person using part-affinity fields. We build our privacy-preserving HPE approach on top of the OpenPose model. + +Privacy-preserving Computer Vision. We divide prior work into software-level and hardware-level protection. The latter is considered more robust to attacks. + +Software-level Privacy Protection. Most prior privacy-preserving computer vision methods operate after a high-fidelity image has been acquired; hence they only provide software-level privacy protection. These methods rely on domain knowledge and hand-crafted approaches, such as pixelation, blurring, and face/object replacement, to protect sensitive information [1, 9, 30]. This can be useful in practical settings when we know in advance what to protect in the scene. More recent works propose a more general approach that learns privacy-preserving encodings through adversarial training [4, 34, 52]. They actively learn to degrade or inhibit private attributes while maintaining important features to perform inference tasks. Unfortunately, there is no prior work in software-level privacy protection for HPE. The closest works study human fall detection [2] and body posture [12]. While these software-level approaches preserve privacy in the final application, the acquired images still do not protect privacy. + +Hardware-level Privacy Protection. Hardware-level privacy protection approaches rely on the optical system to add a layer of security by removing sensitive data during image acquisition. Prior work uses low-resolution cameras to capture videos and avoid the unwanted leak of identity information of the human subjects [37, 38]. One can also select a defocus blur to provide a certain level of privacy over a working region within the limits of sensor size [35, 36]; however, only using optical defocus for privacy may be susceptible to reverse engineering, as we will show in Section 4. More recently, a coded aperture camera is used to directly perform human action recognition from encoded measurements without requiring image restoration as an intermediate step [51]. The only prior work on privacy-preserving HPE uses low-resolution depth images as input to an end-to-end framework that integrates a multi-scale super-resolution network with a 2D HPE network [42]. All these methods assume that the attacker has no access to the hardware. We + +![](images/ce52342e2e50b991467773436501ca222cb7fa50d110e57940192e1b50efbe01.jpg) +Figure 2: Our proposed end-to-end framework. The optical-encoder consists of a camera with a convex thin lens and a refractive optical element add-on. We achieve privacy-protection by jointly optimizing the optics (by adding aberrations directly on the freeform lens surface) and fine-tuning some layers of the backbone network while keeping the human pose estimation network frozen. + +propose a hardware-level privacy-preserving HPE framework: we leverage Deep optics to design an optical lens that obscures private information while enabling HPE. + +Deep Optics. Traditionally, the optics system and image processing algorithms have been developed separately. First, the optical elements are configured and fixed; and second, the parameters in the image processing algorithm are tuned to perform a specific task [26]. Recently, the idea of jointly optimizing the optical system and the image processing algorithm has drawn broad attention and is known as Deep Optics [41]. This idea has been successful in color imaging and demosaicing [6], extended depth of field and super-resolution imaging [41], monocular depth imaging [8, 16], image classification [7], time-off light imaging [23], high dynamic range imaging [24], and computational microscopy [17, 27]. Their philosophy is to enhance the imaging quality to improve the performance of computer vision algorithms. We introduce a radically opposite approach: we design the optical elements to degrade the image quality and obscure private information while still enabling HPE. + +# 3. Privacy-preserving Pose Estimation + +We are interested in the privacy-preserving human pose estimation task. Our general strategy is to optimize the camera optics and the human pose estimation network jointly to achieve privacy protection via image degradation. The key idea is that we can modify the camera lens to degrade the image in such a way that the identity of the subjects is obscured while preserving important features for pose estimation. To achieve this, we introduce the end-to-end framework depicted in Figure 2. Our method has two key components: an Optical Encoder (Section 3.1) and a CNN Decoder (Section 3.2). The Optical Encoder module is parametrized appropriately to allow for learning of the camera lens. The CNN Decoder performs the task of human pose estimation on our optically degraded image. During training, we optimize these two modules jointly to obtain our privacy-preserving pose estimation system. The result of the training process is two-fold: the camera lens param + +eters $\alpha^{*}$ and the convolutional network for pose estimation $h^{*}$ . To achieve this, we can formulate a loss function for learning that combines our two goals: + +$$ +\alpha^ {*}, h ^ {*} = \underset {\alpha , h} {\arg \min } L _ {T} (h) + L _ {P} (\alpha). \tag {1} +$$ + +where $L_{T}$ is the loss function for the pose estimation task, and $L_{P}$ is a loss function that encourages privacy-preservation. During inference, we can deploy our system in hardware by constructing a camera lens using the optimal parameters $\alpha^{*}$ that acquires degraded images on which our network $h^{*}$ can perform pose estimation. One could also deploy a less-secure system as a software-only solution, by implementing the image degradation post-acquisition. The rest of this section describes the details of our framework. + +# 3.1. Optical Encoder + +The Optical Encoder module in Figure 2 is responsible for the image acquisition process in our privacy-preserving human pose estimation (HPE) system. As outlined earlier, our strategy for privacy-preservation is to modify the optical system of the camera during training. The goal is to produce images that visually obscure the identity of the person but still preserve important features for pose estimation. We achieve this by adopting the deep optics philosophy: we use an end-to-end training approach to jointly optimize the camera optics and the HPE network. However, our motivation diverges from prior deep optics [24, 41]: we want to optimize the camera optics by adding optical aberrations directly on the surface of the thin lens (freeform lens) instead of removing them. Furthermore, unlike prior deep optics methods, we do not perform image reconstruction and instead we work directly with the acquired low-quality image. + +The key to enable such end-to-end learning is to appropriately parametrize the camera lens so that we can perform back-propagation. Note that the training signal to optimize the camera optics will back-propagate from the privacy-preserving loss $L_{P}(\alpha)$ (Section 3.3). There are three key parts to our parametrization: the lens surface profile $\phi$ , which we write in terms of Zernike coefficients $\alpha$ , and the + +corresponding point spread function (PSF) $\mathbf{H}$ for the camera lens. First, we describe the relationship between $\phi$ and $\mathbf{H}$ by the image formation Model below. Then, we introduce the parametrization of the lens surface profile $\phi$ in terms of coefficients $\alpha$ for the Zernike polynomials. + +Image Formation Model. We derive a wave-based image formation model for natural scenes to write the PSF $\mathbf{H}$ in terms of $\phi$ , assuming spatially incoherent light. Similar to recent works on end-to-end camera designs [7, 41], we model the light transport in the camera using a differentiable Fourier optics model [13]. + +Figure 2 depicts our optical system, which consists of a convex thin lens with a custom refractive optical element add-on with surface profile $\phi$ . Similar to a photographic filter, such an optical element is mounted directly in front of the lens. The response of the camera system to a point light source is described by the point spread function (PSF) created by the lens. The sensing process can be modeled as a 2D convolution operation between the scene and PSF as + +$$ +\mathbf {y} = g (\mathbf {H} * \mathbf {x}) + \eta , \tag {2} +$$ + +where $\mathbf{x} \in \mathbb{R}_{+}^{w \times h}$ is the scene and it is represented as a discrete color image with $w \times h$ pixels, and each pixel has value in $[0,1]$ ; $\eta$ represents the Gaussian noise in the sensor, and $g(\cdot)$ is the camera response function, which we assume linear. This model also assumes that the PSF is shift-invariant, but the model could be generalized. + +Assuming that the thin lens has a focal length $f$ at a distance $d_{2}$ from the sensor, the relationship between the infocus distance and the sensor distance in the paraxial ray approximation is given by the thin-lens equation: $1 / f = 1 / d_{1} + 1 / d_{2}$ . Therefore, an object at a distance $d_{1}$ in front of the lens appears in focus at a distance $d_{2}$ behind the lens. Assuming that the scene is at optical infinity, we first propagate the light emitted by the point, represented as a spherical wave, to the lens. The complex-valued wave field immediately before the lens is given by: + +$$ +U (x, y) = \exp \left(i k \sqrt {x ^ {2} + y ^ {2} + z ^ {2}}\right), \tag {3} +$$ + +where $k = 2\pi /\lambda$ is the wavenumber. The refractive optical element first delays the phase of this incident wavefront by an amount proportional to the surface profile $\phi$ of the optical element at each point $(x,y)$ . Equivalently, the optical element may be represented by a multiplicative phase transformation of the form + +$$ +t _ {\phi} (x, y) = \exp (i k (n (\lambda) - 1) \phi (x, y)), \tag {4} +$$ + +where $n(\lambda)$ is the wavelength-dependent refractive index of the optical element material. + +The light wave continues to propagate to the camera lens, which induces the following phase transformation [13] + +$$ +t _ {l} (x, y) = \exp \left(- i \frac {k}{2 f} \left(x ^ {2} + y ^ {2}\right)\right). \tag {5} +$$ + +Considering that a lens has a finite aperture size, we use a binary circular mask $A(x,y)$ with diameter $D$ to model the aperture and block light in regions outside the open aperture. To find the electric field immediately after the lens, we multiply the amplitude and phase modulations of the refrac + +tive optical element and lens with the input electric field: + +$$ +\tilde {U} (x, y) = A (x, y) t _ {\phi} t _ {l} (x, y) U (x, y). \tag {6} +$$ + +Finally, the field propagates a distance $d_{2}$ to the sensor with the exact transfer function [13]: + +$$ +T _ {d _ {2}} \left(f _ {x}, f _ {y}\right) = \exp \left[ i k d _ {2} \sqrt {1 - \left(\lambda f _ {x}\right) ^ {2} - \left(\lambda f _ {y}\right) ^ {2}} \right], \tag {7} +$$ + +where $(f_x, f_y)$ are spatial frequencies. This transfer function is applied in the Fourier domain as: + +$$ +\bar {U} \left(x ^ {\prime}, y ^ {\prime}\right) = \mathcal {F} ^ {- 1} \left\{\mathcal {F} \left\{\tilde {U} (x, y) \right\} \cdot T _ {d _ {2}} \left(f _ {x}, f _ {y}\right) \right\}, \tag {8} +$$ + +where $\mathcal{F}$ denotes the 2D Fourier transform. Since the sensor measures light intensity, we take the magnitude-squared to find the values of the PSF $\mathbf{H}$ at each position $(x,y)$ as: + +$$ +H \left(x ^ {\prime}, y ^ {\prime}\right) = | \bar {U} \left(x ^ {\prime}, y ^ {\prime}\right) | ^ {2}. \tag {9} +$$ + +Lens Parametrization. We parametrize the lens surface profile $\phi$ with the Zernike basis, which leads to smoother surfaces, as + +$$ +\phi = \sum_ {j = 1} ^ {q} \alpha_ {j} \mathbf {Z} _ {j}, \tag {10} +$$ + +where $\mathbf{Z}_j$ is the $j$ -th Zernike polynomial in Noll notation, and $\alpha_{j}$ is the corresponding coefficient [3]. Each Zernike polynomial describes a wavefront aberration; hence the surface profile $\phi$ is formed by the linear combination of all aberrations. In this regard, the optical element parameterized by $\phi$ can be seen as an optical encoder, where the coefficients $\alpha_{j}$ determine the data transformation. Therefore, different from common deep optics approaches, our end-to-end training finds a set of coefficients $\alpha^{*} = \{\alpha_{j}\}_{j = 1}^{q}$ that provides the maximum visual distortion of the scene but allows to extract relevant features to perform HPE. + +# 3.2. CNN Decoder + +To perform HPE, we use the OpenPose network architecture [5]. The OpenPose network is composed of a VGG-19 [40] backbone, and two branches of convolutional layers. The backbone network extracts features from an image of size $w \times h$ , which are then fed into the two branches. One branch predicts a set of confidence maps, where each map represents a specific body part location; the second branch predicts a set of Part Affinity Fields (PAFs), where each field represents the degree of association between parts. Successive stages are performed to refine the predictions made by each branch. Finally, the confidence maps and the PAFs are parsed by greedy inference to produce the 2D locations of body keypoints for each person in the image [5]. + +HPE Loss Function $L_{T}$ . The OpenPose loss accounts for both the body and face keypoints to improve human pose estimation in an image. Let $\mathcal{S} = \{\mathbf{S}_1, \mathbf{S}_2, \dots, \mathbf{S}_E\}$ be the set of confidence maps, where each map $\mathbf{S}_e \in \mathbb{R}^{w \times h}$ represents a specific keypoint location, $e \in \{1, \dots, E\}$ . Similarly, let $\mathcal{V} = \{\mathbf{V}_1, \mathbf{V}_2, \dots, \mathbf{V}_C\}$ be the set of PAFs, where each affinity field $\mathbf{V}_c \in \mathbb{R}^{w \times h \times 2}$ represents the degree of association between the keypoints, and $c \in \{1, \dots, C\}$ . We split the confidence maps as $\mathcal{S} = \{\mathcal{S}_B, \mathcal{S}_F\}$ , where $\mathcal{S}_B \subseteq \mathcal{S}$ contains the maps $\mathbf{S}_e$ for the body keypoints, and + +$\mathcal{S}_F \subseteq \mathbf{S}$ contains the maps $\mathbf{S}_e$ for the face keypoint locations. Similarly, we split the PAFs as $\mathcal{V} = \{\mathcal{V}_B, \mathcal{V}_F\}$ , where $\mathcal{V}_B \subseteq \mathcal{V}$ contains the affinity fields $\mathbf{V}_c$ of the body limbs, and $\mathcal{V}_F \subseteq \mathcal{V}$ contains the affinity fields $\mathbf{V}_c$ that represent the degree of association between two face parts. We define the loss function for a subset of keypoints $\chi$ at stage $\tau$ is + +$$ +F _ {\tau} (\chi) = \sum_ {\delta = 1} ^ {| \chi |} \sum_ {\mathbf {p}} \mathbf {B} (\mathbf {p}) \cdot \left\| \chi_ {\delta} ^ {\tau} (\mathbf {p}) - \chi_ {\delta} ^ {*} (\mathbf {p}) \right\| _ {2} ^ {2} \tag {11} +$$ + +where $|\chi|$ is the number of keypoints in the subset. For instance, if $\chi = S_B$ then $|\chi|$ will be the total number of body-related confidence maps. $\mathbf{B}$ is a binary mask with $\mathbf{B}(p) = 0$ when the annotation is missing at the pixel $p$ , and $\chi_{\delta}^{*}$ denotes the groundtruth. Then, the overall OpenPose $L_{T}$ is + +$$ +L _ {T} = \sum_ {\tau = 1} ^ {\Gamma_ {1}} F _ {\tau} (\mathcal {V} _ {B}) + F _ {\tau} (\mathcal {V} _ {F}) + \sum_ {\tau = \Gamma_ {1} + 1} ^ {\Gamma_ {1} + \Gamma_ {2}} F _ {\tau} (\mathcal {S} _ {B}) + F _ {\tau} (\mathcal {S} _ {F}), \tag {12} +$$ + +where $\Gamma_{1}$ and $\Gamma_{2}$ denote the total of PAF and confidence map stages, respectively. + +# 3.3. Privacy-preserving Loss Function $L_{P}$ + +Defining a privacy-preserving loss function is not a straightforward task, and the definition will depend on concrete application contexts. There are various privacy-related attributes, such as the face, race, gender, or age [29]. However, the face is the main attribute we would like to obscure in our privacy-preserving vision task. Therefore, we define the privacy-preserving loss taking into account the face keypoints detection in the images. In principle, we are not interested in obtaining an accurate localization of face keypoints, and we would like to obscure such face regions from the image. Then, we only want to preserve the body keypoints and let the end-to-end training degrade all the image's spatial details (including the faces). To further enforce image degradation, we maximize the $\ell_2$ norm error between the original image $\mathbf{x}$ and the acquired image $\mathbf{y}$ , defined as + +$$ +L _ {E} = \sum_ {b} \frac {1}{2} \| \mathbf {y} _ {b} - \mathbf {x} _ {b} \| _ {2} ^ {2}, \tag {13} +$$ + +where the subscript $b$ denotes the color bands of the RGB images. We define the privacy-preserving loss function as + +$$ +L _ {P} = - \sum_ {\tau = 1} ^ {\Gamma_ {1}} F _ {\tau} \left(\mathcal {V} _ {F}\right) - \sum_ {\tau = \Gamma_ {1} + 1} ^ {\Gamma_ {1} + \Gamma_ {2}} F _ {\tau} \left(\mathcal {S} _ {F}\right) - \beta_ {2} L _ {E}. \tag {14} +$$ + +Finally, considering Eq. 1, we compute the total loss at the end of our proposed framework, as follows + +$$ +L = L _ {T} + L _ {P} = \beta_ {1} \left(\sum_ {\tau = 1} ^ {\Gamma_ {1}} F _ {\tau} \left(\mathcal {V} _ {B}\right) + \sum_ {\tau = \Gamma_ {1} + 1} ^ {\Gamma_ {1} + \Gamma_ {2}} F _ {\tau} \left(\mathcal {S} _ {B}\right)\right) - \beta_ {2} L _ {E}. \tag {15} +$$ + +# 3.4. Training Details + +Optics Layer Simulation. We simulate a sensor with pixel size of $3.40\mu \mathrm{m}$ and resolution of $864\times 864$ pixels. We use the first $q = 350$ Zernike coefficients in Noll notation to shape the surface profile $\phi$ . The fourth Zernike coefficient (the defocus term) is initialized, such that the lens has a focal length of $f = 25\mathrm{mm}$ . The optical element is discretized with a $3.40\mu \mathrm{m}$ feature size on an $864\times 864$ grid. + +Fine-tuning. We are interested in adding a privacy protection layer to a pre-trained OpenPose network. Hence, to perform training we assume an aberration-free freeform lens and use the pretrained weights of a Tensorflow implementation of OpenPose [22] as a starting point. After initialization with the pre-trained weights, we freeze the two branches of OpenPose and only fine-tune some layers of the VGG-19 backbone with a lower learning rate to learn extracting human body features from the private image $\mathbf{y}$ . Figure 2 illustrates the frozen and fine-tuned layers. + +Training. During training, we first perform one forward pass through the network by convolving the images from the training set with the PSF $\mathbf{H}$ to obtain the optically-encoded sensor image $\mathbf{y}$ , as described by Eq. 2. Next, the VGG-19 backbone extracts features from $\mathbf{y}$ , and then the features are fed into the two branches of the OpenPose architecture. Now, we split the confidence maps $S$ and PAFs $\mathcal{V}$ into body-related and face-related features as described in the Section 3.2, and compute the loss described in Eq. 15. After computing $L$ , we use the automatic differentiation capabilities of Tensorflow to back-propagate the error and update the parameters of the VGG-19 backbone and the coefficients $\alpha_{j}$ that model surface profile $\phi$ of the lens using Eq. 10. We trained the end-to-end model using Adam optimizer with a batch size of 22 and an initial learning rate of $2\times 10^{-5}$ . We applied an exponential learning rate decay with a decay factor of 0.666 that is triggered after 15K, 20K, 25K, 28K, and 35K training steps. We trained the network for 50K steps (gradient updates), which took about 24 hours on a Tesla V100-SXM2 GPU with 32 GB of memory. + +# 4. Experimental Results + +The goal of our work is privacy-preserving pose estimation, so evaluate performance in the task of human pose estimation (HPE), as well as the level of privacy protection. We evaluate HPE following standard practice. To evaluate privacy protection, we use two indirect proxies: image degradation and face recognition. Our experiments are performed on two implementations of our framework: a software-only simulation and a hardware prototype built in the lab. + +Dataset, Metrics and Evaluation Method. We train our proposed end-to-end approach on the COCO [21] 2017 keypoints dataset and evaluate our approach on the val2017 set. To quantitatively evaluate HPE, we use the standard COCO evaluation metric: Object Keypoint Similarity (OKS) [21]. Since we aim at preserving privacy, we expect the estimation of face keypoints to degrade, while we want to maintain good performance on the estimation of body keypoints. To make a fair comparison, we slightly modify the COCO evaluation script to not consider the face keypoints. We report the standard average precision (AP) and recall (AR) scores: AP, $\mathrm{AP}^{50}$ , $\mathrm{AP}^{75}$ , $\mathrm{AP}^M$ (medium objects), $\mathrm{AP}^L$ (large objects), and AR. To measure image + +![](images/d64701e109e6cdc0f319ad76c5536ab8d61e2c7fdbb7cd2984cb6f22822bb3dd.jpg) +Figure 3: Experiment I. Comparison of different privacy-preserving losses. The performance of the proposed end-to-end framework using different losses is depicted with different colors. + +![](images/41facf60dfdd8ebf3591e4d54ee2dbed4e11db1dd62754258030dc94228fa624.jpg) +Figure 4: Experiment II. Face recognition performance on images acquired with our optimized lens. + +degradation, we use the peak-signal-to-noise ratio (PSNR) and the structural similarity index measure (SSIM) [19]. Large values of PSNR or SSIM indicate high quality. Thus, we expect to achieve the minimum PSNR or SSIM values while achieving high AP on the human pose keypoints. We report the average PSNR and SSIM over all images from the validation set. Finally, we use an implementation of the face recognition network ArcFace [10] to measure privacy. We train ArcFace on Microsoft Celeb (MS-Celeb-1M) [14] and test on LFW [20], AgeDB-30[25] and CFP-FP [39]. We measure face recognition performance in terms of the area under curve (AUC) of the ROC curve. + +# 4.1. Simulation Experiments + +Ablation study. We conduct five ablation experiments and investigate different configurations for our architecture. + +Experiment $I$ explores two alternative formulations for the privacy-preserving loss $L_{P}$ . We define such losses as: + +$$ +L _ {P _ {1}} = - \beta_ {3} \left(\sum_ {\tau = 1} ^ {\Gamma_ {1}} F _ {\tau} \left(\mathcal {V} _ {F}\right) - \sum_ {\tau = \Gamma_ {1} + 1} ^ {\Gamma_ {1} + \Gamma_ {2}} F _ {\tau} \left(\mathcal {S} _ {F}\right)\right) - \beta_ {2} L _ {E} \tag {16} +$$ + +$$ +L _ {P _ {2}} = - \sum_ {\tau = 1} ^ {\Gamma_ {1}} F _ {\tau} \left(\mathcal {V} _ {F}\right) - \sum_ {\tau = \Gamma_ {1} + 1} ^ {\Gamma_ {1} + \Gamma_ {2}} F _ {\tau} \left(\mathcal {S} _ {F}\right) - \beta_ {4} L _ {F}, \tag {17} +$$ + +where $\beta_{3} > 1$ + +$$ +L _ {F} = \operatorname {S i m} _ {\cos} \left(a _ {f} (\mathbf {x}), a _ {f} (\mathbf {y})\right), \tag {18} +$$ + +$Sim_{cos}$ denotes the cosine similarity, and $a_{f}(\cdot)$ stand for the ArcFace model [10]. To compute $L_{F}$ , we use the pretrained ArcFace model on faces extracted from the input image $\mathbf{x}$ + +and distorted image $\mathbf{y}$ . See Section 2 of supplementary material for more details. Figure 3 shows performance versus training step obtained by training with each of the three privacy-preserving losses (each in a different color). Performance is measured under three viewpoints: Face recognition AUC, HPE AP, and image degradation SSIM. We show with dashed lines the upper bound for each metric. Face recognition AUC is calculated on the LFW dataset. To do this, for each privacy-preserving HPE model trained with a specific privacy loss, we first generate a "private" MSCeleb-1M dataset and train the ArcFace model – this equivalent to an attack that can obtain an annotated set of face images acquired with our camera. We do not train ArcFace from scratch; instead, we load the pretrained weights and fine-tune the model using the "private" set. We observe that $L_{P_1}$ produces highly distorted images, and the face recognition performance is poor; however, the HPE AP is the lowest in comparison with the other losses. $L_{P_2}$ obtains the best HPE performance, but image distortion decreases slowly and seems to stabilize after 25K training steps; hence the face recognition achieves good performance, which is not desired. Our proposed privacy-preserving loss $L_P$ achieves good HPE results and low face recognition performance. + +In Experiment II, we test the face recognition performance on images acquired using our proposed privacy-preserving lens on the LFW and AgeDB-30 datasets. Figure 4 show the ROC curves for each testing approach: "No-privacy Model" uses the pretrained ArcFace model on the original images; "Pretrained model" uses the pretrained ArcFace model on the private version of each dataset; "Trained model" uses an ArcFace model trained from scratch using the private version of the MS-Celeb-1M dataset; "Fine-tuned Model" uses a pretrained ArcFace model fine-tuned with the private version of the MS-Celeb-1M dataset. As observed, the fine-tuned model performs best on the LFW dataset compared to the other testing approaches. However, the ArcFace model performance is similar to a random classifier on the AgeDB-30 dataset for all the testing approaches. The ArcFace model does not perform well on the images generated by our proposed lens design. See results with the CFP-FP dataset in our supplementary. + +In Experiment III, we optimize for $q = 350$ Zernike coefficients and do not fine-tune the HPE backbone layers. Table 1 shows that the optimization did not converge to an optimal point; hence the network is unable to estimate the pose in the degraded image even after few training steps. After training, we obtain a mean PSNR of 11.452 and SSIM of 0.496. In experiment IV, we fix the number of Zernike coefficients to $q = 350$ and fine-tune the first 10,20, and 40 layers of the VGG-19 backbone. Fine-tuning the first 20 layers leads to the best results in AP while achieving low PSNR and SSIM values. In experiment $V$ , we fix the layers to be fine-tuned in the network and train using a different + +
ExperimentFine-tuned LayersZernike CoefficientsPSNRSSIMAP
IIINo Fine-tune35011.4520.496-
IV1035014.5980.5650.263
2035014.8510.5670.302
4035014.5770.5620.251
V201516.6920.5820.168
205016.3280.5790.231
2015016.1420.5710.258
+ +Table 1: Ablation study of our method on COCO val2017 dataset using the OpenPose network. The configuration shown in bold leads to the best results in terms of image degradation and AP. + +
MethodPSNRSSIMAP\( AP^{50} \)\( AP^{75} \)\( AP^M \)\( AP^L \)AR
OPPS [5]--0.4210.6550.4390.4440.4280.506
Defocus Lens[35]16.6140.5980.1970.4320.1550.1260.2990.256
Low-Resolution[38]18.540.4760.0670.1970.0320.0310.1230.106
PP-OPPS (Ours)14.8510.5670.3020.5550.2660.2760.3590.363
+ +Table 2: Comparisons on the COCO validation set. We compare our method against two traditional privacy-preserving approaches: Defocus and Low-resolution cameras. The PP prefix stands for our proposed privacy-preserving approach. + +number of Zernike coefficients. Increasing the number of Zernike coefficients leads to better encoding; hence AP increases while PSNR and SSIM decrease. However, memory consumption also increases linearly since we need to store all the Zernike basis. In the following experiments, we use the best configuration from Table 1 (shown in bold font). + +Comparison with other methods. Privacy-preserving HPE methods are not well explored in the literature. Therefore, to compare our method, we adapt the ideas of using low-resolution cameras [38] and cameras with a defocus lens [35] to provide visual privacy protection. We simulate both types of cameras, fix the optics so that the lens is not optimized during learning, and fine-tune the first 20 trainable layers of the HPE backbone network similarly to our proposed approach. To implement the low-resolution approach, we use images with a resolution of $32 \times 32$ . We compare our method with a Tensorflow implementation of OpenPose (OPPS) [5] architecture [22]. Table 2 reports the COCO keypoints evaluation results and the average of the PSNR and SSIM image quality metrics among all images from the COCO validation set. In the table, PP-OPPS stands for our proposed privacy-preserving approach for OPPS. The simple defocus lens achieves an AP of 0.197 on low-quality images with an average PSNR of 16.614 and SSIM of 0.598. Our proposed optimized lens leads to better results since it adds more aberrations to the optical system than the defocus lens approach, which only incorporates one aberration (defocus). The low-resolution approach does not work well with our proposed end-to-end training approach since it leads to the lower average SSIM value and the lowest performance in terms of keypoints AP. See our supplementary for results when using other HPE network. + +Robustness to Deconvolution. We investigate the ro- + +![](images/c70b9b1030587705ef77f679e40d85cb4c1de180e14207d9acaf9f1e5a82d951.jpg) +Figure 5: Qualitative results on example COCO images. We compare our proposed privacy-preserving pose estimation results using the optimized lens with the Non-privacy approach using a standard lens. The last column depicts a failure case where we fail to estimate the pose of far distant people. + +bustness of our proposed lens design to deconvolution attacks. In the worst scenario, we assume that an attacker knows the set of Zernike coefficients that form the surface profile $\phi$ , i.e., the PSF is known. Then, the attacker could perform a non-blind deconvolution to reveal the identity of a person within the scene. Figure 6 illustrates our results. Although the defocus lens seems to obscure visual details, it is susceptible to reverse engineering, and the identity of people can be revealed using Wiener deconvolution [11]. The deconvolution approach does not work well for our proposed lens design as it has significantly more aberrations, making it more robust. In a more realistic scenario, an attacker can access a large collection of blur images acquired with our proposed camera but does not know the PSF. We already explore this scenario (blind-deconvolution) and present some results in Section 5 of our supplementary. + +Qualitative results. Figure 5 shows a visual comparison of our proposed method using the optimized lens against the results from the original OpenPose (No-privacy pose estimation), which works on images acquired with a standard lens. Our proposed privacy-preserving approach achieves good human pose estimation on degraded images. The last column shows an example failure case of our method; as observed, the method fails to estimate distant people's pose. However, when a person is far from the camera, less is the privacy concern; hence the privacy protection given by our method is still useful in most cases. + +![](images/f32792dfffb7845f11343076856faf87b90a3f6388dcf60f657a0ca44708045c.jpg) +Figure 6: Non-blind deconvolution of private images acquired with a defocusing lens compared to our lens. Our image is more robust to deconvolution even when the PSF is known. + +![](images/c266287cd4bd4397cf301779eb3c7c57aa9b6f62dec1409832751e1447ebe519.jpg) + +![](images/bb38f26e60385d4cbb022898d1aab0d0b390c2c58c8152ecfd495966ca242996.jpg) +Standard Lens +Figure 7: (Top) Experimental Hardware Setup for our privacy-preserving approach. (Bottom) Qualitative results on some example images acquired by the prototype camera. + +![](images/8f7cd73b746710cb54e49f0a4d07d57b08685ba2c070d2069a514e7cd3415b06.jpg) +Our Optimized Lens + +![](images/479ca742c6814ad290bee52ae6d5ede6ca4648cdf44aaab31937c1a0887ce609.jpg) +No-Privacy Pose Estimation + +![](images/c2eabe08147e016d9dacf523416659cbd537464195a651f697facc3db47ed81f.jpg) +Privacy-preserving Pose Estimation + +# 4.2. Hardware Experiments + +To experimentally evaluate the effectiveness of our proposed privacy-preserving approach, we built the proof-of-concept optical system in Figure 7. The prototype comprises a main objective lens coupled with a $4f$ system, which has a phase modulating element at $2f$ . Our Camera is a CANON EOS REBEL T5i placed at the optical setup's image plane. The intermediate image plane is formed by an + +
Total ImagesFine-tuning setTesting setAPAP50AP75AR
3001501500,5620,7310.5320.584
+ +Table 3: Quantitative evaluation of acquired images in our Lab. + +8mm objective lens (NAVITAR MVL8M23), which is relayed by a pair of 75mm Fourier transforming lenses (Thorlabs AC254-075-A-ML). Using a beamsplitter (BS, Thorlabs CCM1-BS013), we placed a deformable mirror (DM, Thorlabs DMP40-P01) at the pupil plane at a distance of $2f = 150\mathrm{mm}$ from the intermediate image plane. Finally, the camera detector is placed at a distance of $2f = 150\mathrm{mm}$ from the deformable mirror. We captured a series of images of a point white light source using a pinhole of $20\mu \mathrm{m}$ to calibrate the acquired PSFs. + +After calibrating the system, we obtain a Non-optimized PSF, i.e., we have an optical system that captures non-privacy RGB images. Then, we simulate the system using our proposed approach to obtain the optimized Zernike polynomials and setup the deformable mirror. The deformable mirror uses the Zernike polynomials to deform its surface, thus modifying the incident light wavefront. The optical system with the deformable mirror creates an optimized PSF that closely resembles the simulated PSF and captures private images, see Fig. 7. We use a small set of captured measurements to fine-tune the HPE network for a few epochs.Finally, we run human pose estimation on our images using the trained privacy-preserving HPE network. Figure 7 shows predicted poses on the acquired private and non-private images. Table 3 presents a quantitative evaluation on a small testing set captured in the laboratory. + +Limitations. The deformable mirror is the main limitation of the proof-of-concept optical system. This device can only use $q = 15$ Zernike Polynomials, which limits the level of distortion of the scene. However, results show that our acquired images successfully protect personal identity by distorting the face. We also performed a quantitative evaluation on a small set of images acquired in the lab. Due to pandemic restrictions, we cannot acquire a larger scale image dataset in the lab. For now, our small scale tests show results consistent with our extensive experiments. + +# 5. Conclusion + +We presented a privacy-preserving approach for pose estimation that consists of an optical encoder that obscures sensitive private information and a decoder that performs HPE on degraded images. We extensively evaluated and experimentally validated our approach on simulations and a hardware prototype. Our qualitative and quantitative results indicate a trade-off between image degradation and HPE accuracy. We plan to extend our method to other computer vision tasks. We will also consider more complex PSFs, such as depth-invariant PSFs, which may improve the HPE of far distant people. + +# References + +[1] Prachi Agrawal and PJ Narayanan. Person de-identification in videos. IEEE Transactions on Circuits and Systems for Video Technology, 21(3):299-310, 2011. 2 +[2] Umar Asif, Benjamin Mashford, Stefan Von Cavallar, Shivanthan Yohanandan, Subhrajit Roy, Jianbin Tang, and Stefan Harrer. Privacy preserving human fall detection using video data. In Machine Learning for Health Workshop, 2020. 2 +[3] Max Born and Emil Wolf. Principles of optics: electromagnetic theory of propagation, interference and diffraction of light. Elsevier, 2013. 4 +[4] Karla Brkic, Ivan Sikiric, Tomislav Hrkac, and Zoran Kalafatic. I know that person: Generative full body and face de-identification of people in images. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2017. 2 +[5] Zhe Cao, Gines Hidalgo Martinez, Tomas Simon, Shih-En Wei, and Yaser A Sheikh. Openpose: Realtime multi-person 2d pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 2, 4, 7 +[6] Ayan Chakrabarti. Learning sensor multiplexing design through back-propagation. In Advances in Neural Information Processing Systems, 2016. 3 +[7] Julie Chang, Vincent Sitzmann, Xiong Dun, Wolfgang Heidrich, and Gordon Wetzstein. Hybrid optical-electronic convolutional neural networks with optimized diffractive optics for image classification. Scientific reports, 8(1):1-10, 2018. 3, 4 +[8] Julie Chang and Gordon Wetzstein. Deep optics for monocular depth estimation and 3d object detection. In Proceedings of the IEEE International Conference on Computer Vision, 2019. 2, 3 +[9] Datong Chen, Yi Chang, Rong Yan, and Jie Yang. Tools for protecting the privacy of specific individuals in video. EURASIP Journal on Advances in Signal Processing, 2007:1-9, 2007. 2 +[10] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019. 6 +[11] Jiangxin Dong, Stefan Roth, and Bernt Schiele. Deep wiener deconvolution: Wiener meets deep learning for image deblurring. In Advances in Neural Information Processing Systems, 2020. 7 +[12] Munkhjargal Gochoo, Tan-Hsu Tan, Fady Alnajjar, Jun-Wei Hsieh, and Ping-Yang Chen. Lownet: Privacy preserved ultra-low resolution posture image classification. In IEEE International Conference on Image Processing (ICIP), 2020. 2 +[13] Joseph W Goodman. Introduction to Fourier optics. Macmillan Learning, 4 edition, 2017. 4 +[14] Yandong Guo, Lei Zhang, Yuxiao Hu, X. He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In ECCV, 2016. 6 + +[15] Albert Haque, Arnold Milstein, and Li Fei-Fei. Illuminating the dark spaces of healthcare with ambient intelligence. Nature, 585(7824):193–202, 2020. 1 +[16] Lei He, Guanghui Wang, and Zhanyi Hu. Learning depth from single images with deep neural network embedding focal length. IEEE Transactions on Image Processing, 27(9):4676-4689, 2018. 3 +[17] Eran Hershko, Lucien E Weiss, Tomer Michaeli, and Yoav Shechtman. Multicolor localization microscopy and point-spread-function engineering by deep learning. Optics express, 27(5):6158-6183, 2019. 3 +[18] Carlos Hinojosa, Jorge Bacca, and Henry Arguello. Coded aperture design for compressive spectral subspace clustering. IEEE Journal of Selected Topics in Signal Processing, 12(6):1589-1600, 2018. 2 +[19] Alain Hore and Djemel Ziou. Image quality metrics: Psnr vs. ssm. In 2010 20th international conference on pattern recognition. IEEE, 2010. 6 +[20] Gary B. Huang, Marwan Mattar, Honglak Lee, and Erik Learned-Miller. Learning to align from scratch. In NIPS, 2012. 6 +[21] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dálár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision. Springer, 2014. 5 +[22] Jiawei Liu, Yixiao Guo, Guo Li, Luo Mai, and Dong Hao. Hyperpose: Real-time human pose estimation. https://github.com/tensorlayer/hyperpose, 2020.5, 7 +[23] Morgan McGuire, Wojciech Matusik, Hanspeter Pfister, Billy Chen, John F Hughes, and Shree K Nayar. Optical splitting trees for high-precision monocular imaging. IEEE Computer Graphics and Applications, 27(2):32-42, 2007. 3 +[24] Christopher A Metzler, Hayato Ikoma, Yifan Peng, and Gordon Wetzstein. Deep optics for single-shot high-dynamic-range imaging. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 2, 3 +[25] Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: the first manually collected, in-the-wild age database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshop, 2017. 6 +[26] Shree K Nayar. Computational cameras: Redefining the image. Computer, 39(8):30-38, 2006. 3 +[27] Elias Nehme, Daniel Freedman, Racheli Gordon, Boris Ferdman, Lucien E Weiss, Onit Alalouf, Tal Naor, Reut Orange, Tomer Michaeli, and Yoav Shechtman. Deepstorm3d: dense 3d localization microscopy and psf design by deep learning. Nature Methods, 17(7):734-740, 2020. 3 +[28] Xuecheng Nie, Jiashi Feng, Yiming Zuo, and Shuicheng Yan. Human pose estimation with parsing induced learner. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. 2 +[29] Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Towards a visual privacy advisor: Understanding and predicting privacy risks in images. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 5 + +[30] José Ramón Padilla-López, Alexandros Andre Chaaraoui, and Francisco Flórez-Revuelta. Visual privacy protection methods: A survey. Expert Systems with Applications, 42(9):4177-4195, 2015. 2 +[31] George Papandreou, Tyler Zhu, Nori Kanazawa, Alexander Toshev, Jonathan Tompson, Chris Bregler, and Kevin Murphy. Towards accurate multi-person pose estimation in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. 2 +[32] Xi Peng, Zhiqiang Tang, Fei Yang, Rogerio S Feris, and Dimitris Metaxas. Jointly optimize data augmentation and network training: Adversarial data augmentation in human pose estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. 2 +[33] Leonid Pishchulin, Mykhaylo Andriluka, Peter Gehler, and Bernt Schiele. Poselet conditioned pictorial structures. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2013. 2 +[34] Francesco Pittaluga, Sanjeev Koppal, and Ayan Chakrabarti. Learning privacy preserving encodings through adversarial training. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2019. 2 +[35] Francesco Pittaluga and Sanjeev J Koppal. Privacy preserving optics for miniature vision sensors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015. 2, 7 +[36] Francesco Pittaluga and Sanjeev Jagannatha Koppal. Precapture privacy for small vision sensors. IEEE transactions on pattern analysis and machine intelligence, 39(11):2215-2226, 2016. 2 +[37] Michael Ryoo, Kiyoon Kim, and Hyun Yang. Extreme low resolution activity recognition with multi-siamese embedding learning. In Proceedings of the AAAI Conference on Artificial Intelligence, 2018. 2 +[38] Michael S. Ryoo, Brandon Rothrock, Charles Fleming, and Hyun Jong Yang. Privacy-preserving human activity recognition from extreme low resolution. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, 2017. 2, 7 +[39] Soumyadip Sengupta, Jun-Cheng Chen, Carlos Castillo, Vishal M Patel, Rama Chellappa, and David W Jacobs. Frontal to profile face verification in the wild. In 2016 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2016. 6 +[40] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 4 +[41] Vincent Sitzmann, Steven Diamond, Yifan Peng, Xiong Dun, Stephen Boyd, Wolfgang Heidrich, Felix Heide, and Gordon Wetzstein. End-to-end optimization of optics and image processing for achromatic extended depth of field and superresolution imaging. ACM TOG, 2018. 2, 3, 4 +[42] Vinkle Srivastav, Afshin Gangi, and Nicolas Padoy. Human pose estimation on privacy-preserving low-resolution depth images. In International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2019. 2 + +[43] Julian Steil, Marion Koelle, Wilko Heuten, Susanne Boll, and Andreas Bulling. Privaceye: privacy-preserving head-mounted eye tracking using egocentric scene image and eye movement features. In Proceedings of the 11th ACM Symposium on Eye Tracking Research & Applications, 2019. 1 +[44] Benyue Su, Huang Wu, Min Sheng, and Chuansheng Shen. Accurate hierarchical human actions recognition from kinect skeleton data. IEEE Access, 7:52532-52541, 2019. 1 +[45] Ke Sun, Cuiling Lan, Junliang Xing, Wenjun Zeng, Dong Liu, and Jingdong Wang. Human pose estimation using global and local normalization. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 2 +[46] Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2019. 2 +[47] Alexander Toshev and Christian Szegedy. Deeppose: Human pose estimation via deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2014. 2 +[48] Borui Wang, Ehsan Adeli, Hsu-kuang Chiu, De-An Huang, and Juan Carlos Niebles. Imitation learning for human pose prediction. In Proceedings of the IEEE International Conference on Computer Vision, 2019. 2 +[49] Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, et al. Deep high-resolution representation learning for visual recognition. IEEE transactions on pattern analysis and machine intelligence, 2020. 2 +[50] Lei Wang, Du Q Huynh, and Piotr Koniusz. A comparative review of recent kinect-based action recognition algorithms. IEEE Transactions on Image Processing, 29:15-28, 2019. 1 +[51] Zihao W Wang, Vibhav Vineet, Francesco Pittaluga, Sudipta N Sinha, Oliver Cossairt, and Sing Bing Kang. Privacy-preserving action recognition using coded aperture videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2019. 2 +[52] Zhenyu Wu, Haotao Wang, Zhangyang Wang, Zhaowen Wang, and Hailin Jin. Privacy-preserving deep action recognition: An adversarial learning framework and a new dataset. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 2 +[53] Bin Xiao, Haiping Wu, and Yichen Wei. Simple baselines for human pose estimation and tracking. In Proceedings of the European conference on computer vision (ECCV), 2018. 2 +[54] Yi Yang and Deva Ramanan. Articulated pose estimation with flexible mixtures-of-parts. In CVPR 2011, 2011. 2 +[55] Bangpeng Yao and Li Fei-Fei. Modeling mutual context of object and human pose in human-object interaction activities. In 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2010. 2 \ No newline at end of file diff --git a/learningprivacypreservingopticsforhumanposeestimation/images.zip b/learningprivacypreservingopticsforhumanposeestimation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0cf347380091a253fa61da1b649341c073ba7116 --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acbb94d5d897829d9cbebf82f5fa6e2a0725ae57e6804d0a7630264bfa19c528 +size 568179 diff --git a/learningprivacypreservingopticsforhumanposeestimation/layout.json b/learningprivacypreservingopticsforhumanposeestimation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5b13d6cb72d50ad8b4654c1841c0e86535bee32d --- /dev/null +++ b/learningprivacypreservingopticsforhumanposeestimation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cf59c664dd55a3661b6cb9156d642e545467fc2062d6b50c5a0c3e68bcd1a39 +size 418661 diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_content_list.json b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..01bf41ec24319eb0038e7deaaa05a7dfb421664e --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eee016e1e5315469b4066669dadfd6fe5faabf4f35f9ec38f904442097d0912e +size 66493 diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_model.json b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..22bfd2b26dc5098dbedd6272ef583e1b24e955fb --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d4f18a12ba9b90dbe364d69870e95014cc644143328b8c4551bcf13413e6989 +size 82656 diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_origin.pdf b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d81d26d6e43a2acf3fe508ee122337109f3c13b8 --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/20f8ad78-1a60-487b-8011-c6e8b4992e1d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33d6cebf959c6ed223c47ffcc0457e9e410c5bc6bf9657ea66a52ac155c22604 +size 5720195 diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/full.md b/learningrarecategoryclassifiersonatightlabelingbudget/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8cebad71f72b120fe6b13832705d331bc78ffbb8 --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/full.md @@ -0,0 +1,232 @@ +# Learning Rare Category Classifiers on a Tight Labeling Budget + +Ravi Teja Mullapudi $^{2,4}$ + +rmulapu@cs.cmu.edu + +Fait Poms + +fpoms@cs.stanford.edu + +William R. Mark + +billmark@google.com + +Deva Ramanan $^{2,3}$ + +deva@cs.cmu.edu + +Kayvon Fatahalian + +kayvonf@cs.stanford.edu + +# Abstract + +Many real-world ML deployments face the challenge of training a rare category model with a small labeling budget. In these settings, there is often access to large amounts of unlabeled data, therefore it is attractive to consider semi-supervised or active learning approaches to reduce human labeling effort. However, prior approaches make two assumptions that do not often hold in practice; (a) one has access to a modest amount of labeled data to bootstrap learning and (b) every image belongs to a common category of interest. In this paper, we consider the scenario where we start with as-little-as five labeled positives of a rare category and a large amount of unlabeled data of which $99.9\%$ of it is negatives. We propose an active semi-supervised method for building accurate models in this challenging setting. Our method leverages two key ideas: (a) Utilize human and machine effort where they are most effective; human labels are used to identify "needle-in-a-haystack" positives, while machine-generated pseudo-labels are used to identify negatives. (b) Adapt recently proposed representation learning techniques for handling extremely imbalanced human labeled data to iteratively train models with noisy machine labeled data. We compare our approach with prior active learning and semi-supervised approaches, demonstrating significant improvements in accuracy per unit labeling effort, particularly on a tight labeling budget. + +# 1. Introduction + +Training image classification models for a single (or small number of) rare category is common in real-world settings. For instance, autonomous vehicle development requires recognizing rare entities, like construction vehicles, in the video logs of a large fleet. A shopping ap + +plication might need to recognize a particular type of apparel. Ecological monitoring requires recognition of rare animal species. A major challenge of building models for rare categories is acquiring training examples - precisely because they are rare! Fortunately, in many real-world scenarios one has access to a large amount of unlabeled data. Naively labeling the unlabeled data is unlikely to find many rare examples without significant human effort. Therefore, a natural strategy is to interactively mine the data by combining [24, 27, 16, 31, 40, 34] active [32] and semi-supervised [6, 46, 36, 43] learning techniques. However, prior active and semi-supervised learning approaches assume access to a modest amount of labeled data and assume that every image belongs to a common class of interest (Figure 1). In contrast, we are interested in building models for rare categories starting with only a few labeled positives (as little as 5) and where most (as much as $99.9\%$ ) of the unlabeled data is background. Simply put, our goal is to maximize model accuracy given a small fixed amount of human labels (500-1000). + +Typical active and semi-supervised approaches use an initial labeled set to train a model for identifying and labeling relevant data. However, we have so few labeled positives for each rare category that it is difficult to train a deep model using only the initial labeled set. Prior work in the rare category setting resorts to training simple linear models using features from pre-trained deep networks [29, 11]. Unlike these approaches we show that it is feasible to improve deep features with a limited amount of labeled data using a combination of active and semi-supervised learning to address the following challenges: + +- Because humans can only label a small fraction of the full dataset, we make use of semi-supervised learning to pseudo-labels additional examples. Pseudo-labeling positives works poorly because they are rare. We let humans label "hard" examples that may contain positives and hard negatives and let machines pseudo-label "easy" negatives. + +![](images/14d0ca831392d1528b4d5469150b5289386ea025c26326edaeff8d62d8125058.jpg) +Figure 1: Problem setup: Most active and semi-supervised learning methods focus on balanced datasets where 100's-1000's of labeled examples are available to initialize learning (top). We argue that in practical ML deployment, one often wishes to learn a model for a rare category (where $99.9\%$ of the data is background) from a small number of exemplars (bottom). + +- Training on large amounts of pseudo-labeled negatives leads to difficult, highly-imbalanced learning. We adapt background splitting [26], a recently proposed technique for learning from highly imbalanced human labeled datasets, for iterative semi-supervised learning with both human and machine labels. +- Iteratively learning (deep) features significantly improves accuracy but is computationally expensive and adds significant delays between model updates and human labeling. To reduce overall computational costs and latency between model updates and human labeling, we update the features at a low frequency but train linear models on cached features at a high frequency to pick the samples to query humans on. + +Figure 2 shows an overview of our approach, which synthesizes these key ideas into a human-in-loop system for building models for rare categories. Our system provides significant improvements in accuracy per unit labeling effort compared to prior approaches, particularly on a tight labeling budget. + +# 2. Related Work + +Our work overlaps research in active learning, semi-supervised learning, and the intersection of both of these methods with deep learning. Unlike prior work, we focus on rare categories where most of the available unlabeled data is background and where only a few positive exemplars are available to bootstrap the learning process. + +Active learning The problem of choosing data to label to learn a model has been extensively studied in active learning [32] literature. Much of the early work has focused on training a classifier on top of pre-defined features where the unlabeled dataset has a balanced category distribution, and the goal is to build a model to classify all categories. State-of-the-art methods in this setting label data that the current classifier model is confused about (as measured by entropy or margin distance) [10] or data with the most information gain, often measured by the expected model gradient [32, 39]. When unlabeled data is balanced simple strategies like uniform random sampling are quite competitive [25]. Prior work has shown that uniform sampling as well as standard active learning techniques struggle in our imbalanced setting [3, 2]. Some work has explored active learning in the imbalanced/rare category setting [42, 4, 1], where unlabeled data only contains categories of interest and the imbalance studied is minor $(2 - 99\times)$ compared to the practical setting studied in this paper $(384 - 10,000\times)$ . + +Our work is most closely related to the Tropel system [29], which trains a rare-category classifier via active learning starting with just a few samples of the rare class. Tropel uses a fixed feature representation from a pre-trained deep model for classifier training. Similarly more recent work trains a logistic regression classifier on top of frozen deep features by limiting candidates for human labeling to the nearest-neighbors of the samples that have already been labeled [11]. In contrast, we update the deep feature representation used in the active process. Even though we have only a small amount of human labeled data, we make this update viable by also utilizing the unlabeled data. + +Deep active learning & semi-supervised learning In traditional active learning methods, a classifier is learned on top of fixed features, whereas when training a complete deep model from actively-acquired samples the goal is to learn both a feature representation and a classifier. This difference requires fundamental changes to active learning techniques. Recent work [25] demonstrates that active learning with deep models in the common category setting benefits enormously from data augmentation or semi-supervised techniques using the unlabeled data. Therefore, straightforward adaptations of traditional active learning methods to training deep models [31, 17] are less efficient in their use of human samples than methods which augment deep active learning with semi-supervised learning [40, 34, 28, 13]. These combined techniques build on earlier work from the pre-deep-model era [24, 27, 16, 23]. + +Semi-supervised methods rely on an existing model to infer labels on the unlabeled data either using proxy-labeling or graph-based methods [28]. The existing model used to infer labels must be reasonably accurate for the methods to successfully improve the model. Most prior semi-supervised methods are evaluated in the many common category setting and start with 100's-1000's of labeled examples to train a good initial model [28, 20, 30]. However, with rare categories it is unrealistic to start with such a large number of labeled positive instances. In the realistic scenario that trains an initial model with just a few positive instances, we find that the model's positive predictions on unlabeled data are unreliable (the false positive rate is high). Therefore, we limit semi-supervised labeling to just a subset of the samples strongly predicted to be negative, confirming previous results in the classical setting [9]. The semi-supervised method that we use is a modified variant of the relatively simple proxy-labeling method [28]. + +Knowledge transfer and representation learning Techniques like knowledge distillation [7, 44, 30] enable transferring knowledge from a model in a related domain to learn better representations. We rely on a recent distillation based technique developed specifically for the rare category settings with extreme imbalance [26]. More recently self-supervised representation learning techniques have been successful for balanced datasets like ImageNet [5, 15, 7, 8]. We find that representations learned using such methods are good starting points but they need to be updated with supervision relevant to the rare categories of interest. + +Few-shot learning Much work on active learning assumes a small but sizable portion of data is labeled (e.g., $5\%$ ), enough to warm-start with a reasonable model [33, 19]. In our setting, we assume only a small number of initial examples per class (5). This setting is close to that of a cold start in active learning [14, 21]. Our initial setup is + +similar to a few-shot learning problem, which often focuses on learning general representations [35] or aggressive data augmentation [41]. Rather than focusing on complex few-shot learning strategies our approach focuses on learning a good feature representations using unlabeled data echoing recent work [37]. + +Heterogeneous models for active learning Actively training deep models produces more accurate models but incurs a high computational cost. Prior work has shown that simpler models such as linear classifiers can be trained quickly compared to complex models such as deep CNNs, and are often good enough for sample selection in active learning [22, 12]. We use a similar approach and interleave linear classifier training with deep model training to retain advantages of both. + +# 3. Approach + +Our goal is to build an accurate model for a rare category given the following inputs: a small set of labeled positives $(I_p)$ ; a large amount of unlabeled data ( $>99.9\%$ of data is negative instances) from the target domain $U$ ; a pre-trained model $M_{pre}$ from a related domain; and the ability to query a human for labels on a set of samples. Figure 2 provides an overview of our approach and Algorithm 1 gives concrete details. At a high level our approach iteratively builds a model by utilizing the best feature representation $(F)$ and labeled positives $(L_p)$ , negatives $(L_n)$ , and pseudo negatives $(W_n)$ available on hand to rapidly train linear models. Then we use the linear models to rank the unlabeled images and to query humans for labels on the top images in the ranking $R$ . In addition to human labels, the linear model is used to accurately pseudo label a large number of easy negatives $(W_n)$ by picking images from the bottom $50\%$ of the ranking. Using fixed features not trained for the task limits the accuracy of the linear models. Therefore, the deep features are periodically updated at a slower rate by training the deep model $(M^d)$ with both human and automatically labeled data. We use the recently proposed background splitting [26] technique to learn good representations even with the extreme imbalance encountered in the training data. The rest of the section elaborates on the motivation and the resulting design choices in the key components of our approach. + +Bootstrapping the initial model and ranking. The first challenge we need to tackle is building a model for ranking the unlabeled data using the starting set of positives we call the prototype positives $(I_p)$ . Given only the prototype positives it is difficult to train a classifier since there are no negatives on hand. One could sample negatives randomly from the unlabeled data, but we find that randomly sampled negatives are not effective for building an accurate classi- + +![](images/2ea21578ae607ee15015a73d5d3d4fa8eeb0cca64d8560fdd6026ce780e4259a.jpg) +Figure 2: Overview: Our approach builds rare category models by alternating (top cycle) between selecting unlabeled samples for a human to label and training a linear model on top of frozen deep features from labeled images. Our pipeline focuses human effort on images likely to contain positives by ranking unlabeled images with the linear model and querying humans on high scoring unlabeled images. In addition to human labels, the linear model is used to automatically label a large number of easy negatives by picking images from the bottom $50\%$ of the ranking. Using fixed features not trained for the task limits the accuracy of the linear models. Therefore, the deep feature representation is periodically updated at a slower rate (bottom cycle) by training the deep model with both human and automatically labeled data. + +fier. Instead it is more effective to rely on feature similarity to the positive instances for finding hard negative examples. Therefore, we generate a feature-similarity based ranking using the prototype positives. cacheFeatures (Line 1) uses the pre-trained model $M_{pre}^{d}$ to pre-compute the features $F$ for all the samples in the unlabeled data $U$ . Then computeFeatureCentroid (Line 3) normalizes the feature representations of all the prototype positive examples $I_{p}$ and computes an average feature representation $c$ (category prototype) for the rare category. Finally, rankByCosineSimilarity (Line 4) generates the initial ranking $R_{pos}$ of unlabeled images in $U$ by sorting them by cosine similarity to the category prototype $c$ . + +Querying for human labels on high-ranking samples. Given the initial bootstrapped model $c$ or the linear models $(M^l)$ in later iterations we need to choose which unlabeled images to present to the human for labeling. The initial ranking (Line 4) is based on similarity and surfaces data that is visually similar to the category of interest. However, the ranking can be unreliable (especially for fine-grained categories) since the similarity is computed using only a few positive instances $(I_p)$ based on a representation learned for a different task (ImageNet classification or a self-supervised auxiliary task). Even in subsequent iterations we only re + +quest a small number of $(B = 10)$ additional labels every iteration to update the ranking model $(M^l)$ . For instance, Figure 2 top shows the highest ranking unlabeled images during the active loop. Most of the top images surfaced by the model are visually similar, but only a small fraction of those images belongs to the category of interest making it difficult to automatically label positives. Therefore, we focus human labeling effort on the top scoring positive images in the ranking. + +Each iteration of the inner loop $j$ , queryHumanTopK (Lines 10,12) queries the human for labels on the $B$ top ranked images, where $B$ is the labeling budget per iteration. The human labeled positives and negatives $H_{p}, H_{n}$ are added to the appropriate labeled sets $L_{p}, L_{n}$ and removed from the unlabeled data pool. As we request more labels in the iterative process and update the model, the model becomes more accurate and scores easy positives highly. Once the model is reasonably accurate, labeling more easy positives doesn't improve the model much, but the model is then able to identify samples near the true margin (hard positives and hard negatives). Based on this intuition, we use a simple heuristic to estimate model quality and adaptively choose a strategy for picking the samples for human labeling. The key insight is that a high quality model finds more positives than negatives. Our approach keeps track of the number + +Algorithm 1: Our rare category active approach. +Input: $U, I_p, M_{pre}^d, B, N, Q, f_a$ +Output: $M_{1\dots N}^d$ +1 $F \leftarrow$ cacheFeatures( $M_{pre}^d, U$ ) +2 $A_l \leftarrow$ auxiliaryLabels( $M_{pre}^d, U$ ) +3 $c \leftarrow$ computeFeatureCentroid( $M_{pre}^d, I_p$ ) +4 $R_{pos} \leftarrow$ rankByCosineSimilarity(c, F) +5 $L_p \leftarrow I_p, L_n \leftarrow \{, W_n \leftarrow \{\}$ +6 $M_0^d \leftarrow M_{pre}^d$ +7 for $i \leftarrow 1$ to $N$ do +8 for $j \leftarrow 1$ to $Q$ do +9 if $|L_p| < |L_n|$ then +10 $\mid H_p, H_n \leftarrow$ queryHumanTopK(B, Rpos) +11 else +12 $\mid H_p, H_n \leftarrow$ queryHumanTopK(B, Rent) +13 $L_p \leftarrow H_p \cup L_p, L_n \leftarrow H_n \cup L_n$ +14 $W_n \leftarrow$ pseudoNegativeLabels(Rpos, fa) +15 $M^l \leftarrow$ trainLinearModel(F, Lp, Ln, Wn) +16 $U \leftarrow U - (H_p \cup H_n)$ +17 $R_{pos} \leftarrow$ sortPositiveScore(M^l, U) +18 $R_{ent} \leftarrow$ sortMarginDistance(M^l, U) +19 $M_i^d \leftarrow$ trainBGSplit( $M_{i-1}^d, L_p, L_n, W_n, A_l$ ) +20 $F \leftarrow$ cacheFeatures( $M_i^d, U$ ) + +of positives and negatives labeled so far $(|L_{p}|, |L_{n}|)$ . If the number of positives labeled so far is less than the number of negatives, we ask the human to label the most-likely-positive images $(R_{pos})$ , otherwise we ask the human to label the images closest to the linear model's margin $(R_{ent})$ . + +Generating negative pseudo labels on low ranking samples. Given only the small number of human labeled images $(|L_{p}|, |L_{n}|$ it is difficult to improve the deep feature representation. Our approach addresses this issue by machine labeling a large subset of the unlabeled images $U$ . Firstly, our approach avoids labeling errors by restricting pseudo labels to negatives and more precisely the low ranked samples in the current ranking $R_{pos}$ which are unlikely to be positives. Secondly, our algorithm takes a progressive approach to machine labeling based on the number of human-labeled positives and negatives $(L_{p}$ and $L_{n})$ . The routine pseudoNegativeLabels (Line 14) chooses $f_{a}(|L_{p}| + 0.1|L_{n}|)$ samples uniformly from the bottom half of the ranking as pseudo negatives. $f_{a}$ is a scalar hyper parameter that controls the amount of pseudo labels relative to the human-labeled data the algorithm uses. The goal of this heuristic is to keep the label errors relative to the amount of human-labeled data low while maintaining diversity in the negatives. Although easy negatives can be automatically labeled reliably with simple heuristics, similar heuristics can + +not be used to generate automatic labels for positives of the rare category. We show that even conservatively pseudo labeling positives results in lower accuracy in the active process compared to our approach. + +Updating feature representation with extreme imbalance. Training the deep models $M_{i}^{d}$ with a small number of human labeled images and a large number of pseudo labeled negatives remains challenging due to the extreme imbalance in the training data. Our approach mitigates this issue while distilling information from a related domain by using a recent deep-model training technique called background splitting [26] designed for coping with extreme imbalance. trainBGSplit (Line 19) trains the deep representation using all the human-labeled and pseudo-labeled data, plus auxiliary labels $A_{l}$ computed using the pre-trained model $M_{pre}^{d}$ . + +Interleaved feature representation and ranking updates. In principle, we can update the deep model with every human label to make best use of subsequent human effort. However, updating the deep representation frequently is computationally expensive and gives diminishing returns as we show in the supplemental. Conversely, training linear models on fixed features is computationally cheap but results in lower quality models. Our approach strikes a balance between the two extremes by interleaving low frequency updates of the feature representation (every $QB$ human labels) with high frequency training of a linear model (every $B$ human labels) used to update the ranking. The outer loop $i$ corresponds to feature updates and the inner loop $j$ corresponds to ranking updates with a fixed feature representation. The parameters $N$ and $Q$ specify the number of feature and ranking update iterations respectively. The routine trainBGSplit starts with the model from the previous iteration and only trains it for a few epochs on the current labeled data $(L_p, L_n, W_n)$ . Continuous training of the deep model across the active iterations keeps the training cost close to that of training a fully supervised deep model just once on all the data. After every update the features for the unlabeled data are cached (Line 20) for training linear models used to choose images for human labeling. In between the feature updates, the routine trainLinearModel uses the current features to rapidly train a linear model $(M^l)$ using both human and pseudo negative labels. The resulting linear model is used to update the ranking used to pick images for human labeling as well as pseudo negatives. + +# 4. Evaluation + +Our approach has three components: active sampling, pseudo labeling and deep model training on imbalanced data. Prior work has largely focused on individual compo + +
ApproachPseudo PositivesPseudo NegativesBG SplittingTrain FeaturesActive Learning
Ours○✗✓✓✓✓(adaptive)
KD-Semi+✓✓✓✓✓(adaptive)
DeepProp✗✓✓✓✓✓(adaptive)
Tropel-Deep△✗✗✗✓✓(most-likely-positive)
Tropel▽✗✗✗✗✓(most-likely-positive)
Fully supervised✗✗✓✓✗
+ +![](images/ec4f4e80c22b1f75a5f1c977ca16631c987f705b83c8373f4b52d1b013044e89.jpg) +(a) iNaturalist 50 categories (each is $\sim 0.01 - 0.26\%$ of data) + +![](images/24854272cc7c16eb7a0ba2a72fcc388ca20d5199ec678fc48f42bf44abe374fa.jpg) +(b) Places 20 categories (each is $\sim 0.19 - 0.27\%$ of data) +Figure 3: Comparison to baselines. Plots show average F1 accuracy of our approach and baselines on 50 iNaturalist and 20 Places categories as a function of human labeling effort. Our approach gives higher accuracy per human effort compared to baselines, especially when a small number of images are labeled. The Tropel baseline trains a linear model on fixed features and is competitive with Tropel-Deep baseline in the low data regime. DeepProp and KD-Semi baselines pseudo label positives in addition to negatives. The false positives in the pseudo positive labels leads to lower accuracy compared to our approach. + +nents of our approach. We compare our approach to prior work by replacing individual components with prior methods and evaluating the overall performance. We also present ablation studies for key ideas. + +# 4.1. Experimental setup + +We evaluate our approach for building rare category models using two datasets: the iNaturalist [38] fine-grained species recognition dataset and the Places [45] scene classification dataset. We randomly choose 50 categories from the iNaturalist dataset and 20 categories from the Places dataset for evaluation as rare categories. For the iNaturalist dataset we restrict the random choice to categories with more than 50 instances in the training set, so that the active + +learning process has something to find. Given this setup, positive instances for individual categories are extremely rare in both datasets. For iNaturalist, the number of positives for each category is in the range 50-1500 ( $\sim 0.01 - 0.26\%$ of the training set). For Places, the categories are more uniformly distributed, with $\sim 3500 - 5000$ instances per category ( $\sim 0.19 - 0.27\%$ of the training set). For each category we pick five randomly chosen positives as the initial labeled set and treat the rest of the training data as the unlabeled pool of data. We evaluate the trained models on the full validation set of each dataset. All images not in a category of interest are considered negatives in our evaluation i.e., our validation set reflects the imbalance in the training set. We use the F1 metric for evaluation instead of classification accuracy since classification accuracy is easily gamed for rare categories by just predicting everything as negative. + +Rare-category active learning baselines: Tropel [29] is a prior active learning approach for rare categories. Tropel iteratively trains a linear model (on top of frozen pretrained deep features) by labeling the top-k scoring predictions from the current linear model. We also evaluate a new variant, Tropel-Deep, which trains a deep model instead of a linear model at each iteration. Tropel-Deep uses the same incremental deep-model training that we use in our approach. + +Semi-supervised baselines As the results show, our method outperforms Tropel (because we train a deep model) and Tropel-Deep (because our method augments the human labels with pseudo-labels). This second result raises the question as to whether traditional semi-supervised techniques could perform just as well as our enhanced methods. To study this question, we implemented additional baselines based on label propagation [20, 34] and knowledge distillation [7, 44, 30]. We replace our pseudo negative labeling approach with these approaches for generating automatic labels, naming them DeepProp and KD-Semi. For the DeepProp baseline, instead of only using the pseudo negatives $W_{n}$ to train the deep model, we also use pseudo positive labels generated with label propagation [20]. For the KD-Semi baseline, instead of only using the pseudo negatives $W_{n}$ produced by the linear model, we use the high confidence predictions of the deep model from the previous iteration on the unlabeled data as pseudo positive and negative labels. More details on the baselines are provided in the supplemental. + +Implementation and configuration details We use a ResNet-50 model [18] pre-trained on ImageNet or using self-supervised methods $(M_{pre}^{d})$ to initialize the deep model and compute feature representations for all the unlabeled + +![](images/b473aab4583a1d6f3f36c54f3aed09831cc50af3111f980f030b9111d0f4457d.jpg) +Figure 4: Analysis of automatic positives. Plot shows the average false positive rate in the automatic positives labeled by KD-Semi and DeepProp baselines for the 50 iNaturalist categories. Lowering the confidence threshold for automatic positives with KD-Semi increases the false positive rate. The high false positive rates showcase the difficulty in automatically labeling positives. + +data. The same ResNet-50 model is used to generate labels for the background splitting auxiliary loss. We run our active approach and its variants with $N = 10$ , $Q = 5$ , and $B = 10$ for iNaturalist and $N = 10$ , $Q = 5$ , and $B = 20$ for Places unless specified otherwise. We use the same set of initial positives $(I_p)$ for each category across all the methods and set $f_a$ to 100 unless specified otherwise. In the supplemental we show that our approach is robust to a range of values for $f_a$ . + +Ideally, we would evaluate our approach and all the baselines individually for each category. However, due to computational limitations it is not feasible to train deep models with pseudo negatives individually for each category. Therefore, we run our approach and baselines for groups of ten categories at a time to reduce the compute costs. We maintain the same grouping of categories across all the experiments. When training the deep model we use binary cross entropy loss for each category as opposed to cross entropy loss across all the ten categories and supervise the model with only binary labels for each category. The linear models used to rank unlabeled data are trained independently for each category and humans are queried for binary labels for each category separately. Therefore, images might only be labeled for one of the ten categories. When training the deep models we deal with the missing labels by masking the corresponding binary loss for categories that are not labeled. + +When updating the feature representation we train the deep model for 15 epochs on the currently labeled data in the active loop. In the $N = 10$ , $Q = 5$ , and $B = 10$ configuration we thus run 150 total epochs of training. However, on average an epoch in our approach only uses a quarter of the unlabeled data. Therefore, the overall cost of training is approximately equal to 40 epochs of training on the full dataset. For the fully supervised baseline, we train for 50 epochs. More details on the training schedules are provided in the supplemental. + +# 4.2. Comparison with baselines + +We compare our approach with prior work by measuring model accuracy of different methods as a function of human labeling effort. Figure 3 shows mean F1 accuracy of our approach and several baselines. The accuracy is computed on 50 and 20 categories of interest in the iNaturalist and Places datasets. We measure labeling effort as the number of binary labels per category. Our approach gives higher accuracy for the same human labeling effort compared to baselines, especially when a small number of images are labeled. The Tropel baseline trains a linear model on fixed features computed using a deep model pre-trained on ImageNet. The Tropel-Deep baseline trains a deep model only using the human labeled data. When only a small amount of human labeled data is available training a deep model can overfit leading to low accuracy. As one can see, Tropel-Deep performs worse than Tropel when a small amount of images are labeled. In contrast, our approach uses pseudo negatives in addition to human labeled data allowing us to update the feature representation without overfitting. On the iNaturalist categories, our approach matches fully supervised accuracy when 500 images per category are labeled since the dataset contains less than 500 positives for each of the categories. On the Places categories, there is a significant gap with fully supervised accuracy but this expected since there are 5000 positives per category and we only label a total of 1000 images per category. + +DeepProp and KD-Semi use pseudo labels on the unlabeled data to update the deep feature representation. Unlike our approach these baselines do not restrict pseudo labels to easy negatives. DeepProp propagates labels to all the unlabeled data based on the feature similarity graph and assigns weights to the pseudo labels, whereas KD-Semi uses the current model to predict pseudo labels on the unlabeled data. Both DeepProp and KD-Semi perform worse that our approach due to errors in the labels propagated on positives. Figure 4 shows the false positive rate of KD-Semi and DeepProp on the iNaturalist categories. A high false positive rate is expected since the models are trained from very few labeled examples. The false positive rate keeps increasing as errors in labeling propagate and distort the definition of the category. KD-Semi can be tuned to reduce errors in the positive pseudo labels by increasing the confidence threshold at which the labels are trusted. Figure 4 shows the false positive rates for KD-Semi at different confidence thresholds. Even with confidence threshold as high as 0.98 the false positive rate is significant and is even worse with lower confidence thresholds. Setting the confidence threshold higher than 0.98 effectively results in almost no pseudo positive labels and tends to our strategy in the limit. DeepProp performs worse than Tropel due to the high amount of errors in label propagation which is difficult to control unlike KD-Semi as shown in Figure 4. + +![](images/60c3af61f99f2d0cfd6d2fae8fa47c6c39f489c115d13654a4d6ba9d2b7907bc.jpg) +Figure 5: Ablation study. Plot shows average F1 accuracy for variants of our approach on 50 iNaturalist categories as a function of human labeling effort. Omitting pseudo negatives No-Pseudo-Neg or background splitting to handle imbalance No-BG-Splitting results in lower model accuracy, especially when a small amount of images are labeled. Only updating deep models every 50 labeled images No-Linear-Updates also results in lower accuracy. + +# 4.3. Ablation study + +We created variants of our approach to evaluate the impact of the different components. Figure 5 shows F1 accuracy for variants of our approach on 50 categories from the iNaturalist dataset as a function of human labeling effort. No-Pseudo-Neg and No-BG-Splitting are variants without pseudo negatives and background splitting respectively. As one can see omitting the pseudo negatives when updating the deep representation results in lower accuracy for the same human labeling effort. As one would expect, the effect of pseudo negatives and background splitting is more pronounced when a small amount of images are labeled. Since our approach only uses a fraction of the easy negatives along with the human labeled positives and hard negatives for training, it also reduces the imbalance between positive and negative instances when compared to fully supervised training using all the data. No-Linear-Updates only updates the linear model once every representation update; this corresponds to the parameter setting $N = 10$ , $B = 50$ , $Q = 1$ . Skipping the linear model updates results in a lower accuracy for the same labeling effort. The linear model updates enable quickly adapting the ranking used to choose images for human labeling and hence lead to better overall model. + +# 4.4. Using self-supervised representations + +Until now we have evaluated our approach using a model pre-trained on ImageNet using supervised labels shown as Ours-Sup-ImageNet in Figure 6. Instead Ours-Self-iNat and Ours-Self-ImageNet use self-supervised models trained on iNaturalist and ImageNet with SwAV [5] as the pre-trained model $M_{pre}^{d}$ . We generate auxiliary labels for background splitting by clustering the iNaturalist data with the self-supervised feature representations. Similarly, Tropel-Self-iNat and Tropel-Self-ImageNet actively train linear models using fixed self-supervised representations. + +![](images/e2602d0e6cb04ad48433864e1f49051717ec2804c54998b6ceda7972cc74b3da.jpg) +Figure 6: Self-supervised representations. Plot shows average F1 accuracy of our approach and Tropel on 50 iNaturalist categories as a function of human labeling effort. Ours-Self-iNat and Ours-Self-ImageNet use self-supervised models trained on iNaturalist and ImageNet as the starting point. Tropel-Self-iNat and Tropel-Self-ImageNet train linear models using self-supervised representations. Our approach is more label efficient and shows the importance of actively updating features. Ours-Sup-ImageNet uses ImageNet supervised pre-training as the starting point and outperforms self-supervised baselines. + +Our approach produces more accurate models showing the importance of updating feature representation with actively labeled data even when starting with a self-supervised representation trained on the same data. These results show that our approach when combined with self-supervised pretraining produces accurate models with just 500 binary labels for each category. However, our approach produces better models with supervised pre-trained representations on ImageNet. This suggests room for improvement in self-supervised representation learning approaches. + +# 5. Conclusion + +In many real world scenarios it is often necessary to build a model for a rare category starting from a small positive set with access to a large unlabeled data collection which contain instances of the rare category. In this setting, we show that leveraging a combination human labels for positives and hard negatives and machine labels for easy negatives is crucial for building accurate models under a tight labeling budget. We find that techniques that work well in the common multi category setting like propagating positive labels or training a deep model using standard losses do not work off-the-shelf and need to be adapted to this real world setting. We hope that our work showcases the challenges presented by rare categories in real-world settings and encourages future work. + +Acknowledgments This work is supported by the National Science Foundation (NSF) under III-1908727 and CCF-1937301. Deva Ramanan and Ravi Teja Mullapudi were supported by the CMU Argo AI Center for Autonomous Vehicle Research. We thank Florian Schroff and Hartwig Adam for their support of the work and Afshin Rostamizadeh and Giulia DeSalvo for their advice on active learning baselines. + +# References + +[1] Umang Aggarwal, Adrian Popescu, and Céline Hudelot. Active learning for imbalanced datasets. In The IEEE Winter Conference on Applications of Computer Vision, pages 1428-1437, 2020. 2 +[2] Josh Attenberg and Seyda Ertekin. Class imbalance and active learning. Imbalanced Learning: Foundations, Algorithms, and Applications, pages 101-149, 2013. 2 +[3] Josh Attenberg and Foster Provost. Why label when you can search? alternatives to active learning for applying human resources to build classification models under extreme class imbalance. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 423-432, 2010. 2 +[4] Mausam C Lin. Active learning with unbalanced classes & example-generated queries. In AAAI Conference on Human Computation, 2018. 2 +[5] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. NeurIPS, 2020. 3, 8 +[6] Olivier Chapelle, Bernhard Scholkopf, and Alexander Zien. Semi-Supervised Learning. MIT Press, 2006. 1 +[7] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020.3, 6 +[8] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. 3 +[9] Yukun Chen and Subramani Mani. Active learning for unbalanced data in the challenge with multiple models and biasing. In Active Learning and Experimental Design workshop In conjunction with AISTATS 2010, pages 113-126, 2011. 3 +[10] Galen Chuang, Giulia DeSalvo, Lazaros Karydas, Jean-François Kagy, Afshin Rostamizadeh, and A Theeraphol. Active learning empirical study. NeurIPS 2019 Workshop on Learning with Rich Experience: Integration of Learning Paradigms, 2019. Available at workshop website http://sites.google.com/view/neurips2019lire. 2 +[11] Cody Coleman, Edward Chou, Sean Culatana, Peter Bailis, Alexander C Berg, Roshan Sumbaly, Matei Zaharia, and I Zeki Yalniz. Similarity search for efficient active learning and search of rare concepts. arXiv preprint arXiv:2007.00077, 2020. 1, 2 +[12] Cody Coleman, Christopher Yeh, Stephen Mussmann, Baharan Mirzasoleiman, Peter Bailis, Percy Liang, Jure Leskovec, and Matei Zaharia. Selection via proxy: Efficient data selection for deep learning. *ICLR*, 2020. 3 +[13] Mingfei Gao, Zizhao Zhang, Guo Yu, Sercan Ö Arik, Larry S Davis, and Tomas Pfister. Consistency-based semi-supervised active learning: Towards minimizing labeling cost. In European Conference on Computer Vision, pages 510-526. Springer, 2020. 3 +[14] Roman Garnett, Yamuna Krishnamurthy, Xuehan Xiong, Jeff Schneider, and Richard Mann. Bayesian optimal active + +search and surveying. arXiv preprint arXiv:1206.6406, 2012.3 +[15] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. 3 +[16] Mohamed Farouk Abdel Hady and Friedhelm Schwenker. Combining committee-based semi-supervised and active learning and its application to handwritten digits recognition. In International Workshop on Multiple Classifier Systems, pages 225-234. Springer, 2010. 1, 3 +[17] Elmar Haussmann, Michele Fenzi, Kashyap Chitta, Jan Ivanecky, Hanson Xu, Donna Roy, Akshitta Mittel, Nicolas Koumchatzky, Clement Farabet, and Jose M Alvarez. Scalable active learning for object detection. arXiv preprint arXiv:2004.04699, 2020. 3 +[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 6 +[19] Peiyun Hu, Zachary C Lipton, Anima Anandkumar, and Deva Ramanan. Active learning with partial feedback. arXiv preprint arXiv:1802.07427, 2018.3 +[20] Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Label propagation for deep semi-supervised learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5070-5079, 2019. 3, 6 +[21] Shali Jiang, Roman Garnett, and Benjamin Moseley. Cost effective active search. In Advances in Neural Information Processing Systems, pages 4880-4889, 2019. 3 +[22] David D Lewis and Jason Catlett. Heterogeneous uncertainty sampling for supervised learning. In Machine learning proceedings 1994, pages 148-156. Elsevier, 1994. 3 +[23] Hui Li, Xuejun Liao, and Lawrence Carin. Active learning for semi-supervised multi-task learning. In 2009 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 1637-1640. IEEE, 2009. 3 +[24] Andrew Kachites McCallumzy and Kamal Nigamy. Employing em and pool-based active learning for text classification. In Proc. International Conference on Machine Learning (ICML), pages 359-367. CiteSeer, 1998. 1, 3 +[25] Sudhanshu Mittal, Maxim Tatarchenko, Özgün Çiçek, and Thomas Brox. Parting with illusions about deep active learning. arXiv preprint arXiv:1912.05361, 2019. 2, 3 +[26] Ravi Teja Mullapudi, Fait Poms, William R. Mark, Deva Ramanan, and Kayvon Fatahalian. Background splitting: Finding rare classes in a sea of background, 2020. 2, 3, 5 +[27] Ion Muslea, Steven Minton, and Craig A Knoblock. Active+ semi-supervised learning= robust multi-view learning. In ICML, volume 2, pages 435-442, 2002. 1, 3 +[28] Yassine Ouali, Céline Hudelot, and Myriam Tami. An overview of deep semi-supervised learning. arXiv preprint arXiv:2006.05278, 2020. 3 +[29] Genevieve Patterson, Grant Van Horn, Serge Belongie, Pietro Perona, and James Hays. Tropel: Crowdsourcing de + +tectors with minimal training. In Third AAAI Conference on Human Computation and Crowdsourcing, 2015. 1, 2, 6 +[30] Sylvestre-Alvise Rebuffi, Sebastien Ehrhardt, Kai Han, Andrea Vedaldi, and Andrew Zisserman. Semi-supervised learning with scarce annotations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 762-763, 2020. 3, 6 +[31] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017. 1, 3 +[32] Burr Settles. Active learning literature survey (computer sciences technical report 1648). University of Wisconsin-Madison, 2010. 1, 2 +[33] Yanyao Shen, Hyokun Yun, Zachary C Lipton, Yakov Kronrod, and Animashree Anandkumar. Deep active learning for named entity recognition. arXiv preprint arXiv:1707.05928, 2017. 3 +[34] Oriane Simeoni, Mateusz Budnik, Yannis Avrithis, and Guillaume Gravier. Rethinking deep active learning: Using unlabeled data at model training. arXiv preprint arXiv:1911.08177, 2019. 1, 3, 6 +[35] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pages 4077-4087, 2017. 3 +[36] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. 1 +[37] Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: a good embedding is all you need? arXiv preprint arXiv:2003.11539, 2020. 3 +[38] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8769-8778, 2018. 6 +[39] Carl Vondrick and Deva Ramanan. Video annotation and tracking with active learning. In Advances in Neural Information Processing Systems, pages 28-36, 2011. 2 +[40] Keze Wang, Dongyu Zhang, Ya Li, Ruimao Zhang, and Liang Lin. Cost-effective active learning for deep image classification. IEEE Transactions on Circuits and Systems for Video Technology, 27(12):2591-2600, 2016. 1, 3 +[41] Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7278-7286, 2018. 3 +[42] Manfred K Warmuth, Jun Liao, Gunnar Ratsch, Michael Mathieson, Santosh Putta, and Christian Lemmen. Active learning with support vector machines in the drug discovery process. Journal of chemical information and computer sciences, 43(2):667-673, 2003. 2 +[43] Colin Wei, Kendrick Shen, Yining Chen, and Tengyu Ma. Theoretical analysis of self-training with deep networks on unlabeled data. arXiv preprint arXiv:2010.03622, 2020. 1 + +[44] I Zeki Yalniz, Herve Jégou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning for image classification. arXiv preprint arXiv:1905.00546, 2019. 3, 6 +[45] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. 6 +[46] Xiaojin Zhu and Andrew B Goldberg. Introduction to semi-supervised learning (synthesis lectures on artificial intelligence and machine learning). Morgan and Claypool Publishers, 14, 2009. 1 \ No newline at end of file diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/images.zip b/learningrarecategoryclassifiersonatightlabelingbudget/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5b74677ce83ae22989b1079383404ea1f62478c2 --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0e16e12010c3eef0155a1ced08b0d18d0f25fbc8906689bc0016c292b90e4e8 +size 388376 diff --git a/learningrarecategoryclassifiersonatightlabelingbudget/layout.json b/learningrarecategoryclassifiersonatightlabelingbudget/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f697f7f0a1b152179db4acd72949b9dc7871f87a --- /dev/null +++ b/learningrarecategoryclassifiersonatightlabelingbudget/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c47e76539a295f60a5b8fd38a8a09a95764e55812221a1d047d6264c73c0b217 +size 344671 diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_content_list.json b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..77164c5c42f3150feed70ea0b094f440b0f1ec53 --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:407aca715dfb3ddf80415da03811e46fcd8530d2b5b834e3bb5ad4b377cc9d0b +size 95691 diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_model.json b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_model.json new file mode 100644 index 0000000000000000000000000000000000000000..22f174356927e23ba514beaa991a721ee642f3cb --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cf3231ce883ad2a8bb945a05149771d8fd68ab95ed9c232c5422638f46336da +size 121348 diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_origin.pdf b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..39705e1d0b171b81526bdc8bf5ea9563453f863e --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/63aaddc9-31cc-40f7-940a-a5699451ad66_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:610a0c3b335cf688f8f5ee78b424dabd23d9731e37879dc8361ad869cde6403b +size 9535095 diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/full.md b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/full.md new file mode 100644 index 0000000000000000000000000000000000000000..75b1fdf9b9834bac361a7d82f6eea4aad4163a70 --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/full.md @@ -0,0 +1,478 @@ +# Learning RAW-to-sRGB Mappings with Inaccurately Aligned Supervision + +Zhilu Zhang $^{1}$ , Haolin Wang $^{1}$ , Ming Liu $^{1}$ , Ruohao Wang $^{1}$ , Jiawei Zhang $^{2}$ , Wangmeng Zuo $^{1,3}$ (☑) + $^{1}$ Harbin Institute of Technology, $^{2}$ SenseTime Research, $^{3}$ Pazhou Lab, Guangzhou + +{czlzhang, Why.cs, csmliu, rhwangHIT}@outlook.com {zhjw1988}@gmail.com WMzuo@hit.edu.cn + +# Abstract + +Learning RAW-to-sRGB mapping has drawn increasing attention in recent years, wherein an input raw image is trained to imitate the target sRGB image captured by another camera. However, the severe color inconsistency makes it very challenging to generate well-aligned training pairs of input raw and target sRGB images. While learning with inaccurately aligned supervision is prone to causing pixel shift and producing blurry results. In this paper, we circumvent such issue by presenting a joint learning model for image alignment and RAW-to-sRGB mapping. To diminish the effect of color inconsistency in image alignment, we introduce to use a global color mapping (GCM) module to generate an initial sRGB image given the input raw image, which can keep the spatial location of the pixels unchanged, and the target sRGB image is utilized to guide GCM for converting the color towards it. Then a pre-trained optical flow estimation network (e.g., PWC-Net) is deployed to warp the target sRGB image to align with the GCM output. To alleviate the effect of inaccurately aligned supervision, the warped target sRGB image is leveraged to learn RAW-to-sRGB mapping. When training is done, the GCM module and optical flow network can be detached, thereby bringing no extra computation cost for inference. Experiments show that our method performs favorably against state-of-the-art on ZRR and SR-RAW datasets. With our joint learning model, a light-weight backbone can achieve better quantitative and qualitative performance on ZRR dataset. Codes are available at https://github.com/cszhilu1998/RAW-to-sRGB. + +# 1. Introduction + +The image signal processing (ISP) pipeline refers to the processing of raw sensor image for producing high quality display-referred sRGB image, and thus is pivotal for a camera system. A representative ISP pipeline usually involves a sequence of steps including demosaicking, white balance, color correction, tone mapping, denoising, sharpening, gamma correction and so on [40]. While hand + +crafted ISP solutions are usually adopted in current camera systems, convolutional networks (CNNs) have exhibited great potential in learning deep ISP model in an end-to-end manner [22, 29, 45]. + +The end-to-end property of deep ISP makes it very competitive to learn RAW-to-sRGB mapping to generate high quality image for mobile camera [22]. Albeit mobile camera has become the dominant sources of photos, it has a smaller sensor size and limited aperture in comparison to DSLR camera. By learning RAW-to-sRGB mapping to produce DSLR-like sRGB image from mobile raw image, deep ISP model can thus offer an encouraging way to close the gap between mobile camera and DSLR camera. Moreover, in contrast to 8-bit sRGB image, raw image usually has higher-bit (e.g., 10-14 bit) and may convey richer details. Therefore, learning RAW-to-sRGB mapping is beneficial to performance improvement even for other low level vision tasks, e.g., image super-resolution [62], low light image denoising [8] and high dynamic range imaging (HDR) [6]. + +However, when preparing training data, input raw image and target sRGB image are usually taken using different cameras (e.g., a smartphone and a DSLR) or with different camera configurations (e.g., focal length). Consequently, color inconsistency and spatial misalignment are usually inevitable. On the one hand, the color inconsistency makes it very challenging to generate well-aligned training pairs of input raw and target sRGB images. The input raw and target sRGB images usually cannot be perfectly aligned by existing methods [34, 49], resulting in mild alignment. On the other hand, learning with inaccurately aligned supervision is prone to pixel shift and producing blurry results (see Fig. 1(b)). To alleviate the adverse effect of inaccurate alignment, AWNet [9] adopted global context block [5] at the cost of increasing inference time, while Zhang et al. [62] presented a contextual bilateral (CoBi) loss to search the best matching patch for supervision. However, the patch-based alignment is unable to appropriately handle the spatially variant misalignment caused by depth discrepancy between objects. As a result, their method is still prone to producing blurry results as shown in Fig. 1(f). + +In order to circumvent inaccurately aligned supervision + +![](images/58770243c43d6032633b2f111f717256b7bacdb27a6adf72622139fe2ce94f10.jpg) +(a) Input raw image (visualized) + +![](images/ac63142c7ac813565f96cb17c3f715681426d4417f172f36359a1d4fdec5063d.jpg) + +![](images/ab335607fc206b59386004a367e76fd81016656345ce2bdec17445a5c73a470f.jpg) + +![](images/d43d645f2f8b4139d81bfe944166cf64b463eafe49922bb0bc68cf1c4e30ee35.jpg) + +![](images/c00380bafafce6a2d23e1be9e80f1e8820b6bef46c728899996442ffb37024ef.jpg) +(e) Input raw image (visualized) + +![](images/fab9afcde61dd9426b841ac4e1b43f90e3738ea062296dc5321fae5ce4221631.jpg) +(b) PyNet [22] +(f) Zhang et al. [62] + +![](images/ba65a86cadc4d1af4c0e5aee597b6672f1c1832005a1a05e6a774c6064a1941e.jpg) +(c) Ours +(g) Ours +Figure 1: Example of data pairs of ZRR and SR-RAW datasets, where clear spatial misalignment can be observed with the reference line. With such inaccurately aligned training data, PyNet [22] and Zhang et al. [62] are prone to generating blurry results with spatial misalignment, while our results are well aligned with the input. Please zoom in for better observation. + +![](images/131228355a9bc8bec50e6b56b4be6206548d79a88551a07df388d461ffb9ae1a.jpg) +(d) Target sRGB image +(h) Target sRGB image + +problem, this paper presents a joint learning model for image alignment and RAW-to-sRGB mapping. We argue that one major reason that explains the inaccurate/mild alignment is the severe color inconsistency between input raw and target sRGB images. Otherwise, existing optical flow networks [10, 23, 46] can be readily utilized to fulfill the task of image alignment. Thus, we suggest to perform image alignment by concatenating a delicately designed global color mapping (GCM) module with a pre-trained optical flow estimation network (e.g., PWC-Net [46]). In particular, the GCM module involves a stack of $1 \times 1$ convolutional layers to ensure that the mapping is spatially independent. To overcome the obstacle of color inconsistency, we constrain the GCM output to approximate the aligned target sRGB image. It is worth noting that GCM is deployed to align target sRGB image only during training. Thus, we can also take the target sRGB image and coordinate map to generate conditional guidance for modulating GCM features towards diminishing color inconsistency. Then, a pre-trained optical flow estimation network (e.g., PWC-Net [46]) can be used to align the target sRGB image with the GCM output, resulting in the well aligned sRGB image. + +The aligned target sRGB image can serve as a better supervision for training the RAW-to-sRGB mapping. In particular, we propose a LiteISPNet by reducing the residual channel attention blocks (RCABs) in MW-ISPNet [20]. GCM and LiteISPNet are jointly trained for both the alignment of target sRGB image (i.e., GCM and PWC-Net) and the RAW-to-sRGB mapping (i.e., LiteISPNet). When training is done, GCM and PWC-Net can be detached and only LiteISPNet is required for handling test raw images, thereby + +bringing no extra inference cost. Experiments on Zurich RAW to RGB (ZRR) dataset [22] show that our solution is effective in learning with inaccurately aligned supervision and producing more fine details. Our proposed method also outperforms the state-of-the-art method in terms of quantitative metrics, perceptual quality and computational efficiency. Furthermore, using SRResNet as the backbone, experiments also show the effectiveness of our method for image super-resolution on the SR-RAW dataset [62]. + +The main contributions of this work are three-fold: + +- An effective approach is presented to circumvent the task of learning RAW-to-sRGB mapping with inaccurately aligned supervision. +- A global color mapping (GCM) module is delicately designed to tackle the effect of color inconsistency on image alignment. A spatially preserving network (SPN) is leveraged to avoid spatial shift of pixels, and the target sRGB image is adopted to modulate GCM features towards diminishing color inconsistency. +- Quantitative and qualitative results on ZRR and SR-RAW datasets show that our method outperforms the state-of-the-art methods with no extra inference cost. + +# 2. Related Work + +# 2.1. Deep Networks for ISP + +The camera ISP pipeline is deployed to produce display-referred sRGB image from raw images. To this end, classical ISP has been extensively studied, which generally involves a sequence of subtasks [40] including demosaicking, white balance, color correction, tone mapping, denois + +ing, sharpening, gamma correction and etc. For each subtask, a number of methods have been proposed in the literature [2, 17, 42, 48]. Motivated by the unprecedented success of deep learning, CNNs have also been investigated to tackle several hard ISP subtasks like image denoising [57, 59, 60], demosaicking [12, 30, 47], auto-white-balance (AWB) [1, 18, 33, 54] and tone mapping [3, 13, 16, 58]. + +Recently, several attempts have been made to learn a full ISP pipeline with a deep model. Schwartz et al. [45] designed a DeepISP model to produce a well-lit sRGB image given a raw image captured under low-light environment. CameraNet [29] explicitly grouped the sub-tasks into two categories (i.e., restoration and enhancement), and extracted the ground-truths by commercial software. Ignatov et al. [22] collected a dataset containing paired raw and sRGB images, which respectively are captured by Huawei P20 smartphone and Canon 5D Mark IV DSLR. With the dataset proposed in [22], two challenges were held [20, 21]. Among the decent methods proposed by the participants, MW-ISPNet [20] leveraged MWCNN [32] and residual channel attention blocks (RCABs) [63], AWNet [9] adopted global context block [5] to learn non-local color mapping, and they won first two places in the perceptual track [20]. In this work, we present a LiteISPNet by reducing the number of RCABs in MW-ISPNet [20] for learning full ISP model. By incorporating LiteISPNet with the joint learning model, better quantitative results and perceptual quality can be attained in comparison to MW-ISPNet [20] and AWNet [9]. + +# 2.2. RAW-to-sRGB Mappings for More Tasks + +In [22], the raw sensor and sRGB images are captured using different cameras. This makes it feasible to empower low-quality raw sensor to produce high-quality sRGB image by imitating either other cameras or camera with different configurations. Moreover, the pixels of raw images are usually of higher-bit (e.g., $10 \sim 14$ bit), spatially independent and linear to brightness, thereby conveying richer details for benefiting image enhancement. Chen et al. [8] pioneered this line of work by leveraging paired low-light raw and long-exposure sRGB images with different ISO settings for extreme low-light image enhancement. And they further explored extreme low-light video enhancement in [7]. Analogously, raw images are also utilized in other low level vision tasks such as HDR [6] and image super-resolution (SR) [55, 62]. In this work, our method is also tested on image SR [62] by using SRResNet [27] as backbone, and achieves better quantitative and qualitative results. + +Furthermore, studies have also been given for repurposing or merging RAW-to-sRGB mapping with high-level vision tasks. Wu et al. [53] designed a visionISP model to generate better input for object detection. Schwartz et al. [44] learned a model for image classification with raw images via distilling the knowledge of an ISP pipeline and an sRGB image classification model. + +# 2.3. Alignment of Paired Raw and sRGB Images + +For learning RAW-to-sRGB mappings, input raw and target sRGB images are usually taken using different cameras or with different camera configurations [22, 62]. Misalignment caused by multiple cameras and motion in the scene are thus inevitable, hindering the learning of RAW-to-sRGB mappings and giving rise to blurry or even pixel-shifted results. For suppressing the effect of motion in the scene, dual or multiple cameras are deployed to shoot concurrently for some datasets like KITTI [11, 38] and MultiPIE [15]. Beam splitter is also introduced to collect image pairs at the "same position" with different settings for real-world super-resolution [25] and deblurring [41]. Albeit with such equipments, misalignment remains unavoidable. + +Several methods have been presented to align images from different sources. SIFT keypoints [34] are adopted for image registration in [19,22,52], where the homography can be estimated via RANSAC algorithm [49]. Cai et al. [4] designed a pixel-wise registration method that considers luminance adjustment for a real-world super-resolution dataset. Li et al. [28] warped the guidance image for facial image restoration via optical flow based methods [10, 23, 46]. However, input raw and target sRGB images usually have severe color inconsistency and cannot be perfectly aligned by existing methods, thereby resulting in mild alignment. Global context block [5, 9] and CoBi loss [62] have been introduced to alleviate the effect of mild alignment, but are still prone to producing blurry results. In this work, we introduce a global color mapping (GCM) module for tackling color inconsistency, and present a joint learning model for both image alignment and RAW-to-sRGB mapping. + +# 3. Proposed Method + +In this section, we first give an overview of our model for joint learning of image alignment and RAW-to-sRGB mapping. Then, the design of the global color mapping (GCM) module and LiteISPNet is detailed, and the learning objectives are presented. And we also extend our proposed method to other image enhancement tasks, e.g., image SR. + +# 3.1. Joint Learning Model + +Denote by $\mathbf{x}$ and $\mathbf{y}$ a raw image and the corresponding target sRGB image. The RAW-to-sRGB mapping is used to produce a sRGB image $\hat{\mathbf{y}}$ from $\mathbf{x}$ for approximating the color characteristic of target sRGB image $\mathbf{y}$ , + +$$ +\hat {\mathbf {y}} = \mathcal {I} (\mathbf {x}; \Theta_ {\mathcal {I}}), \tag {1} +$$ + +where $\mathcal{I}$ denotes a RAW-to-sRGB mapping (e.g., LiteISP-Net in Sec. 3.3) with the parameter $\Theta_{\mathcal{I}}$ . + +However, $\mathbf{x}$ and $\mathbf{y}$ are usually taken using different cameras or with diverse camera configurations, giving rise to inevitable spatial misalignment between them. Moreover, the severe color inconsistency between $\mathbf{x}$ and $\mathbf{y}$ further makes the image alignment more difficult. On the other hand, the + +![](images/a11f4600f89a46652c7b1e3b89f9dccc16e5457d3eec26293226ad4130ddfa6e.jpg) +(a) Pipeline of the Joint Learning Model + +![](images/a220a6c3fc58b9f318412620ec0d571a4e0a41ad14f580964f985945e667d576.jpg) +(b) Structure of GCM Module + +![](images/a7a01710eb273d1e87094afd23d8153ae25a59e382bfe4acb5345cb893f1f85e.jpg) +(c) Structure of LiteISPNet + +![](images/66419362a64392828f21284ebc5fa6b84faa3968dae7574b172fc3e4e022a8df.jpg) +(d) Structure of Residual Group + +![](images/42c7f3f94c31dcd82ea4d2d6eee71e060c2c2f3cefaf15058241a8cc20cb2dfe.jpg) + +Convolution + +![](images/226f8d65e3ee2840ba84eee938dadeef8586518744560482dc9bdb332c92e3b0.jpg) + +ReLU + +![](images/8dcacba8040e83237cfea0d0a8a49c93a5dcfb5ad48a5ff6ffe0c2dbdd5c7cf4.jpg) + +Residual Group + +![](images/e157bc8f822d6e76f06526f6f0924999e31359d99e70cfd96f82ed32aefbc157.jpg) + +Discrete Wavelet Transform + +![](images/56d436acfcca2d5c7a84064541de5563aaa1e29b5cf486ea4f06738f96df6442.jpg) + +Warping + +![](images/41a091297f3d2bc47bacb4f91d08aa6217181195ea40500db5b314fcadcc7e94.jpg) + +Element-wise Product + +![](images/2fddad6e6cd3f639133fcc282d509476bf4719dc5308e4f1519ae91f774bc48a.jpg) +Figure 2: Illustration of the proposed joint learning framework. (a) Pipeline of the joint learning model, where GCM module converts the color of $\hat{\mathbf{x}}$ (demosaicked from $\mathbf{x}$ via simple interpolation) for more accurate optical flow, then the warped sRGB $(\mathbf{y}^{w})$ can provide aligned supervision for a joint training of GCM and LiteISPNet. (b) Structure of GCM module, which is composed of a GuideNet and an SPN. The target sRGB $(\mathbf{y})$ and a coordinate map $(\tau)$ are deployed for guiding the color conversion. (c) Structure of LiteISPNet, please refer to Sec. 3.3 for more details. (d) Structure of residual group used in (c). + +Global Average Pooling + +![](images/b8c98806451afbbbf4c3201201d494a0ca72267ff6050cb098e5868e140b44b4.jpg) + +Pixelshuffle + +![](images/720dae340e9a4f538db03b1d54be2c01424e2084b8262f03c1c9bcc5431fe55e.jpg) + +Inverse Wavelet Transform + +![](images/190b94afe0f75507b85e80ebda7c3802aa314edb2a7466f838dd0cf2043f251b.jpg) + +Sigmoid + +![](images/cdaa6cd22649d37fc53d7dcd0de06d2367b56fe9f84a8ca72bd37e83895ea082.jpg) + +Element-wise Sum + +RAW-to-sRGB mapping aims at imitating the color characteristics and fine details of target sRGB image. The misalignment between $\mathbf{x}$ and $\mathbf{y}$ is harmful to the learning of RAW-to-sRGB mapping, thereby being prone to producing blurry outputs with unfavorable pixel shift. Several approaches have been proposed to improve the alignment or the learning robustness, but are still not sufficient in suppressing blurry outputs. + +Joint learning of image alignment and RAW-to-sRGB mapping can offer some new chances to circumvent such issue. On the one hand, RAW-to-sRGB mapping is helpful in diminishing the color inconsistency between $\mathbf{x}$ and $\mathbf{y}$ , thus easing the difficulty of image alignment. On the other hand, better image alignment also benefits RAW-to-sRGB mapping for suppressing blurry outputs and pixel shift. Unfortunately, the RAW-to-sRGB mapping (e.g., [22]) cannot completely avoid pixel shift (see Fig. 1), thus aligning $\mathbf{y}$ with $\hat{\mathbf{y}}$ cannot solve the misalignment problem. + +Instead of aligning $\mathbf{y}$ with $\hat{\mathbf{y}}$ , our joint learning model leverages a delicately designed global color mapping (GCM) module to generate a color-adjusted image $\tilde{\mathbf{y}}$ for warping $\mathbf{y}$ . A simple demosaicking method (e.g., bicubic) is first used to obtain $\hat{\mathbf{x}}$ by filling in missing values of $\mathbf{x}$ . Then, the GCM module is introduced as a pixel-wise mapping of $\hat{\mathbf{x}}$ , and thus can guarantee not to introduce any pixel shift in color correction. Furthermore, GCM is only required dur + +ing training. So we can take target sRGB image and coordinate map as input to generate conditional guidance for modulating GCM features towards diminishing color inconsistency. Thus, the GCM module can be given by, + +$$ +\tilde {\mathbf {y}} = \mathcal {C} (\hat {\mathbf {x}}, \mathbf {y}, \tau ; \Theta_ {\mathcal {C}}), \tag {2} +$$ + +where $\mathcal{C}$ denotes the GCM module, $\pmb{\tau} \in \mathbb{R}^{2 \times H \times W}$ is the 2D coordinate map containing the coordinate of the pixels, which is normalized to $[-1,1]$ . Given $\tilde{\mathbf{y}}$ and $\mathbf{y}$ , we use a pre-trained optical flow network (denote by $\mathcal{F}$ ), e.g., PwC-Net [46], to estimate the optical flow $\Psi$ , + +$$ +\Psi = \mathcal {F} (\tilde {\mathbf {y}}, \mathbf {y}). \tag {3} +$$ + +The estimated optical flow is then used to warp $\mathbf{y}$ to form a warped target sRGB image, + +$$ +\mathbf {y} ^ {w} = \mathcal {W} (\mathbf {y}, \Psi), \tag {4} +$$ + +where $\mathcal{W}$ is a warping operation (e.g., bilinear interpolation) [46]. Then, $\mathbf{y}^w$ can serve as a well-aligned target sRGB image for supervising the RAW-to-sRGB mapping $\mathcal{I}$ in Eqn. (1), resulting in our joint learning model (see Fig. 2). + +# 3.2. GCM Module + +For optical flow estimation, the color-adjusted image $\tilde{\mathbf{y}}$ is required to satisfy two prerequisites. (i) $\tilde{\mathbf{y}}$ should imitate the color of $\mathbf{y}$ for diminishing the severe color inconsistency. (ii) The spatial position of the pixels should keep the same + +as the input image $\hat{\mathbf{x}}$ . According to [16], some commonly-used image processing operations can be approximated or formulated by multi-layer perceptron (MLP), and the pixel-wise nature ensures that the input and output are strictly aligned. Thus, we deploy a spatially preserving network (SPN) as the backbone of our GCM module, which is composed of a stack of $1 \times 1$ convolutional layers. + +It is worth noting that GCM is only required during training. Thus the target sRGB image can also be safely fed into GCM for better converting $\tilde{\mathbf{y}}$ towards target sRGB image. To this end, we build a GuideNet to generate a conditional guidance vector from the raw $(\hat{\mathbf{x}})$ and target sRGB $(\mathbf{y})$ pair (see Fig. 2(b)). To alleviate the effect of misalignment in generating guidance vector, we use a relatively large kernel (i.e., $7\times 7$ ) in GuideNet, and global average pooling is deployed to acquire holistic information. + +Besides, dark corner (a.k.a, vignetting) can be observed in the raw images of several datasets (e.g., ZRR [20]), where the brightness is gradually weakened from image center to the boarders. Standard global color mapping, however, is not sufficient for compensating the adverse effect of dark corner. Fortunately, the effect of dark corner can be modeled by a pixel-wise function of 2D coordinate map (i.e., $\tau$ in Eqn. (2)) [56]. As a remedy, we simply feed $\tau$ to both the SPN and the GuideNet for handling anti-vignetting while learning color mapping simultaneously. + +With the GCM output $\tilde{\mathbf{y}}$ , we use PWC-Net [46] to estimate the optical flow for warping target sRGB image $\mathbf{y}$ . The warped sRGB image $\mathbf{y}^w$ can then be adopted as the supervision for training GCM. Besides, we note that the pixelwise mapping makes GCM unable to remove the noise in $\hat{\mathbf{x}}$ . Nonetheless, benefiting from PWC-Net [46], we can still estimate the optical flow between $\tilde{\mathbf{y}}$ and $\mathbf{y}$ robustly. + +# 3.3. LiteISPNet + +For alleviating mild alignment, existing methods usually build large models and exploit specific modules [9,22], which improves the performance at the cost of increasing inference time. Considering that a better alignment can be attained by joint learning, we can adopt a more efficient network for learning RAW-to-sRGB mapping to achieve comparable or even better performance. Thus, we present a LiteISPNet by simplifying MW-ISPNet [20], which is a U-Net [43] based multi-level wavelet ISP network. In particular, we put convolutional layer and residual group [63] before each wavelet decomposition by referring to [31]. Moreover, we also reduce the number of RCAB from 20 to 4 in each residual group to construct the LiteISPNet backbone. Fig. 2(c) illustrates the network structure of LiteISPNet. Benefited from the structure modification and joint learning, LiteISPNet outperforms MW-ISPNet [20] quantitatively and qualitatively with $\sim 40\%$ model size and $\sim 20\%$ running time. + +# 3.4. Learning Objectives + +Using the pre-trained PWC-Net [46] for computing optical flow, GCM and LiteISPNet can be jointly trained for learning image alignment and RAW-to-sRGB mapping. In the following, we respectively introduce the loss terms for GCM and LiteISPNet. + +Loss Term for GCM. Denote by $\tilde{\mathbf{y}}$ the GCM output in Eqn. 2 and $\mathbf{y}^w$ the warped target sRGB image in Eqn. 4. The loss term for GCM is given by, + +$$ +\mathcal {L} _ {\mathrm {G C M}} \left(\tilde {\mathbf {y}}, \mathbf {y} ^ {w}\right) = \| \mathbf {m} \circ \left(\tilde {\mathbf {y}} - \mathbf {y} ^ {w}\right) \| _ {1}, \tag {5} +$$ + +where $\circ$ denotes entry-wise product, $\| \cdot \| _1$ is $\ell_1$ loss and $\mathbf{m}$ is a mask indicating valid positions of the optical flow. Here, each element $m_{i}$ of $\mathbf{m}$ is defined as, + +$$ +m _ {i} = \left\{ \begin{array}{l l} 1, & \left[ \mathcal {W} (\mathbf {1}, \Psi) \right] _ {i} \geq 1 - \epsilon \\ 0, & \text {o t h e r w i s e} \end{array} , \right. \tag {6} +$$ + +where $\mathbf{1}$ denotes an all-1 matrix, $\epsilon$ is a threshold set to 0.001, and $[\cdot ]_i$ denotes the $i$ -th element of a matrix. + +Loss Terms for LiteISPNet. Denote by $\hat{\mathbf{y}}$ the LiteISPNet output in Eqn. 1. The LiteISPNet is trained with a combination of $\ell_{1}$ loss and (VGG-based) perceptual loss [36], which can be written as, + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {I S P}} (\hat {\mathbf {y}}, \mathbf {y} ^ {w}) = \lambda_ {\ell_ {1}} \| \mathbf {m} \circ (\hat {\mathbf {y}} - \mathbf {y} ^ {w}) \| _ {1} \tag {7} \\ + \lambda_ {V G G} \| \mathbf {m} \circ (\phi (\hat {\mathbf {y}}) - \phi (\mathbf {y} ^ {w})) \| _ {1}, \\ \end{array} +$$ + +where $\phi$ denotes the pre-trained VGG-19 [36] network, and we set $\lambda_{\ell_1} = \lambda_{VGG} = 1$ . Besides, to further enhance the visual quality, we also train the LiteISPNet with adversarial loss [14]. Following LSGAN [37], the loss function is defined as, + +$$ +\mathcal {L} _ {G A N} = \frac {1}{2} \mathbb {E} _ {\mathbf {x} \sim p _ {\mathbf {x}}} [ \mathcal {D} (\mathcal {I} (\mathbf {x})) - 1 ] ^ {2}, \tag {8} +$$ + +where $\mathcal{D}$ denotes the discriminator (see the suppl for detailed structure configuration), which is trained by + +$$ +\mathcal {L} _ {D} = \frac {1}{2} \mathbb {E} _ {\mathbf {y} \sim p _ {\mathbf {y}}} [ \mathcal {D} (\mathbf {y}) - 1 ] ^ {2} + \frac {1}{2} \mathbb {E} _ {\mathbf {x} \sim p _ {\mathbf {x}}} [ \mathcal {D} (\mathcal {I} (\mathbf {x})) ] ^ {2}. \tag {9} +$$ + +Then, LiteISPGAN is provided by training with the loss, + +$$ +\mathcal {L} _ {\text {I S P G A N}} = \mathcal {L} _ {\text {I S P}} + \lambda_ {G A N} \mathcal {L} _ {G A N}, \tag {10} +$$ + +where $\lambda_{GAN} = 0.01$ + +Learning Objective. With the above loss terms, the overall learning objective of our model can be defined by, + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {G C M}} + \mathcal {L} _ {\mathrm {I S P / I S P G A N}}. \tag {11} +$$ + +# 3.5. Extension to Other Image Enhancement Tasks + +As previously discussed in Sec. 2.2, RAW-to-sRGB mapping has been combined with many other tasks, where considerable efforts have been paid to mitigate the influence of misalignment [6,55,62]. In these scenarios, the main obstacle to alignment is similar with the ISP problem [22], thus the proposed joint training framework can be naturally extended to many image enhancement tasks. In this paper, we conduct experiments on the raw image SR [62] task to show the generalization ability of our method. + +![](images/2e480d04afff2ad4c230ebe92a37cc91d9694a8b938c9c45f572a3d2f7368fb3.jpg) +(a) Raw image (visualized) + +![](images/953051cc0f8cb33e3dd6e6a569d14a33354127bddb0edabf6a153e4c7c10dd1f.jpg) +(b) PyNet [22] + +![](images/1f385719e4682d3ec72b4be3f9168a1839aaab362f4d7d602514268d767c4149.jpg) +(c) AWNet (raw) [9] + +![](images/99c6b0252ef29504645f3880819ebaaa67433257a04a94db7b870c338d76fea8.jpg) +(d) AWNet (demosaicked) [9] + +![](images/9e3e1df1818f7a100952370ec6b6d2c2afbd3f97ecd5b36b5a36b7297ab5e7ec.jpg) +(e) MW-ISPNet (GAN) [20] + +![](images/b01eba6416e4a8a35ee2e0d0885c2260d4d6528c8c35d1edb848fda92f46f9d2.jpg) +(f) Ours (LiteISPNet) + +![](images/e00de125723390977e4f5270a3acfe83c74e30b6fce82fa258060521e9a76309.jpg) +(g) Ours (LiteISPGAN) + +![](images/26f893eb734df5911db6248e5d97aeb71e84d8810334a9561910329cfe90899a.jpg) +(h) GT +Figure 3: Visual comparisons on ZRR dataset. Please zoom in for better observation. + +Table 1: Quantitative results on ZRR dataset for methods trained without and with adversarial loss. + +
Method# Params (M)Time (ms)Original GT PSNR↑ / SSIM↑ / LPIPS↓Align GT with raw PSNR↑ / SSIM↑ / LPIPS↓Align GT with result PSNR↑ / SSIM↑ / LPIPS↓
PyNet [22]47.662.721.19 / 0.7471 / 0.19322.73 / 0.8451 / 0.15222.97 / 0.8510 / 0.152
AWNet (raw) [9]52.255.721.42 / 0.7478 / 0.19823.27 / 0.8542 / 0.15123.35 / 0.8559 / 0.151
AWNet (demosaicked) [9]50.162.721.53 / 0.7488 / 0.21223.38 / 0.8497 / 0.16423.41 / 0.8502 / 0.164
MW-ISPNet [20]29.2110.521.42 / 0.7544 / 0.21323.07 / 0.8479 / 0.16523.31 / 0.8578 / 0.164
Ours (LiteISPNet)11.923.321.55 / 0.7487 / 0.18723.76 / 0.8730 / 0.13323.87 / 0.8737 / 0.133
MW-ISPNet (GAN) [20]29.2110.521.16 / 0.7317 / 0.15922.80 / 0.8285 / 0.13423.38 / 0.8513 / 0.131
Ours (LiteISPGAN)11.923.321.28 / 0.7387 / 0.15923.47 / 0.8642 / 0.12023.56 / 0.8670 / 0.119
+ +# 4. Experiments + +# 4.1. Implementation Details + +Datasets. We conduct experiments on two datasets, i.e., Zurich RAW to RGB (ZRR) [22] and SR-RAW [62]. + +In the ZRR dataset, 20 thousand image pairs are collected and roughly aligned via SIFT keypoints [34] and the RANSAC algorithm [49], and the cropped patches with cross-correlation $< 0.9$ are discarded, resulting in 48,043 raw-sRGB pairs of size $448 \times 448$ . We follow the official division to train our LiteISPNet with 46.8k pairs, and report the quantitative results on the remaining 1.2k pairs. + +In the SR-RAW dataset, there are 500 scenes of images collected. In each scene, the authors take 7 photos with various focal length (24, 35, 50, 70, 100, 150 and $240\mathrm{mm}$ ), where the 24/100, 35/150 and 50/240 pairs form a $4\times$ super-resolution dataset (i.e., with 1,500 pairs in total). We use 400 scenes for training, 50 scenes for validation, and report the performance on $35 / 150~\mathrm{mm}$ pairs of rest 50 scenes. For a fair comparison, we replace LiteISPNet by SRResNet [27] used in Zhang et al. [62] on the SR-RAW dataset. + +Training Details. During training, data augmentation is applied on training images, including random horizontal + +flip, vertical flip and $90^{\circ}$ rotation. In each iteration, 16 packed raw patches with 4 channels are extracted as inputs. Our framework is optimized by ADAM algorithm [26] with $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ for 100 epochs. The learning rate is initially set to $1\times 10^{-4}$ and is decayed to half after 50 epochs. The experiments are conducted with PyTorch [39] framework on an Nvidia GeForce RTX 2080Ti GPU. + +Evaluation Configurations. To evaluate the performance quantitatively, we compute three metrics on RGB channels, i.e., Peak Signal to Noise Ratio (PSNR), Structural Similarity (SSIM) [51] and Learned Perceptual Image Patch Similarity (LPIPS) [61]. Note that in this paper, we use the version 0.1 of LPIPS trained on the AlexNet network. All results of the competing methods are generated via the officially released model. In addition, we also count the inference time on ZRR dataset to evaluate model efficiency. + +Besides providing the metrics computed with Original $GT$ , we additionally provide two sets of metrics for a comprehensive and more accurate comparison by considering the alignment. Specifically, we align $\mathbf{y}$ with GCM output $\tilde{\mathbf{y}}$ by PWC-Net [46], and the metrics computed with such warped $\mathbf{y}$ are denoted by Align GT with raw. In addition, considering that previous models trained with misaligned + +![](images/44275da7239e34bb0de609bc37a76b6b6a7b0a64fee9b5d624efe3b549183ced.jpg) + +![](images/4b863075049849210d03ea97bfcec80249e4f50d4f33b2502dc2bb39283f063e.jpg) + +![](images/52aea7054a14bef4cc892aeafb7ae011975f3489d24637d7b0f49e4c081ebbc4.jpg) + +![](images/0c08a72114c54f61e417b5aeeb736b0db293394b3ceec1c9e5b3352655d5bb05.jpg) + +![](images/0f8b71850ed17bf2689f3782a1e45d1fbdf7d2f38538901290e6f4be9b8c8128.jpg) + +![](images/c4d1177457bac290e875d9a5795937de77c00a5c66f386b1fb376171790a9100.jpg) +(a) Bicubic +(f) Raw image (visualized) +Figure 4: Visual comparison on SR-RAW dataset. $\dagger$ means that the result is obtained given LR sRGB image as input. + +![](images/5aad91f0770a03a5c3e328219c8709d9d38c4b798b1f1388876d43113ddb3f38.jpg) +(b) $\mathrm{SRGAN}^{\dagger}$ [27] +(g) Zhang et al. [62] + +![](images/c2816b0941a7f0049a2026ac6dfab39e8daf840218dec7c0922379fcc667ab30.jpg) +(c) ESRGAN† [50] +(h) Ours + +![](images/1615f5d79242a3bc55dbd7b0121bc3561a305426ea1c2bbd2bebcb94a81c35d4.jpg) +(d) $\mathrm{SPSR}^{\dagger}$ [35] +(i) Ours (GAN) + +![](images/d3817031f769b62cded711616513ac90c6c6ae45d6e784db4d385276f48c6d76.jpg) +(e) RealSR [24] +(j) GT + +Table 2: Quantitative results on SR-RAW dataset. Methods taking LR sRGB image as input are marked with ${}^{ \dagger }$ . + +
MethodOriginal GT +PSNR↑ / SSIM↑ / LPIPS↓Align GT with raw +PSNR↑ / SSIM↑ / LPIPS↓Align GT with result +PSNR↑ / SSIM↑ / LPIPS↓
SRGAN† [27]18.42 / 0.5534 / 0.45619.32 / 0.5999 / 0.41921.89 / 0.6832 / 0.398
ESRGAN† [50]18.66 / 0.5563 / 0.43519.55 / 0.6018 / 0.41121.99 / 0.6785 / 0.393
SPSR† [35]18.64 / 0.5428 / 0.45419.50 / 0.5854 / 0.44121.90 / 0.6603 / 0.425
RealSR† [24]18.69 / 0.5570 / 0.43519.58 / 0.6026 / 0.41222.03 / 0.6796 / 0.394
Zhang et al. [62]16.03 / 0.5184 / 0.51717.43 / 0.5745 / 0.44022.26 / 0.7205 / 0.372
Ours17.74 / 0.5572 / 0.43022.00 / 0.7049 / 0.34622.50 / 0.7205 / 0.342
Ours (GAN)17.71 / 0.5501 / 0.42222.10 / 0.6996 / 0.34022.59 / 0.7156 / 0.336
+ +data may cause pixel shift in the result, we further align the ground-truth with the output of each method, and the metrics are denoted by Align GT with result. + +# 4.2. Experimental Results on ZRR Dataset + +To evaluate the effectiveness of the proposed method on ZRR dataset, we compare our model with three state-of-the-art methods, i.e., PyNet [22], AWNet [9] and MW-ISPNet [20]. Note that AWNet (raw) and AWNet (demo-saicked) denote two models proposed in AWNet, which take 4-channel raw image and 3-channel demo-saicked image as input respectively, and MW-ISPNet (GAN) denotes MW-ISPNet trained with adversarial loss. + +As shown in Table 1, LiteISPNet exceeds the competing methods on all metrics in Align GT with raw and Align GT with result. Furthermore, when training with adversarial loss, our LiteISPGAN achieves better LPIPS score (as well as the PSNR and SSIM indices) than MW-ISPNet (GAN), which is the winner of perceptual track in the AIM 2020 Learned Smartphone ISP challenge [20]. It is worth mentioning that our model achieves the superior performance with a lightweight structure (the number of parameters is $\sim 25\%$ and $\sim 40\%$ of AWNet and MW-ISPNet), and the inference time is only $\sim 23$ ms for a $448 \times 448$ input ( $\sim 40\%$ and $\sim 20\%$ of AWNet and MW-ISPNet). + +Besides, we show the qualitative results in Fig. 3. It can be seen that the results of PyNet, AWNet (demosaicked) and MW-ISPNet (GAN) are blurry. AWNet (raw) is able to retain more details, however, it may generate artifacts and the result is less satisfactory. In contrast, our results are visually more pleasant while preserving finer details. Please refer to the suppl. for more results. + +# 4.3. Experimental Results on SR-RAW Dataset + +The proposed method is also evaluated on SR-RAW dataset for $4 \times$ SR. Apart from the raw image SR method (Zhang et al. [62]), we also compare with state-of-the-art sRGB image SR methods (i.e., SRGAN [27], ESRGAN [50], SPSR [35] and RealSR [24]), where low-resolution sRGB images provided in SR-RAW dataset are taken as input. The quantitative and qualitative results are given in Table 2 and Fig. 4, respectively. + +We can see that SRGAN [27], ESRGAN [50], SPSR [35] and RealSR [24] tend to generate noisy results with undesired textures, and show unsatisfactory quantitative performance. Although trained with mild misalignment robust contextual bilateral (CoBi) loss, Zhang et al. [62] is unable to recover fine details and resulting in blurry results. Our method, with the same SRResNet [27] backbone as Zhang et al. [62], can preserve more textures and generate + +![](images/a43456699c5d2fac6d71cf2996311014342ce257623bef9f51ee0b9f23d81d03.jpg) +(a) Full raw image (visualized) + +![](images/92a6f9a5dda2cd3267abe724001090a448ef4f48e4e1d2c2e0b599ef2dcd397a.jpg) +(b) SPN +Figure 5: Visual results of GCM output $(\tilde{\mathbf{y}})$ . With the guidance of $\mathbf{y}$ , the color of (c)(d) is closer to GT. Dark corner can also be observed, as the patch in blue box is darker in (b)(c) but has similar illumination with the patch in red box in (d)(e). + +![](images/c4d1ed5c52735104981ae5bd242504385a41cc62fb9f2651d72901d74ec7daf6.jpg) +(c) $\mathrm{SPN} + \mathbf{y}$ + +![](images/10daade2108110a0bbfdaec7661c788007a5ece1d888a3e376b6cecd1b66f409.jpg) +(d) $\mathrm{SPN} + \mathbf{y} + \pmb{\tau}$ (Ours) + +![](images/dff748081e1d1d2be1e0c2c421f9a0f4aeb4de8390e11b5808f9a60ea8020e88.jpg) +(e) GT + +Table 3: Ablation study on alignment strategies. + +
MethodPSNRLPIPS
SIFT (baseline)23.490.148
Align y withŷ23.330.136
Align y with x̂23.520.135
Align y withŷ (Ours)23.760.133
+ +Table 4: Ablation study on GCM. PSNR is calculated with GCM output $(\tilde{\mathbf{y}})$ and final result $(\hat{\mathbf{y}})$ , respectively. + +
GCM ComponentsPSNR (ŷ)PSNR (ŷ)
N/A-23.49
SPN20.6723.61
SPN + y26.3323.69
SPN + y + τ (Ours)26.9323.76
+ +Table 5: Ablation study on LiteISPNet. + +
# RCABTime (ms)PSNR
215.323.54
423.323.76
838.023.74
2091.523.79
+ +neat results. More qualitative results are given in the suppl. + +# 5. Ablation Study + +In this section, we conduct extensive ablation studies on the proposed joint learning framework, and report the PSNR metric of Align GT with raw on the ZRR dataset. + +# 5.1. Alignment Strategies + +To solve the misalignment issue between input raw and target sRGB image, an intuitive way is to align them. For example, image pairs in ZRR dataset are roughly aligned by SIFT [34] algorithm. We train a LiteISPNet with such image pairs as a baseline (see Table 3), and evaluate several potential strategies for better alignment. (1) Learning image alignment jointly with RAW-to-sRGB mapping may lead to an iterative optimization process, so we align $\mathbf{y}$ with the output of LiteISPNet $(\hat{\mathbf{y}})$ during training. Unfortunately, RAW-to-sRGB mapping is not a pixel-wise operation, resulting in more freedom for optical flow estimation and may cause more severe pixel shift. (2) We also estimate an optical flow between the demosaicked image $\hat{\mathbf{x}}$ and $\mathbf{y}$ , and align $\mathbf{y}$ with $\hat{\mathbf{x}}$ . Pixel shift is alleviated to some extent, yet the quality is still limited due to the color inconsistency. (3) With proposed GCM module, we can obtain $\tilde{\mathbf{y}}$ whose color is consistent with $\mathbf{y}$ while the pixel positions are same with $\hat{\mathbf{x}}$ . Thus, our method performs favorably against other alignment strategies. Please refer to the suppl. for visual results. + +# 5.2. GCM Module + +To evaluate each individual component of GCM module, we further perform experiments as shown in Table 5. The baseline is a LiteISPNet trained with mildly aligned image pairs in the dataset. When adding an SPN to the baseline, a $0.12\mathrm{dB}$ PSNR gain is attained owing to a rough color correction. By further introducing the guidance provided by target sRGB image $\mathbf{y}$ and concatenating the coordinate map $\tau$ , the quality of GCM output $\tilde{\mathbf{y}}$ is effectively improved (see Fig. 5), which helps in optical flow estimation and providing + +better aligned supervision. As a result, the performance of the LiteISPNet is also promoted. Note that the ground-truth $\mathbf{y}$ is applied to generate the GCM output, leading to a higher PSNR metric than the LiteISPNet output. However, it is unavailable during inference of the LiteISPNet. + +# 5.3. Structure of LiteISPNet + +To explore the structure of LiteISPNet, we also conducted experiments on the number of residual channel attention blocks (RCABs) in each residual group (RG). As shown in Table 5, using 4 RCABs is sufficient with the well aligned training data, and deeper networks do not bring noticeable performance improvements. Therefore, we apply 4 RCABs to achieve a better efficiency-performance tradeoff in our LiteISPNet. + +# 6. Conclusion + +Learning with inaccurately aligned supervision is prone to causing pixel shift and generating blurry results, but existing methods usually fail to solve the inherent misalignment problem in many RAW-to-sRGB tasks due to the severe color inconsistency between raw and sRGB pairs. To diminish the effect of color inconsistency, we presented a global color mapping (GCM) module, where SPN is leveraged to avoid spatial shift of pixels, and the target sRGB image serves as a guidance to convert the color of the raw data. Then, a pre-trained optical flow estimation model (e.g., PWC-Net) is deployed for obtaining well aligned supervision, which is used to train the RAW-to-sRGB mapping in a joint learning manner. Extensive experiments on ZRR and SR-RAW datasets show that our proposed method can achieve better performance against state-of-the-art methods both quantitatively and qualitatively. + +# Acknowledgement + +This work was supported by the National Natural Science Foundation of China (NSFC) under Grants No.s U19A2073 and 62006064. + +# References + +[1] Jonathan T Barron. Convolutional color constancy. In IEEE International Conference on Computer Vision (ICCV), pages 379-387, 2015. 3 +[2] Antoni Buades, Bartomeu Coll, and J-M Morel. A nonlocal algorithm for image denoising. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, pages 60-65. IEEE, 2005. 3 +[3] Jianrui Cai, Shuhang Gu, and Lei Zhang. Learning a deep single image contrast enhancer from multi-exposure images. IEEE Transactions on Image Processing (TIP), 27(4):2049-2062, 2018. 3 +[4] Jianrui Cai, Hui Zeng, Hongwei Yong, Zisheng Cao, and Lei Zhang. Toward real-world single image super-resolution: A new benchmark and a new model. In IEEE International Conference on Computer Vision (ICCV), pages 3086-3095, 2019. 3 +[5] Yue Cao, Jiarui Xu, Stephen Lin, Fangyun Wei, and Han Hu. Gcnet: Non-local networks meet squeeze-excitation networks and beyond. In International Conference on Computer Vision Workshops (ICCVW), pages 0-0, 2019. 1, 3 +[6] Prashant Chaudhari, Franziska Schirrmacher, Andreas Maier, Christian Riess, and Thomas Kohler. Merging-isp: Multi-exposure high dynamic range image signal processing. arXiv preprint arXiv:1911.04762, 2019. 1, 3, 5 +[7] Chen Chen, Qifeng Chen, Minh N Do, and Vladlen Koltun. Seeing motion in the dark. In IEEE International Conference on Computer Vision (ICCV), pages 3185-3194, 2019. 3 +[8] Chen Chen, Qifeng Chen, Jia Xu, and Vladlen Koltun. Learning to see in the dark. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3291-3300, 2018. 1, 3 +[9] Linhui Dai, Xiaohong Liu, Chengqi Li, and Jun Chen. Awnet: Attentive wavelet network for image isp. In European Conference on Computer Vision Workshops (ECCVW), 2020. 1, 3, 5, 6, 7 +[10] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In IEEE International Conference on Computer Vision (ICCV), pages 2758-2766, 2015. 2, 3 +[11] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2012. 3 +[12] Michael Gharbi, Gaurav Chaurasia, Sylvain Paris, and Frédo Durand. Deep joint demosaicking and denoising. ACM Transactions on Graphics (TOG), 35(6):1-12, 2016. 3 +[13] Michael Gharbi, Jiawen Chen, Jonathan T Barron, Samuel W Hasinoff, and Fredo Durand. Deep bilateral learning for real-time image enhancement. ACM Transactions on Graphics (TOG), 36(4):1-12, 2017. 3 +[14] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. 5 + +[15] Ralph Gross, Iain Matthews, Jeffrey Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image and Vision Computing, 28(5):807-813, 2010. 3 +[16] Jingwen He, Yihao Liu, Yu Qiao, and Chao Dong. Conditional sequential modulation for efficient global image retouching. In European Conference on Computer Vision (ECCV), pages 679-695. Springer, 2020. 3, 5 +[17] Keigo Hirakawa and Thomas W Parks. Adaptive homogeneity-directed demosaicing algorithm. IEEE Transactions on Image Processing (TIP), 14(3):360-369, 2005. 3 +[18] Yuanming Hu, Baoyuan Wang, and Stephen Lin. Fc4: Fully convolutional color constancy with confidence-weighted pooling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4085-4094, 2017. 3 +[19] Andrey Ignatov, Nikolay Kobyshev, Radu Timofte, Kenneth Vanhoey, and Luc Van Gool. Dslr-quality photos on mobile devices with deep convolutional networks. In IEEE International Conference on Computer Vision (ICCV), pages 3277-3285, 2017. 3 +[20] Andrey Ignatov, Radu Timofte, et al. Aim 2020 challenge on learned image signal processing pipeline. In European Conference on Computer Vision Workshops (ECCVW), 2020. 2, 3, 5, 6, 7 +[21] Andrey Ignatov, Radu Timofte, Sung-Jea Ko, Seung-Wook Kim, Kwang-Hyun Uhm, Seo-Won Ji, Sung-Jin Cho, Jun-Pyo Hong, Kangfu Mei, Juncheng Li, et al. Aim 2019 challenge on raw to rgb mapping: Methods and results. In IEEE International Conference on Computer Vision Workshops (ICCVW), pages 3584-3590. IEEE, 2019. 3 +[22] Andrey Ignatov, Luc Van Gool, and Radu Timofte. Replacing mobile camera isp with a single deep learning model. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 536-537, 2020. 1, 2, 3, 4, 5, 6, 7 +[23] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2462-2470, 2017. 2, 3 +[24] Xiaozhong Ji, Yun Cao, Ying Tai, Chengjie Wang, Jilin Li, and Feiyue Huang. Real-world super-resolution via kernel estimation and noise injection. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 466-467, 2020. 7 +[25] Hamid Reza Vaezi Joze, Ilya Zharkov, Karlton Powell, Carl Ringler, Luming Liang, Andy Roulston, Moshe Lutz, and Vivek Pradeep. Imagepairs: Realistic super resolution dataset via beam splitter camera rig. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 518-519, 2020. 3 +[26] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[27] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative adversarial network. In IEEE Conference on Computer Vision + +and Pattern Recognition (CVPR), pages 4681-4690, 2017. 3, 6, 7 +[28] Xiaoming Li, Ming Liu, Yuting Ye, Wangmeng Zuo, Liang Lin, and Ruigang Yang. Learning warped guidance for blind face restoration. In European Conference on Computer Vision (ECCV), pages 272-289, 2018. 3 +[29] Zhetong Liang, Jianrui Cai, Zisheng Cao, and Lei Zhang. Cameranet: A two-stage framework for effective camera isp learning. IEEE Transactions on Image Processing (TIP), 30:2248-2262, 2021. 1, 3 +[30] Lin Liu, Xu Jia, Jianzhuang Liu, and Qi Tian. Joint demosaicing and denoising with self guidance. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2240-2249, 2020. 3 +[31] Pengju Liu, Hongzhi Zhang, Wei Lian, and Wangmeng Zuo. Multi-level wavelet convolutional neural networks. IEEE Access, 7:74973-74985, 2019. 5 +[32] Pengju Liu, Hongzhi Zhang, Kai Zhang, Liang Lin, and Wangmeng Zuo. Multi-level wavelet-cnn for image restoration. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 773-782, 2018. 3 +[33] Zhongyu Lou, Theo Gevers, Ninghang Hu, Marcel P Lucassen, et al. Color constancy by deep learning. In British Machine Vision Conference (BMVC), pages 76-1, 2015. 3 +[34] David G Lowe. Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision (IJCV), 60(2):91-110, 2004. 1, 3, 6, 8 +[35] Cheng Ma, Yongming Rao, Yean Cheng, Ce Chen, Jiwen Lu, and Jie Zhou. Structure-preserving super resolution with gradient guidance. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7769-7778, 2020. 7 +[36] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision (ICCV), pages 2794-2802, 2017. 5 +[37] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision (ICCV), pages 2794-2802, 2017. 5 +[38] Moritz Menze, Christian Heipke, and Andreas Geiger. Joint 3d estimation of vehicles and scene flow. In ISPRS Workshop on Image Sequence Analysis (ISA), 2015. 3 +[39] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), pages 8024-8035, 2019. 6 +[40] Rajeev Ramanath, Wesley E Snyder, Youngjun Yoo, and Mark S Drew. Color image processing pipeline. IEEE Signal Processing Magazine, 22(1):34-43, 2005. 1, 2 +[41] Jaesung Rim, Haeyun Lee, Jucheol Won, and Sunghyun Cho. Real-world blur dataset for learning and benchmarking deblurring algorithms. In European Conference on Computer Vision (ECCV), pages 184-201. Springer, 2020. 3 + +[42] Alessandro Rizzi, Carlo Gatta, and Daniele Marini. A new algorithm for unsupervised global and local color correction. Pattern Recognition Letters, 24(11):1663-1677, 2003. 3 +[43] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer Assisted Intervention, pages 234-241. Springer, 2015. 5 +[44] Eli Schwartz, Alex Bronstein, and Raja Giryes. Isp distillation. arXiv preprint arXiv:2101.10203, 2021. 3 +[45] Eli Schwartz, Raja Giryes, and Alex M Bronstein. Deepisp: Toward learning an end-to-end image processing pipeline. IEEE Transactions on Image Processing (TIP), 28(2):912-923, 2018. 1, 3 +[46] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. PWC-net: Cnns for optical flow using pyramid, warping, and cost volume. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8934-8943, 2018. 2, 3, 4, 5, 6 +[47] Runjie Tan, Kai Zhang, Wangmeng Zuo, and Lei Zhang. Color image demosaicking via deep residual learning. In IEEE International Conference on Multimedia and Expo (ICME), volume 2, page 6, 2017. 3 +[48] Joost Van De Weijer, Theo Gevers, and Arjan Gijsenij. Edge-based color constancy. IEEE Transactions on Image Processing (TIP), 16(9):2207-2214, 2007. 3 +[49] Andrea Vedaldi and Brian Fulkerson. Vlfeat: An open and portable library of computer vision algorithms. In ACM International Conference on Multimedia, pages 1469-1472, 2010. 1, 3, 6 +[50] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. Esrgan: Enhanced super-resolution generative adversarial networks. In European Conference on Computer Vision Workshops (ECCVW), pages 0–0, 2018. 7 +[51] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing (TIP), 13(4):600-612, 2004. 6 +[52] Pengxu Wei, Ziwei Xie, Hannan Lu, Zongyuan Zhan, Qixiang Ye, Wangmeng Zuo, and Liang Lin. Component divide-and-conquer for real-world image super-resolution. In European Conference on Computer Vision (ECCV), pages 101-117. Springer, 2020. 3 +[53] Chyuan-Tyng Wu, Leo F Isikdogan, Sushma Rao, Bhavin Nayak, Timo Gerasimow, Aleksandar Sutic, Liron Ainkedem, and Gilad Michael. Visionisp: Repurposing the image signal processor for computer vision applications. In IEEE International Conference on Image Processing (ICIP), pages 4624-4628. IEEE, 2019. 3 +[54] Jin Xiao, Shuhang Gu, and Lei Zhang. Multi-domain learning for accurate and few-shot color constancy. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3258-3267, 2020. 3 +[55] Xiangyu Xu, Yongrui Ma, and Wenxiu Sun. Towards real scene super-resolution with raw images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1723-1731, 2019. 3, 5 + +[56] Wonpil Yu. Practical anti-vignetting methods for digital cameras. IEEE Transactions on Consumer Electronics, 50(4):975-983, 2004. 5 +[57] Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, and Ling Shao. CycleISP: Real image restoration via improved data synthesis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2696-2705, 2020. 3 +[58] Hui Zeng, Jianrui Cai, Lida Li, Zisheng Cao, and Lei Zhang. Learning image-adaptive 3d lookup tables for high performance photo enhancement in real-time. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2020. 3 +[59] Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Transactions on Image Processing (TIP), 26(7):3142-3155, 2017. 3 +[60] Kai Zhang, Wangmeng Zuo, and Lei Zhang. Ffdnet: Toward a fast and flexible solution for cnn-based image denoising. IEEE Transactions on Image Processing (TIP), 27(9):4608-4622, 2018. 3 +[61] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 586-595, 2018. 6 +[62] Xuaner Zhang, Qifeng Chen, Ren Ng, and Vladlen Koltun. Zoom to learn, learn to zoom. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3762-3770, 2019. 1, 2, 3, 5, 6, 7 +[63] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In European Conference on Computer Vision (ECCV), pages 286-301, 2018. 3, 5 \ No newline at end of file diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/images.zip b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f137a33eaf5a5954611dc6855fe184a1eb41d514 --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b2815de4d1463aaec9d35d3d29823ceadf5ca5c395fc70ede4a2288c1e2379c +size 659043 diff --git a/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/layout.json b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..815004c682ff1a717bdbf1f31557f050031dda74 --- /dev/null +++ b/learningrawtosrgbmappingswithinaccuratelyalignedsupervision/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11e89c20236bfceb71a6ee6a066952b36d1f5b3ca981ee27398f1953ad354839 +size 568306 diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_content_list.json b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cc718c722472e3bc32f7a3f87d954421d479c994 --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fd59b4f000059330d69d867de4914e5c0b566c57238e54afea70cdab1ed8bf5 +size 76490 diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_model.json b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f890a0a808edcad6f3e59a1f305ff5f985dddb40 --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33307755f701aee7cb3460343bd4f42133e11f6d19e4f2909db2f773d2615e1b +size 93838 diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_origin.pdf b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9b5a4b7d868b78e0ee741ccca56c8e41c2b95a6e --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/3df5aa99-2375-4a86-89e3-046b11287326_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89dc70f7137f1f120be0e06a60c4161afa2adaf7f0686542b3a288a35e6be213 +size 6590482 diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/full.md b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d6d2d8e60d0ecf99978207c884c54f256287db8d --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/full.md @@ -0,0 +1,323 @@ +# Learning Realistic Human Reposing using Cyclic Self-Supervision with 3D Shape, Pose, and Appearance Consistency + +Soubhik Sanyal $^{2*}$ +Betty Mohler $^{1}$ $^{1}$ Amazon + +Alex Vorobiov1 +Larry Davis1 + +Timo Bolkart2 +Javier Romero1 + +Matthew Loper1 +Michael J. Black1 + +2Max Planck Institute for Intelligent Systems, Tübingen + +{ssanyal, tbolkart}@tue.mpg.de {vorobioo, mloper, btmohler, lrrydav, javier, mjblack}@amazon.com + +![](images/4eae33227b90ce6a37fcd5d1644dcb76642fa50e259020cc6a8860800faedeff.jpg) +Figure 1: SPICE (Self-supervised Person Image CrEation) generates an image of a person in a novel pose given a source image and a target pose. Each triplet in the figure consists of the source image (left), a reference image in target pose (middle) and the generated image in the target pose (right); input and reference images are from the DeepFashion test set [22]. + +# Abstract + +Synthesizing images of a person in novel poses from a single image is a highly ambiguous task. Most existing approaches require paired training images; i.e. images of the same person with the same clothing in different poses. However, obtaining sufficiently large datasets with paired data is challenging and costly. Previous methods that forego paired supervision lack realism. We propose a self-supervised framework named SPICE (Self-supervised Person Image CrEation) that closes the image quality gap with supervised methods. The key insight enabling self-supervision is to exploit 3D information about the human body in several ways. First, the 3D body shape must remain unchanged when reposing. Second, representing body pose in 3D enables reasoning about self occlusions. Third, 3D body parts that are visible before and after reposing, should have similar appearance features. Once trained, SPICE takes an image of a person and generates a new image of that person + +in a new target pose. SPICE achieves state-of-the-art performance on the DeepFashion dataset, improving the FID score from 29.9 to 7.8 compared with previous unsupervised methods, and with performance similar to the state-of-the-art supervised method (6.4). SPICE also generates temporally coherent videos given an input image and a sequence of poses, despite being trained on static images only. + +# 1. Introduction + +Given a single source image of a person, can we generate a realistic image of what they would look like from a different viewpoint, in a different pose? While this problem is inherently ambiguous, there is significant statistical regularity in human pose, clothing, and appearance, that could make this possible as illustrated in Fig. 1. A solution to the problem would have widespread applications in online fashion, gaming, personal avatar creation or animation, and has consequently generated significant research interest [6, 16, 31, 33, 38, 42]. + +Recent work focuses on generative modeling [8, 13, 15, 49], especially using conditional image synthesis. One set of methods uses supervised training [6, 20, 21, 32], which requires paired training images of the same person in different poses with the same appearance and clothing. Requiring such paired data limits the potential size of the training set, which can impair robustness and generalization. Consequently, we address this problem without any paired data by developing a self-supervised approach. Such self-supervised formulations have also received significant recent attention [7, 26, 30, 42]. + +Our novel formulation builds on the idea of cycle-consistency [49] with some important modifications. For the forward direction of the cycle, the method takes a source image, source pose and target pose and generates a target image conditioned on pose and appearance. The reverse direction takes this generated image and regenerates the source image by switching the source and target conditions. The goal is to minimize the difference between the original input image and the one synthesized through the cycle. The problem is that this approach can have a trivial solution in which the cycle produces the identity mapping. To address this, previous methods [30, 38] constrain the target image generation with 2D information. Human bodies, however, are non-rigid 3D entities and their deformations and occlusions are not easily expressed in 2D. We show how leveraging 3D information, automatically extracted from images, constrains the model in multiple ways. + +Specifically, our method, called SPICE (Self-supervised Person Image CrEation), exploits the estimated 3D body to constrain the image generation, enabling self-supervised learning. In particular, we estimate the SMPL body model [23] parameters corresponding to both the input and the generated target image. Since the input and target image only differ in terms of their pose, their body shape should be the same. SMPL makes this easy to enforce because it factors body shape from pose. Using this we introduce two losses. First, we use a pose loss that encourages the body pose in the generated image to match the target pose in 3D. Second, we add a shape consistency loss that encourages the person in the generated image to have the same 3D shape as the person in the source image (Fig. 2). + +These two constraints, however, are not sufficient to generate images with the correct appearance since they only force the model to generate an image with the right shape and pose. There is no constraint that the generated image has the appearance of the source image (e.g. clothing, hair, etc.). Prior work addresses this by enforcing a perceptual loss between patches at each 2D joint [30]. This is not sufficient when the body is seen with large viewpoint changes or where a body part becomes occluded; see Fig. 3. We solve this problem by introducing pose-dependent appearance consistency on the body surface instead of at the joints. + +![](images/ce79879bf2771773c9c0d7abae42883f9b90987a38537fe0c7a8fa8d2a4f7b57.jpg) +Figure 2: Shape consistency: The first column shows two images of the same person in two different poses and views. The second column shows the 3D bodies predicted by our 3D regressor and posed in a T-pose. The estimated 3D body shape is similar for the same subject across poses and views. The third column shows the per-vertex difference of both meshes, color coded from blue (0 mm) to red (20 mm). + +The idea is that the projected surface of the 3D body in two different poses must have similar appearance features for matching parts of the body and this similarity should be weighted proportional to the relative global orientation difference between the 3D bodies. + +In summary, we improve the realism of self-supervised human reposing by exploiting 3D body information in three novel ways: using a 3D pose loss, body shape consistency, and occlusion-aware appearance feature consistency. We train SPICE with our new constraints on unpaired data. Extensive experiments on the DeepFashion [22] and Fashion Video datasets [44] show the effectiveness of our model qualitatively and quantitatively. SPICE significantly outperforms the prior state-of-the-art (SOTA) un/self-supervised methods and is nearly as accurate as the best supervised methods. + +# 2. Related Work + +Methods for reposing images of humans can be broadly divided into two categories: supervised or unsupervised. While both approaches rely on generative modeling [8, 13, 15, 49], the supervised methods require paired ground truth: source and target training images of the person in different poses. Our approach falls into the unsupervised or self-supervised category, in which we do not use paired training data. We address each class of methods below. + +Supervised methods: Supervised approaches learn to transform a source image given a source pose and a target pose [2, 5, 6, 9, 16, 19-21, 24, 25, 27, 28, 31, 32, 34-36, 39-41, 43, 45, 50]. Supervision is provided by the target + +![](images/3c7817782cf07151079309892827532ec7abec0981729edffd2930d58208702b.jpg) +Figure 3: Problem: patch loss based on 2D keypoints. A person is seen in three different poses with the same clothing. A patch (white rectangle) is extracted at her left hip keypoint. Assuming that the appearance of the patch is the same across viewpoints is incorrect. Instead, SPICE uses the 3D body surface to reason about the regions of the body that are visible in multiple views. Keypoints are predicted by OpenPose [4] for this figure. + +image during training and usually adversarial and perceptual losses are used to train the model [33]. The differences between methods usually lie in network inputs and their architectures. Dong et al. [5] synthesize the target image in two stages. First they generate a target pose segmentation from the source pose and use it in their soft-gated warping block architecture to render the person in the target pose. Knoche et al. [16] learn an implicit volumetric representation of the person to warp the source pose into the target pose. The volumetric representation is implicitly learned using an encoder decoder architecture. Li et al. [20] utilize a learned flow field to warp a person in a source pose to the target pose. The flow field is learned from 3D bodies and is used for warping at the feature level and pixel level in a deep architecture. Ma et al. [24] first generate a coarse image of the global structure of a human in the target pose from the source pose in a two stage network. This is then refined in an adversarial way in the second stage to get finer details. Sarkar et al. [32] compute a partial UV texture map using DensePose [10] from the source image. They use this as input to their network, which learns to complete the UV texture map and render it in a target pose using neural rendering. Siarohin et al. [35] propose a network architecture using deformable skip connections to tackle the problem. Tang et al. [39] propose a co-attention fusion model that fuses appearance and shape features from images, which they disentangle inside their architecture. They use two different discriminators for appearance and shape to jointly judge the generation. Zhu et al. [50] propose a progressive generator using a sequence of attention transfer blocks. Each of these blocks transfers certain regions it attends to and generates the image of the person progressively. Ren et al. [31] propose a new deep architecture where they combine flow-based operations with an attention mechanism. + +Note that the above methods are all supervised and cannot be directly used in the self-supervised scenario. In contrast, our work is focused on unpaired data and we build on the Ren et al. [31] architecture to enable this. Thus our contribution does not lie with network architecture but, rather, in introducing novel constraints that make it possible to solve the problem without paired data. + +Unsupervised or self-supervised settings: There is an increasing interest in solving the problem in an unsupervised/unpaired manner. Such approaches can work when paired data is not available or can increase robustness and generalization by combining paired and unpaired data. An early approach [26] divides the process in two stages. The first stage uses an auto-encoder-based architecture to learn the corresponding embedding space for pose, foreground and background from source images. The second stage maps Gaussian noise to the embedding space of pose, foreground and background and uses the pretrained decoder from the first stage to generate a person's image in a new pose. Yang et al. [42] train an appearance encoder from the source image to learn the appearance representation or embedding. They fuse the appearance embedding with the pose embedding coming from an image of a different person in different pose. In this way they generate the person's image in the new pose. Esser et al. [7] use a U-Net architecture conditioned on the output of a variational auto-encoder for appearance. They also try to disentangle pose and appearance of a person from the source images. + +In general, the mentioned approaches attempt to disentangle shape, pose and appearance in the latent space from a 2D image, which is a hard problem. This results in a relatively poor image generation quality. Instead of learning this disentanglement from images we approach the problem differently. We extract the person's pose and shape information in a parametric decoupled 3D body representation, SMPL [23], and constrain our self-supervised generation. Furthermore, we also constrain appearance generation by leveraging the surface and projection of the 3D body. + +Similar to our cyclic formulation, Pumarola et al. [30] and Song et al. [38] train their networks in a self-supervised CycleGAN [49] fashion. Additionally, [38] use semantic parsing maps as input to the network. They constrain their self-supervised generation with 2D information. We differ from these methods by constraining the self-supervised approach with 3D body information. + +# 3. Method + +SPICE requires a training dataset of tuples $(I, P, R)$ , each containing an image $I$ of a person, their pose $P$ as 2D keypoints, and a 2D rendering $R$ . To generate $R$ we fit the SMPL 3D mesh [23] to $P$ using SMPLify [3], and render the mesh using a color wheel texture in UV space. + +We treat all the samples in the dataset as independent; + +![](images/4e96321b02630450a353ad34c1a87d8fe0d9c542bb4ebd1f1fb422e2114168e8.jpg) +Figure 4: Overview of SPICE: Given a source image of a person $I_{s}$ , source pose $P_{s}$ , target pose $P_{t}$ and 3D mesh rendering of the source pose $R_{s}$ , the generator $\mathcal{G}$ generates a target image with the person in the target pose. Then the source and target pose are swapped and passed through $\mathcal{G}$ but with the generated target image as the source. This should re-generate the source image enabling the use of a cyclic self-supervision loss, $\mathcal{L}_{cycle}$ , during training. To prevent trivial solutions, the cycle is constrained by losses on 3D pose $\mathcal{L}_{\theta}$ , shape $\mathcal{L}_{\beta}$ and appearance $\mathcal{L}_{app}$ , which are the main contributions of SPICE (Section 3), and an adversarial loss $\mathcal{L}_{adv}$ . Note that the $P_{s}$ and $P_{t}$ are provided as input heat-maps to $\mathcal{G}$ . + +that is, our method does not require images of the same person wearing the same clothing in different poses (i.e. without direct supervision through paired data). During training, the source image $I_{s}$ , source pose $P_{s}$ , source rendering $R_{s}$ , target pose $P_{t}$ and target rendering $R_{t}$ are given. SPICE then synthesizes the image $\hat{I}_{t}$ , which is the reposed source image $I_{s}$ , using a generator network $\mathcal{G}$ (Section 3.1): + +$$ +\hat {I} _ {t} = \mathcal {G} \left(I _ {s}, P _ {s}, R _ {s}, P _ {t}\right). \tag {1} +$$ + +During training, we exploit cycle-consistency (Section 3.2). Specifically, we generate a synthetic version of the source image from $\hat{I}_t$ by reusing $\mathcal{G}$ ; i.e. $\hat{I}_s = \mathcal{G}(\hat{I}_t, P_t, R_t, P_s)$ . This enables us to directly apply perceptual and pixel-wise losses between $I_s$ and $\hat{I}_s$ to train $\mathcal{G}$ . To prevent trivial solutions, we add 3D guidance (Section 3.3) and appearance constraints (Section 3.4) for $\hat{I}_t$ . See Figure 4 for an overview of the SPICE training pipeline. + +# 3.1. Generator architecture + +Our generator $\mathcal{G}$ has two modules: a global flow field estimator and a local neural rendering module. The flow estimator module takes $R_{s}, P_{s}, P_{t}$ as input and generates 2D warping fields at the feature level between the source and the target pose. The neural rendering module takes $I_{s}$ and $P_{t}$ as inputs and uses the generated warping fields at the feature level of its local attention blocks to generate $\hat{I}_t$ . The loss for the flow estimator module can be written as, + +$$ +\mathcal {L} _ {f l o w} = \mathcal {L} _ {f l o w} ^ {R _ {s} \rightarrow R _ {t}} + \mathcal {L} _ {f l o w} ^ {R _ {t} \rightarrow R _ {s}}, \tag {2} +$$ + +where $\mathcal{L}_{flow}^{x\rightarrow y}$ is the weighted addition of the sampling correctness loss and regularization loss for the generated flow fields, as proposed by Ren et al. [31]. Here, $\mathcal{L}_{flow}^{R_s\rightarrow R_t}$ is applied while synthesizing $\hat{I}_t$ , and $\mathcal{L}_{flow}^{R_s\rightarrow R_t}$ is applied when regenerating $\hat{I}_s$ at the end of the cycle. The sampling correctness loss is the computed cosine similarity distance between the warped source features and target features. The source and target features come from a specific layer of a pre-trained VGG network [37] given the source and target renderings as input, respectively. The regularisation loss provides regularisation to the generated warping fields. + +Our generator follows the design of Ren et al. [31] with the difference that the flow estimator is trained on source and target renderings (i.e. $R_{s}$ and $R_{t}$ ), instead of source and target images (i.e. $I_{s}$ and $I_{t}$ ), due to the unavailability of $I_{t}$ in our setting. We refer to Ren et al. [31] for more details on the sampling correctness loss and the regularization loss. + +# 3.2. Closing the cycle + +Enforcing cycle consistency enables us to train SPICE with supervised losses between the source image $I_{s}$ and the regenerated source image $\hat{I}_{s}$ . Specifically, we minimize + +$$ +\mathcal {L} _ {\text {c y c l e}} = \lambda_ {\text {p e r c e p}} \mathcal {L} _ {\text {p e r c e p}} + \lambda_ {\text {s t y l e}} \mathcal {L} _ {\text {s t y l e}} + \lambda_ {\text {p i x}} \mathcal {L} _ {\text {p i x}}, \tag {3} +$$ + +where the $\lambda$ 's are individual loss weights, and the perceptual loss $\mathcal{L}_{percep}$ , style loss $\mathcal{L}_{style}$ , [14], and pixel-wise loss + +$\mathcal{L}_{pix}$ are defined as + +$$ +\mathcal {L} _ {p e r c e p} = \sum_ {j} \left\| \phi_ {j} (I _ {s}) - \phi_ {j} (\hat {I} _ {s}) \right\| _ {1} +$$ + +$$ +\mathcal {L} _ {\text {s t y l e}} = \sum_ {j} \left\| \mathbb {G} \left(\phi_ {j} \left(I _ {s}\right)\right) - \mathbb {G} \left(\phi_ {j} \left(\hat {I} _ {s}\right)\right) \right\| _ {1} +$$ + +$$ +\mathcal {L} _ {p i x} = \left\| I _ {s} - \hat {I} _ {s} \right\| _ {1}, +$$ + +where $\phi_{j}$ is the activation map of the $j^{th}$ layer of a pretrained VGG network [37], and $\mathbb{G}$ is the Gram matrix built from the activation map $\phi_{j}$ . + +To generate realistic looking images, SPICE minimizes an adversarial loss by adding a discriminator, $D$ , that discriminates between the fake images $\hat{I}_t$ and real images $I_s$ . To provide pose information along with each image, we condition $D$ on the corresponding rendering (i.e. $R_t$ for $\hat{I}_t$ , and $R_s$ for $I_s$ ), by providing the concatenation of the two images as discriminator input. Formally, we minimize + +$$ +\mathcal {L} _ {a d v} = \mathbb {E} [ \log (1 - D (\hat {I} _ {t}, R _ {t})) ] + \mathbb {E} [ \log D (I _ {s}, R _ {s}) ]. \quad (4) +$$ + +# 3.3. Pose and shape consistency + +SPICE uses the SMPL [23] 3D human body model to enforce pose and shape consistency during training. SMPL combines identity-dependent shape blendshapes with pose-dependent corrective blendshapes and linear blendskinning (LBS) for pose articulation. Importantly, this formulation disentangles body shape form pose. Given parameters for shape $\beta \in \mathbb{R}^{|\beta|}$ and pose $\theta \in \mathbb{R}^{3K + 3}$ , SMPL is a function, $\mathcal{M}(\beta, \theta)$ that outputs a 3D mesh with $N = 6890$ vertices. + +To extract SMPL shape and pose parameters $\beta$ and $\pmb{\theta}$ from $I$ , we use a differentiable regressor [17], denoted as + +$$ +\beta , \theta = f _ {3 D} (I). \tag {5} +$$ + +Given the extracted SMPL parameters $\hat{\beta}_t, \hat{\theta}_t = f_{3D}(\hat{I}_t)$ , we define a loss that encourages the 3D rotation of the joints in the synthetic image, $\hat{\theta}_t$ , to be the same as the rotation of the joints in the target pose $\theta_t$ : + +$$ +\mathcal {L} _ {\boldsymbol {\theta}} = \left\| \boldsymbol {\theta} _ {t} - \hat {\boldsymbol {\theta}} _ {t} \right\| _ {1}, \tag {6} +$$ + +where $\theta_{t}$ is obtained by running SMPLify [3] on $P_{t}$ . + +SPICE also enforces body shape consistency (Figure 2) based on the observation that while $I_{s}$ and $\hat{I}_t$ differ in pose, their body shapes $\beta_{s}$ (i.e. $\beta_{s},\theta_{s} = f_{3D}(I_{s})$ ) and $\hat{\beta}_{t}$ must be the same, enforced by + +$$ +\mathcal {L} _ {\beta} = \left\| \beta_ {s} - \hat {\beta} _ {t} \right\| _ {1}. \tag {7} +$$ + +# 3.4. Appearance feature consistency + +The above losses constrain pose and shape in $\hat{I}_t$ , but do not guarantee that the appearance of $\hat{I}_t$ remains consistent + +![](images/12313e955e0a442e7058b6d08dc52e01e25edbfec3fd5f2321da22963881f8e8.jpg) + +![](images/d712a4c847f9d6b5e80021cf10e0192f1a788014f4df1f68eddf5f94f3517591.jpg) + +![](images/74c3a923881282d4562fd3dde447a1658af817410d46386ca7b485db5b5e0d2d.jpg) + +![](images/c0d1e04182fe504d183d3a5dc4951066b32b6b66062db32c19758c7fb7f7eaf0.jpg) + +![](images/c8f65b999cab3453292e11db310533cd6bcfb5fba2d87b103655e1cbd068a67e.jpg) + +![](images/17c29f08f0854098dd5d4aeab9edc3597310c10d9d6eb1f635817c3eee443bb9.jpg) +a) +Figure 5: Appearance feature consistency: a) SMPL template with front (red) and back (blue) torso masks, b) and c) shows images of a person in different poses (left), and corresponding torso masks obtained by rendering the 3D body with the subject's pose. The appearance consistency loss is then applied on image segments for torso masks of the same color weighted by the relative pelvis rotation. + +![](images/f8d10c96e1947289abab6a0d95d15f49c945fcd448ae3f589dbf7e0c77c023d7.jpg) +b) + +![](images/23760a609036caa855152dd78c8ef9ac2d6b5d4b301118f73e4665e73d700d3b.jpg) +c) + +![](images/5716c3cba30e0260740c5d29c80d2a070ffaecfef185336db28d5f54a2dd5e39.jpg) + +with $I_{s}$ . Consequently, we formulate an additional constraint on the appearance of matching regions in $I_{s}$ and $\hat{I}_t$ to be similar. Due to the unconstrained change in the pose between $I_{s}$ and $\hat{I}_t$ , we cannot apply the deep appearance loss (perceptual or style loss) directly between those images. + +Instead, we leverage the 3D body mesh to apply an appearance loss between corresponding image segments. Given SMPL parameters $\beta$ and $\theta$ , we render the mesh $\mathcal{M}(\beta, \theta)$ with the texture from Figure 5 a) to get the image segments for the rendered front and back torso areas, shown in Figure 5 b), and c). Let $M_{mask}$ denote a binary mask, with value 1 for pixels within the front/back torso segment and 0 elsewhere. Further, let $\mathcal{P}_{patch}$ denote $I \odot M_{mask}$ , where $\odot$ is the Hadamard product. Both, $m$ and $p$ are cropped from $M_{mask}$ and $\mathcal{P}_{patch}$ , by the bounding box of the image segment. + +Given image patches $p_s$ and $\hat{p}_t$ together with binary masks $m_s$ and $\hat{m}_t$ , both extracted from $I_s$ and $\hat{I}_t$ , the appearance consistency is given as $l_{app} =$ : + +$$ +\begin{array}{l} \lambda_ {a _ {1}} \sum_ {k} \| \phi_ {k} (p _ {s}) \odot \psi_ {k} (m _ {s}) - \phi_ {k} (\hat {p} _ {t}) \odot \psi_ {k} (\hat {m} _ {t}) \| _ {1} \\ + \lambda_ {a _ {2}} \sum_ {j} ^ {n} \left\| \mathbb {G} _ {j} ^ {\phi} (p _ {s}) \odot \psi_ {j} (m _ {s}) - \mathbb {G} _ {j} ^ {\phi} (\hat {p} _ {t}) \odot \psi_ {j} (\hat {m} _ {t}) \right\| _ {1} \tag {8} \\ \end{array} +$$ + +where the $\lambda$ 's are weights, $\phi_k$ is the activation map of the + +$k^{th}$ layer of pretrained VGG network [37], $\mathbb{G}_j^\phi$ is the Gram matrix built from the corresponding activation map $\phi$ , and $\psi$ is the down-sampling function for the corresponding layer. + +Note that the appearance loss as it is formulated requires sufficient overlap of corresponding image features within the mask crop. We compute the appearance loss as: + +$$ +\mathcal {L} _ {\text {a p p}} = \lambda \left(\boldsymbol {\theta} _ {s}, \boldsymbol {\theta} _ {t}\right) \times l _ {\text {a p p}}, \tag {9} +$$ + +where $\lambda (\pmb {\theta}_s,\pmb {\theta}_t)$ is a weighting function that depends on the relative pelvis rotation (i.e. rotation around the SMPL root joint) between the source and target pose: + +$$ +\lambda \left(\boldsymbol {\theta} _ {s}, \boldsymbol {\theta} _ {t}\right) = \left\{ \begin{array}{l l} 1. 0 & \text {i f} 0 ^ {\circ} \leq \left| \boldsymbol {\theta} _ {s} ^ {p e l} - \boldsymbol {\theta} _ {t} ^ {p e l} \right| < 2 0 ^ {\circ} \\ 0. 1 & \text {i f} 2 0 ^ {\circ} \leq \left| \boldsymbol {\theta} _ {s} ^ {p e l} - \boldsymbol {\theta} _ {t} ^ {p e l} \right| < 4 0 ^ {\circ} \\ 0. 0 1 & \text {i f} 4 0 ^ {\circ} \leq \left| \boldsymbol {\theta} _ {s} ^ {p e l} - \boldsymbol {\theta} _ {t} ^ {p e l} \right| < 6 0 ^ {\circ} \\ 0. 0 & \text {o t h e r w i s e .} \end{array} \right. \tag {10} +$$ + +# 3.5. Final loss + +The total loss of the proposed approach is: + +$$ +\begin{array}{l} \mathcal {L} _ {S P I C E} = \alpha_ {c y c l e} \mathcal {L} _ {c y c l e} + \alpha_ {f l o w} \mathcal {L} _ {f l o w} + \alpha_ {a d v} \mathcal {L} _ {a d v} \tag {11} \\ + \alpha_ {\boldsymbol {\theta}} \mathcal {L} _ {\boldsymbol {\theta}} + \alpha_ {\boldsymbol {\beta}} \mathcal {L} _ {\boldsymbol {\beta}} + \alpha_ {a p p} \mathcal {L} _ {a p p}, \\ \end{array} +$$ + +where $\alpha_{i}$ are the corresponding loss weights. The following section provides details on how these weights are set. + +# 4. Experiments + +Datasets: SPICE is evaluated on two publicly available datasets, namely the DeepFashion In-shop Clothes Retrieval Benchmark [22] and the Fashion Video dataset [44]. The DeepFashion data are used for qualitative and quantitative comparisons and Fashion Video data for motion transfer examples, following Sarkar et al. [32]. The DeepFashion dataset [22] consists of 52712 high-resolution model images in fashion poses. The data are split into training and testing sets as in previous work [31, 50]. For training, we use 25341 images from the training set, in which body keypoints from nose to knee are at least visible. Further, 100 randomly selected images from the training set are held out as a validation set for model selection. The qualitative and quantitative evaluations are performed on the same 8570 image pairs as used by Ren et al. [31]. The Fashion Video dataset [44] consists of fashion pose video sequences of women in various clothing, captured with a static video camera. The dataset is split into 500 training and 100 test videos as done by Sarkar et al. [32], with each video containing roughly 350 frames. Please note that SPICE uses no paired images for training. + +Training details: We use residual blocks as basic building blocks for $\mathcal{G}$ . For more details of the architecture we refer the reader to Ren et al. [31]. We train SPICE with an image resolution of $256 \times 256$ for both datasets. We + +![](images/2af0d97e254f00c45676c6f8598c5fc6d80e759140a07ba407ea9b2a99730c4a.jpg) +Figure 6: Qualitative results on the Fashion Video dataset [44]. Video frames are synthesized from the source frame using the poses in the driving video. See Sup. Mat. for video and more examples. + +
DeepFashionUnpairedFID(↓)LPIPS(↓)
Def-GAN [35]✗18.50.233
Pose-Attn [50]✗20.70.253
Intr-Flow [20]✗16.30.213
CoCosNet* [46]✗14.4-
ADGAN ** [27]✗22.70.183
Ren et al. ** [31]✗6.40.143
VUNET ** [7]✓34.70.212
DPIG ** [26]✓48.20.284
PGSPT ** [38]✓29.90.238
SPICE (Ours)✓7.80.164
+ +Table 1: Quantitative comparison of our method with other state-of-the-art methods. The * denotes that the method reports results for a different train/test split. The ** denotes that the metrics were recalculated using publicly available code and following the protocol described in Sup. Mat.; note that recalculation of the metrics results in different numbers from those reported in [31]. + +use spectral normalisation for both the generator and discriminator. The learning rate is $8\mathrm{e} - 4$ for $\mathcal{G}$ and $1.6\mathrm{e} - 3$ for the discriminator following similar GAN training strategy of Heusel et al [12]. We use 8 NVIDIA V100 GPUs + +to train SPICE, where each GPU has a batch size of 8. We set the weights for different losses as follows: $\alpha_{cycle} = 1.0$ , $\alpha_{flow} = 1.0$ , $\alpha_{adv} = 1.0$ , $\alpha_{\theta} = 0.01$ , $\alpha_{\beta} = 0.01$ , $\alpha_{app} = 1.0$ , $\lambda_{a_1} = 0.01$ , $\lambda_{a_2} = 10.0$ , $\lambda_{percep} = 0.5$ , $\lambda_{style} = 500.0$ , $\lambda_{pix} = 5.0$ . First, we train the flowfield estimator. Differing from Ren et al. [31], we use $R_s$ and $R_t$ together with keypoints due to the unavailability of $I_t$ during training. $R_s$ and $R_t$ are used as the replacement for $I_s$ and $I_t$ respectively in their flow estimator module. We also finetune the 3D regressor $f_{3D}$ on our training splits of the DeepFashion dataset [22] following a similar approach of Kolotouros et al. [18]. During the finetuning of $f_{3D}$ , we use a similar representation proposed by Zhou et al. [48] for representing 3D rotations. Finally, we train the whole SPICE model end-to-end keeping the 3D regressor weights fixed. During a training iteration we use ROAlign [11] to extract the desired regions from $I_s$ and $\hat{I}_t$ . We trained our models for 5 days ( $\sim 400$ epochs). Inference for a single image takes $74~\mathrm{ms}$ using a single NVIDIA V100 GPU. + +Evaluation metrics: Following Ren et al. [31], we use Learned Perceptual Image Patch Similarity (LPIPS) [47] and FID [12] scores to evaluate our experimental results. LPIPS quantifies the perceptual distance between the generated image and the ground-truth image. The FID score is defined as the Wasserstein-2 distance between the distributions of real and generated images. We utilize the LPIPS score to evaluate the reconstruction error of SPICE, and the FID score to quantify the realism of the generated images. Image compression (e.g. JPEG) applied on reference or generated images significantly affects the FID scores. See Sup. Mat. for more details or [29] for a similar analysis. We also evaluated other metrics like contextual similarity [27] and object keypoint similarity [1] and provide the results in Sup. Mat. Details about the protocol for computing FID and LPIPS can also be found in Sup. Mat. + +Quantitative evaluation: Table 1 quantitatively compares our method and other state-of-the-art approaches on the DeepFashion dataset [22]. We compare with DefGAN [35], Pose-Attn [50], Intr-Flow [20], CoCosNet [46], ADGAN [27], Ren et al. [31], DFIG [26], VUNet [7] and PGSPT [38]. Note that Def-GAN, Pose-Attn, Intr-Flow, CoCosNet, ADGAN and Ren et al. are supervised methods, requiring the ground-truth image of a person in the target pose and clothing during training. In contrast, our method is unsupervised and comparable with the bottom half of the table (i.e. [7, 26]). We have used the publicly available code provided by Ren et al. [31], ADGAN [27], VUNet [7], DFIG [26] and PGSPT [38] to regenerate the images on our test split and recompute the metrics. SPICE achieves state-of-the-art results among unpaired methods and competitive results when compared with supervised methods. + +Qualitative evaluation: Figure 1 shows results on the DeepFashion test split. SPICE does a good job of preserving + +![](images/bc64974da374d94014a9b68a8bbbb16ea764513e23c14f5bfd61ddb9014f815c.jpg) +Figure 7: Qualitative comparison: More results can be found in the Sup. Mat. + +ing the target appearance and pose despite the large pose change. Figure 7 provides a qualitative comparison with other un/self-supervised methods on the DeepFashion test split. SPICE generates more realistic and high quality images while preserving pose and appearance compared with DFIG [26], VUnet [7] and PGSPT [38]. See Sup. Mat. Video for more visual results on the DeepFashion test split. + +Motion transfer: If you can generate one pose, you can generate a sequence of poses. Consequently, we show video generation on the test split of the Fashion Video dataset in Fig. 6. We randomly select one video from the test split to act as a driving video that provides the target pose. We take the first frame of the other videos from the test split as the source image and generate the whole sequence from these. Please note that we did not train SPICE to generate videos; i.e. there is no video supervision or temporal consistency. See Sup. Mat. Video for examples of generated videos. + +Ablation study: Table 2 summarizes our ablation study, which removes one loss at a time from the model. The configuration "SPICE w unconditional $D$ " means that we give the generated image to the discriminator without conditioning on pose by concatenating the renderings. Our full model better preserves details, pose, and has better overall image quality. Trained without the pose loss, the generator has less information about the self-occlusions of the body. Therefore it tends to generate poses that are not possible for a real person, e.g. growing legs inside another leg, etc. If we train SPICE excluding the shape loss, the generator has less information about the 3D body shape of the person in the source image, which can lead to inconsistent deformations of shape in the generated images; e.g. having bigger hips with a very thin waist, etc. Excluding the appearance loss during training leads to less detailed reconstructions and an overall reduced clothing consistency. Figure 8 and + +
ConfigurationFID(↓)LPIPS(↓)
SPICE w/o shape loss8.70.166
SPICE w/o pose loss8.40.165
SPICE w/o appearance loss9.90.164
SPICE w unconditional D10.00.167
SPICE7.80.164
+ +Table 2: Ablation study on DeepFashion test set [22]. + +![](images/6752d2f00d3d97bb12927f75a63f77d63f3bdfe998b4e0c04b90049eee7e588e.jpg) +Figure 8: Loss specific artifacts: Each row shows artifacts when training without a specific loss. Top: without shape loss. Middle: without pose loss. Bottom: without appearance loss. From left to right: source image, reference image in the target pose, generated without the corresponding loss, and SPICE, respectively. + +the Sup. Mat. Video illustrate such loss-specific artifacts. Discussions and limitations: While the DeepFashion dataset [22] provides paired data, these pairs do not always have the same outfit, as can be seen in the bottom row of Figure 7. We manually checked 500 random sampled pairs of the training data, and found that in $16\%$ of the pairs one of the images contains additional accessories or new clothes. This can be a burden for fully supervised methods. Instead, we take the extreme approach of pure self-supervision to see how far this can be pushed. For extreme pose/view changes, the solution is highly ambiguous: there is no way to know the front of an outfit from the back or vice versa. Although SPICE generates a plausible solution, the result might not match the real invisible details. A practical use case would limit the range of pose variation between source and target. SPICE requires the target im + +![](images/f78b32c42626c232b38da5d0dd839ec9dc9c204c2671a40dca989c58014bd26a.jpg) +Figure 9: Limitations: SPICE has difficulty super- resolving fine details when zooming, dealing with extreme closeups, and generating humans from clothing images without humans. + +age of a person where much of the body is in view (Fig. 9). Our model has difficulties preserving fine patterns when the camera zooms in Fig. 9. Zoom requires super-resolution which is a research topic in itself. + +# 5. Conclusion + +We have presented SPICE, a novel approach to repose clothed humans from a single image. SPICE is trained in a self-supervised fashion without paired training data by exploiting cyclic consistency. Our key insight is to use 3D body information during training in different ways to constrain the image generation. First, SPICE leverages a parametric 3D body model and a 3D body regressor to constrain body shape and pose. Second, SPICE uses the 3D body mesh to coherently segment source and generated images to enforce an occlusion-aware appearance feature consistency. Third, SPICE conditions a discriminator on colored mesh renderings to increase the quality of the generated images. Once trained, SPICE takes a single image and a target pose specified by 2D keypoints, and generates an image of the same person in the target pose. SPICE generates images that are significantly better than previous unsupervised methods, and that are similar in quality to the state-of-the-art supervised method. Additionally, SPICE can readily generate videos, although it is not trained for this task. + +Adding 3D constraints to the reposing problem enables a number of applications that go beyond the scope of this paper and belong to future work. Although we used our shape and appearance losses to keep those traits constant, they could as well be used to control the output model appearance (e.g. changing the pattern of a T-shirt) or shape (e.g. changing the body proportions of the model). + +Disclosure. While MJB is also an employee of the Max Planck Institute for Intelligent Systems (MPI-IS), this work was performed solely at Amazon where he is a part time employee. At MPI-IS he has received research gift funds from Intel, Nvidia, Adobe, Facebook, and Amazon. He has financial interests in Amazon, Datagen Technologies, and Meshcapade GmbH. + +# References + +[1] Object keypoints similarity. https://cocodataset.org/#keypoints-eval.7 +[2] Guha Balakrishnan, Amy Zhao, Adrian V Dalca, Fredo Durand, and John Guttag. Synthesizing images of humans in unseen poses. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8340-8348, 2018. 2 +[3] Federica Bogo, Angjoo Kanazawa, Christoph Lassner, Peter Gehler, Javier Romero, and Michael J. Black. Keep it SMPL: Automatic estimation of 3D human pose and shape from a single image. In European Conference on Computer Vision (ECCV), Lecture Notes in Computer Science. Springer International Publishing, Oct. 2016. 3, 5 +[4] Z. Cao, G. Hidalgo Martinez, T. Simon, S. Wei, and Y. A. Sheikh. Openpose: Realtime multi-person 2d pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2019. 3 +[5] Haoye Dong, Xiaodan Liang, Ke Gong, Hanjiang Lai, Jia Zhu, and Jian Yin. Soft-gated warping-gan for pose-guided person image synthesis. In Advances in Neural Information Processing Systems (NeurIPS), pages 474-484, 2018. 2, 3 +[6] Haoye Dong, Xiaodan Liang, Yixuan Zhang, Xujie Zhang, Xiaohui Shen, Zhenyu Xie, Bowen Wu, and Jian Yin. Fashion editing with adversarial parsing learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1, 2 +[7] Patrick Esser, Ekaterina Sutter, and Björn Ommer. A variational u-net for conditional appearance and shape generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8857-8866, 2018. 2, 3, 6, 7 +[8] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems (NeurIPS), pages 2672–2680, 2014. 2 +[9] Artur Grigorev, Artem Sevastopolsky, Alexander Vakhitov, and Victor Lempitsky. Coordinate-based texture inpainting for pose-guided human image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12135-12144, 2019. 2 +[10] Riza Alp Güler, Natalia Neverova, and Iasonas Kokkinos. Densepose: Dense human pose estimation in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7297-7306, 2018. 3 +[11] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 2961-2969, 2017. 7 +[12] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems (NeurIPS), pages 6626-6637, 2017. 6, 7 +[13] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on + +Computer Vision and Pattern Recognition (CVPR), 2017. 2 +[14] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision (ECCV), pages 694–711. Springer, 2016. 4 +[15] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4401-4410, 2019. 2 +[16] Markus Knoche, István Sárándi, and Bastian Leibe. Reposing humans by warping 3d features. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 1044-1045, 2020. 1, 2, 3 +[17] Nikos Kolotouros, Georgios Pavlakos, Michael J. Black, and Kostas Daniilidis. Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019. 5 +[18] Nikos Kolotouros, Georgios Pavlakos, Michael J. Black, and Kostas Daniilidis. Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), October 2019. 7 +[19] Mohamed Ilyes Lakhal, Oswald Lanz, and Andrea Cavallaro. Pose guided human image synthesis by view disentanglement and enhanced weighting loss. In European Conference on Computer Vision (ECCV), pages 380-394. Springer, 2018. 2 +[20] Yining Li, Chen Huang, and Chen Change Loy. Dense intrinsic appearance flow for human pose transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3693-3702, 2019. 2, 3, 6, 7 +[21] Wen Liu, Zhixin Piao, Jie Min, Wenhan Luo, Lin Ma, and Shenghua Gao. Liquid warping gan: A unified framework for human motion imitation, appearance transfer and novel view synthesis. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 5904-5913, 2019. 2 +[22] Ziwei Liu, Ping Luo, Shi Qiu, Xiaogang Wang, and Xiaou Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 1, 2, 6, 7, 8 +[23] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black. SMPL: A skinned multiperson linear model. ACM Transactions on Graphics, (Proc. SIGGRAPH Asia), 34(6):248:1-248:16, Oct. 2015. 2, 3, 5 +[24] Liqian Ma, Xu Jia, Qianru Sun, Bernt Schiele, Tinne Tuytelaars, and Luc Van Gool. Pose guided person image generation. In Advances in Neural Information Processing Systems (NeurIPS), pages 406-416, 2017. 2, 3 +[25] Liqian Ma, Zhe Lin, Connelly Barnes, Alexei A Efros, and Jingwan Lu. Unselfie: Translating selfies to neutral-pose portraits in the wild, 2020. 2 +[26] Liqian Ma, Qianru Sun, Stamatios Georgoulis, Luc Van Gool, Bernt Schiele, and Mario Fritz. Disentangled person image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 99-108, 2018. 2, 3, 6, 7 + +[27] Yifang Men, Yiming Mao, Yuning Jiang, Wei-Ying Ma, and Zhouhui Lian. Controllable person image synthesis with attribute-decomposed gan. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5084-5093, 2020. 2, 6, 7 +[28] Natalia Neverova, Riza Alp Guler, and Iasonas Kokkinos. Dense pose transfer. In European Conference on Computer Vision (ECCV), pages 123-138, 2018. 2 +[29] Gaurav Parmar, Richard Zhang, and Jun-Yan Zhu. On buggy resizing libraries and surprising subtleties in fid calculation. arXiv preprint arXiv:2104.11222, 2021. 7 +[30] Albert Pumarola, Antonio Agudo, Alberto Sanfeliu, and Francesc Moreno-Noguer. Unsupervised person image synthesis in arbitrary poses. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8620-8628, 2018. 2, 3 +[31] Yurui Ren, Xiaoming Yu, Junming Chen, Thomas H. Li, and Ge Li. Deep image spatial transformation for person image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1, 2, 3, 4, 6, 7 +[32] Kripasindhu Sarkar, Dushyant Mehta, Weipeng Xu, Vladislav Golyanik, and Christian Theobalt. Neural re- rendering of humans from a single image. In European Con- ference on Computer Vision (ECCV), 2020. 2, 3, 6 +[33] Haoyue Shi, Le Wang, Wei Tang, Nanning Zheng, and Gang Hua. Loss functions for person image generation. In Proceedings of the British Machine Vision Conference (BMVC), 2020. 1, 3 +[34] Aliaksandr Siarohin, Stephane Lathuilière, Enver Sangineto, and Nicu Sebe. Appearance and pose-conditioned human image generation using deformable gans. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2019. 2 +[35] Aliaksandr Siarohin, Enver Sangineto, Stéphane Lathuiliere, and Nicu Sebe. Deformable gans for pose-based human image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3408-3416, 2018. 3, 6, 7 +[36] Aliaksandr Siarohin, Enver Sangineto, Stéphane Lathuilière, and Nicu Sebe. Deformable gans for pose-based human image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 2 +[37] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations (ICLR), 2015. 4, 5, 6 +[38] Sijie Song, Wei Zhang, Jiaying Liu, and Tao Mei. Unsupervised person image generation with semantic parsing transformation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2, 3, 6, 7 +[39] Hao Tang, Song Bai, Li Zhang, Philip HS Torr, and Nicu + +Sebe. Xinggan for person image generation. In European Conference on Computer Vision (ECCV), 2020. 2, 3 +[40] Jilin Tang, Yi Yuan, Tianjia Shao, Yong Liu, Mengmeng Wang, and Kun Zhou. Structure-aware person image generation with pose decomposition and semantic correlation. In AAAI Conference on Artificial Intelligence (AAAI), 2021. +[41] Ceyuan Yang, Zhe Wang, Xinge Zhu, Chen Huang, Jianping Shi, and Dahua Lin. Pose guided human video generation. In European Conference on Computer Vision (ECCV), pages 201-216, 2018. 2 +[42] Hongtao Yang, Tong Zhang, Wenbing Huang, Xuming He, and Fatih Porikli. Towards purely unsupervised disentanglement of appearance and shape for person images generation. In Proceedings of the 1st International Workshop on Human-centric Multimedia Analysis, pages 33-41, 2020. 1, 2, 3 +[43] Lingbo Yang, Pan Wang, Chang Liu, Zhanning Gao, Peiran Ren, Xinfeng Zhang, Shanshe Wang, Siwei Ma, Xiansheng Hua, and Wen Gao. Towards fine-grained human pose transfer with detail replenishing network. IEEE Transactions on Image Processing, 30:2422-2435, 2021. 2 +[44] Polina Zablotskaia, Aliaksandr Siarohin, Bo Zhao, and Leonid Sigal. Dwnet: Dense warp-based network for pose-guided human video generation. Proceedings of the British Machine Vision Conference (BMVC), 2019. 2, 6 +[45] Mihai Zanfir, Elisabeta Oneata, Alin-Ionut Popa, Andrei Zanfir, and Cristian Sminchisescu. Human synthesis and scene compositing. In AAAI Conference on Artificial Intelligence (AAAI), volume 34, pages 12749-12756, 2020. 2 +[46] Pan Zhang, Bo Zhang, Dong Chen, Lu Yuan, and Fang Wen. Cross-domain correspondence learning for exemplar-based image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5143-5153, 2020. 6, 7 +[47] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 7 +[48] Yi Zhou, Connelly Barnes, Jingwan Lu, Jimei Yang, and Hao Li. On the continuity of rotation representations in neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5745-5753, 2019. 7 +[49] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networkss. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017. 2, 3 +[50] Zhen Zhu, Tengteng Huang, Baoguang Shi, Miao Yu, Bofei Wang, and Xiang Bai. Progressive pose attention transfer for person image generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2347-2356, 2019. 2, 3, 6, 7 \ No newline at end of file diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/images.zip b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..178481967e0f61886da03c18f50d6a44f95dd8d6 --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae1df72f0efaccc677166c642555eb1d523354b439127d68649fc100f69166cc +size 508896 diff --git a/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/layout.json b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..92bb9dc28f01ef2db9a9959378a5c22f18bfd5f1 --- /dev/null +++ b/learningrealistichumanreposingusingcyclicselfsupervisionwith3dshapeposeandappearanceconsistency/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10a158f54461f0c09bc4e4b1377a4e1d7aaddd3b942518f53ac7dae1a04ef39e +size 432152 diff --git a/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_content_list.json b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..49b3dec9089c56c7615298bfcfda1e65a0cd538f --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29efed6252c8c8ec6e92939f87c8705ab9c9dfe9f490b0efdf36488e40b98b86 +size 83512 diff --git a/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_model.json b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a140ea52b118a4ca2dfea0bd783bd88b4c59628a --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bedef1f072d84a0c8e490052d286ee366be5b284fce32c08537dfbd6485867 +size 105434 diff --git a/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_origin.pdf b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..31fdb4904f475a8f5aa96b07ea1365243a8371fb --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/17095617-a9b0-40e2-8a20-08e681fe7017_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a14ed5e9d3ef4f1b5aa4e0ad0b01e580a178ff55fe132fd8c1ce2746a97bf55b +size 3207460 diff --git a/learningselfconsistencyfordeepfakedetection/full.md b/learningselfconsistencyfordeepfakedetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..44a4237b9f2ef5165215a7a3250d25c4a7fdc468 --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/full.md @@ -0,0 +1,321 @@ +# Learning Self-Consistency for Deepfake Detection + +Tianchen Zhao* Xiang Xu Mingze Xu Hui Ding Yuanjun Xiong Wei Xia Amazon/AWS AI + +ericolon@umich.edu, {xiangx,xumingze,huidin,yuanjx,wxia}@amazon.com + +# Abstract + +We propose a new method to detect deepfake images using the cue of the source feature inconsistency within the forged images. It is based on the hypothesis that images' distinct source features can be preserved and extracted after going through state-of-the-art deepfake generation processes. We introduce a novel representation learning approach, called pair-wise self-consistency learning (PCL), for training ConvNets to extract these source features and detect deepfake images. It is accompanied by a new image synthesis approach, called inconsistency image generator (I2G), to provide richly annotated training data for PCL. Experimental results on seven popular datasets show that our models improve averaged AUC over the state of the art from $96.45\%$ to $98.05\%$ in the in-dataset evaluation and from $86.03\%$ to $92.18\%$ in the cross-dataset evaluation. + +# 1. Introduction + +Deepfakes are synthetic media in which the identity or expression of a target subject is replaced by that of another source subject. They are predominantly generated by image stitching, which includes face detection, warping, and blending. Attacks using deepfakes have caused a significant amount of negative social impact, and also motivated methods to detect these forged videos. Most of these defense methods [60, 26, 37, 51, 46, 5, 23, 21, 6] target detecting suspicious artifacts left in the stitching process, such as eye blinking [26], face warping [27], blending boundaries [23], and fake prototypes [48]. In the wake of these defenders, forgery techniques are also evolving on reducing these artifacts to avoid detection, forming an enduring arms race. + +In this paper, we propose a new method to detect deep-fakes generated by stitching-based methods. Unlike other methods focusing on detecting artifacts described above, our approach uses the cue of inconsistency of source features within the forged images. Conceptually, images carry + +![](images/ffff289f58169c2ed61d682a05096a52dfb06c8a94363e5b289cbe206710a5c1.jpg) +Figure 1: The forged image is generated by stitching target and source images. We hypothesize that each of them carries distinct source features that can uniquely identify their sources. Therefore, the forged image contains different source features at different locations, whereas those of a pristine image must be consistent across all positions. By extracting the local source features and measuring their self-consistency, we can detect forged images. + +![](images/9195668b3d84b55118f2d9e01928c905342a2b1cc3ee47fd0438e0cc9cb14477.jpg) + +![](images/b7f74a63b12139655ae6cc4a4bd452925434d02eee4ee99f10a95c318e38e7d4.jpg) + +content-independent [14], spatially-local information that can uniquely identify their sources. We call them the source features. They could come from either imaging pipelines (e.g., PRNU noise [30], specifications [14]), encoding approaches (e.g., JPEG compression patterns [1], compression rates) or image synthesis models [58]. We hypothesize that these source features are still preserved after the modified image having gone through the state-of-the-art deepfake generation processes [28, 8, 15, 22, 39, 35]. Therefore, a forged image would contain different source features at different positions, whereas those of a pristine image must be consistent across all positions. By extracting the local source features and measuring their self-consistency, we can detect forged images. + +Specifically, we use a convolutional neural network (ConvNet) to extract source features in the form of downsampled feature maps. Each feature vector represents the source features of a corresponding location in the input image. To train this ConvNet, we introduce a novel representation learning method, called pair-wise self-consistency learning (PCL), which uses the consistency loss for supervision. We calculate the cosine similarity between very pairs of feature vectors in the source feature map, and compute the consistency loss on all pairs according to whether their + +corresponding image locations come from the same source image. That is, we penalize the pairs that refer to locations from the same source image for having a low-similarity score and those from different source images for having a high-similarity score. We attach a non-linear binary classifier on the learned source feature map to perform the deep-fake detection. We train it with an additional loss to produce the image-level real vs. fake labels. + +The consistency loss in PCL needs pixel-level annotation about whether a location has been modified. It is generally not available in deepfake detection datasets, on which the re-annotation could be laborious and error-prone. We use synthesized data generated from inconsistency image generator (I2G) to tackle this issue. It generates forged images following the latest techniques in deepfake generation methods. To save computational cost and enable online generation, I2G only stitches together pristine source and target images instead of the synthesized ones from deep networks. We randomly sample the forgery mask for stitching during generation, which becomes the pixel-level annotation we need for PCL. Experimental results show that, although using a simplified generation process, the models learned with synthesized data from I2G effectively extract discriminative source features in both pristine and deepfake images. + +We evaluate PCL on seven recent deepfake detection datasets and observe superior detection accuracy. Following the in-dataset evaluation, our method achieves the AUC scores of $99.79\%$ , $99.98\%$ , and $94.38\%$ on $\mathrm{FF}++$ , CD2, and DFDC-P datasets, respectively. Because PCL uses the cue of source feature inconsistency which is less taken care of by current deepfake generation methods, we conjecture that a model trained with PCL on one dataset could effectively detect deepfakes generated by methods not seen in this dataset. To verify this, we adopt the cross-dataset evaluation protocol introduced in [23] to test our models and observe affirmative results. We achieve the AUC scores of $99.11\%$ , $99.07\%$ , $99.41\%$ , $98.30\%$ , and $90.03\%$ on $\mathrm{FF}++$ , DFD, DFR, CD1, and CD2 datasets, respectively. We further visualize the consistency map of the learned source features on both real and fake images. We observe the consistency maps can lead to localization of the modified region. + +It is worth noting that, as the race between forgers and defenders continues, the cue of source feature inconsistency can be negated. It can be done by either using entire face synthesis techniques [17, 29, 4] that directly output the whole fake image, such as GAN, or future development of stitching methods that completely removes or ambiguates the source feature. However, the state-of-the-art deepfake generation methods have not yet adopted these techniques. Thus the effectiveness of our method on detecting deepfake images should only be evaluated on the images generated by existing deepfake detection methods, as depicted in deepfake detection datasets we used [41, 10, 28, 8, 9, 15]. + +# 2. Related Work + +Deepfake Generation. There are four common types of deepfake [47]: entire image synthesis, modification of facial attribute or expression, and face identity swap. 3D models [44], AutoEncoders [43, 49], or Generative Adversarial Networks [16, 17, 29, 4] are used to generate the fake image segment, which is then blended back to the original image. + +Deepfake Detection. To detect the whole image synthesis, recent research [58, 36, 13, 52] observes that GAN-generated images contain specific cues that can be easily detected, and the trained models have exhibited good generalization ability across different synthesis methods. To support the research on detecting the other types of face manipulations, several deepfake datasets are released [57, 19, 41, 10, 28, 8, 15, 61] and countermeasures have been introduced. FakeSpotter [51] is proposed with a layer-wise neuron behavior for fake face detection. Recurrent neural networks [42] and various types of 3D ConvNets [6] are utilized to detect the manipulation artifacts across the video frames. However, binary classifiers are criticized for their interpretability, and several localization methods are introduced through either multi-task learning [37] or attention-based mechanisms [5, 59]. To improve the generalization ability, DSP-FWA [27] and Face X-ray [23] also make their data generation pipeline and the latter focuses on predicting the blending boundaries in fake video frames. + +Our approach also lies in this line but has several key differences. First, from the methodology perspective, we focus on detecting deepfakes by using a less attended cue of inconsistency of source features within the forged images. Second, from the network design perspective, our consistency predictor only contains a few parameters and can serve as a plugin module upon any common backbones. + +Consistency Learning. The concept of inconsistency has been studied in the image forensic literature [34], where similarity scores are computed among image patches [34, 33, 14, 32, 60, 2]. Zhou et al. [60] propose a two-stream network to detect both tampered faces and low-level inconsistencies, but the training requires steganalysis feature extraction. Huh et al. [14] use a Siamese network to predict the metadata inconsistency by iteratively comparing random patches from different raw images. Nirkin et al. [38] use signals from the proposed face identification and context recognition networks to detect deepfakes. + +In this paper, we introduce consistency learning to deepfake detection and propose an end-to-end learning architecture that estimates the image self-consistency with one forward pass, while capturing the internal relations among patches within an image. Besides, instead of using only raw images, we design I2G to address several challenges to fit face forgery detection better by supplying PCL with training images that are finely stitched from multiple sources. + +![](images/195475b474668a1884d7b17ed7fa97d6d1c0757d10f32b271bca7224a3629562.jpg) +Figure 2: Visualization of PCL architecture. The consistency branch focuses on measuring the consistencies of image patches according to their source features. A classification branch is applied after the source feature map and predicts the binary score for deepfake detection. + +# 3. Our Approach + +Given an input image, our goal is to detect if the identity or expression of the subject is replaced with that of another subject. Observing that deepfakes are stitched by images from different sources with distinct source features, we explore learning effective and robust representations for deepfake detection by measuring the source feature consistency within the image. More specifically, we propose a multitask learning architecture, as shown in Fig. 2. The consistency branch is optimized to predict a consistency map for each image patch, indicating its source feature consistencies with all others. The classification branch is applied to the source features and outputs binary labels for evaluation purposes. The model is trained on both consistency and classification loss, with annotations supplied by I2G. + +# 3.1. Pair-Wise Self-Consistency Learning (PCL) + +The consistency branch computes the pairwise similarity scores of all possible pairs of local patches in an image and predicts a 4D consistency volume $\widehat{\mathbf{V}}$ . Given a pre-processed video frame $X$ of size $H\times W\times 3$ as input, we first feed it into the backbone and extract the source feature $F$ of size $H^{\prime}\times W^{\prime}\times C$ from an intermediate convolution layer, where $H^{\prime},W^{\prime}$ , and $C$ are height, width, and channel size, respectively. For each patch $\mathcal{P}_{h,w}$ in the source feature map, we compare it against all the rest to measure their feature similarities, and obtain a 2D consistency map $\widehat{M}^{\mathcal{P}_{h,w}}$ of size $H^{\prime}\times W^{\prime}$ of consistency scores in the range of [0, 1], where the superscript indicates the position of the base patch. To be specific, for any pair of patches $\mathcal{P}_i$ and $\mathcal{P}_j$ , we compute their dot-product similarity [53] using their extracted feature vector $f_{i}$ and $f_{j}$ , both of size $C$ , to estimate their consistency score: + +$$ +s \left(f _ {i}, f _ {j}\right) = \sigma \left(\frac {\theta \left(f _ {i}\right) \theta \left(f _ {j}\right)}{\sqrt {C ^ {\prime}}}\right), \tag {1} +$$ + +where $\theta$ is the embedding function, realized by $1 \times 1$ convolutions, $C'$ is the embedding dimension, and $\sigma$ is the Sigmoid function. We iterate this process over all patches $\{\mathcal{P}_{h,w}|1 \leq h \leq H', 1 \leq w \leq W'\}$ in the source feature map, and finally get the 4D consistency volume $\widehat{\mathbf{V}}$ of size $H' \times W' \times H' \times W'$ . To provide visualization clues about the region of modification, we fuse the 4D consistency volume $\widehat{\mathbf{V}}$ over all patches and generate a 2D global heatmap $\widehat{\mathcal{M}}$ of size $H' \times W'$ (described in the Appendix). We up-sample $\widehat{\mathcal{M}}$ to $\widehat{\mathcal{M}}$ of size $H \times W$ to match the input size for visualization. + +The optimization of consistency branch requires the 4D "ground truth" consistency volume $\mathbf{V}$ . Given the mask $\mathcal{M}$ of size $H\times W$ indicating the manipulated region of input $X$ , we first create its coarse version $\mathcal{M}$ matching the size of $H^{\prime}\times W^{\prime}$ through bi-linear down-sampling. We obtain the ground truth 2D consistency map $M^{\mathcal{P}_{h,w}}$ for the $(h,w)$ -th patch by computing the element-wise difference between its own value $\mathcal{M}_{h,w}$ and all others, + +$$ +M ^ {\mathcal {P} _ {h, w}} = 1 - \left| \mathcal {M} _ {h, w} - \mathcal {M} \right|, \tag {2} +$$ + +where $\mathcal{M}_{h,w}$ is the scalar value in position $(h,w)$ , and $M^{\mathcal{P}_{h,w}}$ is in size of $H' \times W'$ . For each entry of $M^{\mathcal{P}_{h,w}}$ , a value close to 1 denotes the two patches are consistent, and close to 0 otherwise. To obtain the ground truth 4D global map $\mathbf{V}$ , we compute $M^{\mathcal{P}_{h,w}}$ for all patches. Note that $\mathbf{V}$ of a pristine image should be $\mathbf{1}$ , a 4D volume in which all values are equal or close to one. + +We use the binary cross-entropy (BCE) loss to supervise the consistency prediction over the 4D consistency volume $\widehat{\mathbf{V}}$ , and more formally, + +$$ +\mathcal {L} _ {P C L} = \frac {1}{N} \sum_ {h, w, h ^ {\prime}, w ^ {\prime}} \mathrm {B C E} \left(\mathbf {V} _ {h, w, h ^ {\prime}, w ^ {\prime}}, \widehat {\mathbf {V}} _ {h, w, h ^ {\prime}, w ^ {\prime}}\right), \tag {3} +$$ + +where $h$ and $h^\prime \in \{1,2,\dots,H^\prime \}$ , $w$ and $w^{\prime}\in \{1,2,\dots,W^{\prime}\}$ and $N$ equals to $H^{\prime}\times W^{\prime}\times H^{\prime}\times W^{\prime}$ . + +The consistency branch learns the representations that predict the self-consistency of the input according to their source features, which by our claim could significantly benefit the deepfake detection in both effectiveness and robustness. Nevertheless, these features cannot directly make inferences for evaluation purposes. + +The classification branch is thus applied after the source feature map to predict if the input is real or fake. More specifically, the extracted source feature is fed into another convolution operation. A global average pooling and fully-connected layer are built after that as the classifier, which outputs the probability score for the input of being real or fake. We use the two-class cross-entropy (CE) loss $\mathcal{L}_{CLS}$ to supervise the training in the classification branch. + +The overall loss function of our model is as follows: + +$$ +\mathcal {L} = \lambda \mathcal {L} _ {P C L} + \mathcal {L} _ {C L S}, \tag {4} +$$ + +with hyper-parameter $\lambda$ . The ablation study in Section 4.5 suggests that a choice of large $\lambda$ value significantly improves the performance. This observation demonstrates that the representations learned from the consistency branch play a dominant role in the success. + +# 3.2. Inconsistency Image Generator (I2G) + +Training PCL requires patch-level annotations of the manipulated regions, which is not always available in current existing datasets. To provide this training data, we propose inconsistency image generator (I2G) to generate "self-inconsistent" images from the pristine ones, along with the ground truth masks $\mathcal{M}$ discussed in Section 3.1. To guarantee sufficient amount and diversity of the training data with least efforts, I2G reduces the computational cost by replacing facial image synthesis using the GAN or VAE [28, 8, 15, 22] with real images. It follows that I2G can support dynamic data generation on CPU during the training and be utilized as a part of the data augmentation for deepfake detection. + +Similar self-supervised approaches [27, 23, 35, 8] have been studied in other tasks or methods for deepfake detection. I2G particularly addresses several challenges to fit PCL better. First, because face images have some strong structural bias, stitching with the face hull regions may create undesired correlations between the source feature inconsistency and the face boundary. I2G uses elastic deformation [40] to improve the variety of the mask $\mathcal{M}$ and thereby eliminates those spurious correlations. Second, because attackers will intentionally try to remove source features to make deepfake images more realistic, PCL needs to make use of source features that are not vulnerable to these approaches. I2G randomly selects one from an exhaustive set of blending methods in data generation so the representation learned by PCL can be robust to source feature removal at + +![](images/8cef0de9ffaa3716523bdffc6ac43dfbe6b3d549a68ad0d32aabc9eac09927c9.jpg) +Target Image + +![](images/de17a156c8b8a1b1e43926419a14867f8bf24a2ca851f2044561fbf96591f2ac.jpg) +Source Image +Figure 3: Illustration of the workflow of $I2G$ . For each source and target image pair, a morphed mask is generated by taking a convex hull of the landmarks followed by elastic deformation and Gaussian blur. The masked region of the target image is replaced by that of the source with blending techniques [39, 35]. + +![](images/d1068834909c8fe08703ea235f16c4b85eef97c8f8ee7f666b9280c8ab0ab52e.jpg) +Alignment Adjustment + +![](images/ff1d6f6cbc0d65c69727fcbc5fb78f220c2ddb21c6a739ae3d074550b060df1e.jpg) +Landmarks Convex Hull + +![](images/eeed51cba556a1c6c36a1977fddff3ce9140500108fc16fd8a5df33d9bfcdc24.jpg) + +adjustment + +![](images/a1b961096e67d75a8ee8abb95a9fd86c26b538da55a29cc7785036041bc12238.jpg) +Elastic Deformation + +![](images/c1863ee50c59685ff34e340e13c119d3b078b3c710737990225bc4f6bd32246c.jpg) +Forged Image + +![](images/68b1b8c2ad8e2a129c31aaa9f5e078f0b9859ab684a0bf8ae0e30e4d35f0f148.jpg) +Blurred Mask + +# Algorithm 1 Inconsistency Image Generator (I2G) + +Input: Target video frame $X^t$ of size $(H,W,3)$ . + +Output: Generated video frame $X^g$ and mask $\mathcal{M}$ + +Landmark Detector $\mathcal{K}:\mathbb{R}^{H\times W\times 3}\to \mathbb{R}^{68\times 2}$ + +1: Get the video frame $X^t$ and its landmarks $\mathcal{K}(X^t)$ . +2: Find a random source frame $X^s$ of different ID, which satisfies $\| \mathcal{K}(X^t) - \mathcal{K}(X^s)\| _2 < \epsilon$ for threshold $\epsilon >0$ . +3: Align $X^s$ to $X^t$ using landmarks. +4: Compute convex hull $\mathcal{H}$ of $\mathcal{K}(X^t)$ . +5: Get mask $\mathcal{M}$ by elastic deforming and blurring $\mathcal{H}$ . +6: Get $X^g$ by blending $X^t$ with $X^s$ with $\mathcal{M}$ . + +tempts. Third, we expect the learned representation to generalize to a wide range of sources, even unseen ones during training. I2G adds image augmentation to the generation process to achieve this goal. The augmentation methods include JPEG compression, Gaussian noise/blur, brightness contrast, random erasing, and color jittering. + +The workflow of I2G is summarized in Alg. 1 and illustrated in Fig. 3. Given a target video frame $X^t$ , we take its 68-point facial landmarks and retrieve another frame from different videos with different identities, so that the faces in the two frames have similar landmarks measured in $\ell_2$ norm. For a pair of images, we first align their faces with the pre-computed landmarks and then detect the facial region by taking the convex hull of the landmarks. Elastic deformation [40] is also employed to morph the convex hull: we generate the smooth deformations using random displacement vectors sampled from a Gaussian distribution with a standard deviation of 6 to 12 pixels on a coarse 4 by 4 grid, and compute per-pixel displacements using bi-cubic interpolation. The deformed mask is further blurred by a Gaussian kernel of size 16. Finally, the facial region of the source frame within the mask is stitched to the target frame using various blending methods [39, 35]. I2G outputs a forged video frame and the corresponding mask $\mathcal{M}$ . + +# 4. Experiments + +We evaluated the performance of our approach (PCL + I2G) against multiple state-of-the-art methods on seven publicly-available datasets. First, we showed that our model achieves convincing performance under the in-dataset setting, where training and testing are conducted on the same dataset. To demonstrate the superior generalization ability of our model, we conducted the cross-dataset evaluation by training the model with only I2G-augmented real videos and testing on unseen datasets. The ablation studies explored the contribution of each component in our model, such as the effect of PCL and I2G. + +# 4.1. Implementation Details + +Pre-processing. For each raw video frame, face crops are detected and tracked by using [24] and landmarks are detected by public toolbox [3]. We normalize all face crops with ImageNet mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225], and resize them to $256 \times 256$ . We also use standard data augmentations, including JPEG compression, Gaussian noise/blur, brightness contrast, random erasing, and color jittering. + +Network Architecture. We adopt ResNet-34 [12] as backbone and initialized with pretrained weights on ImageNet [7]. Given a pre-processed video frame $X$ of size $H \times W \times 3$ , we first feed it into the backbone and extract the features $F$ after the conv3 layer of size $H' \times W' \times 256$ , where $H' = H / 16$ and $W' = W / 16$ . Here each patch corresponds to a $16 \times 16$ region in the original image. + +Training. For each epoch, we randomly sample 32 frames from every video, and the total number of training samples from $K$ videos is $32 \times K$ . The model is trained for 150 epochs using Adam optimizer [18] with batch size 128, betas 0.9 and 0.999, and epsilon $10^{-8}$ . The learning rate is linearly increased from 0 to $5 \times 10^{-5}$ in the first quarter of the training iterations and is decayed to zero in the last quarter. The hyper-parameter $\lambda$ is set to be 10 by default. + +# 4.2. Settings + +Training Data. Each of our training samples is of the form $(X, \mathbf{V}, y)$ , where $X$ is the input video frame, $\mathbf{V}$ is the ground truth 4D consistency volume, and $y$ is the binary label. For a real frame, $\mathbf{V}$ is a 4D tensor of ones, indicating the image is self-consistent, and $y$ is zero. There are two types of forged samples in our settings. The first type is the deepfake video frame from the existing deepfake datasets, for which we find the corresponding real video frame and compute the structural dissimilarity (DSSIM) [55] between them. The mask $\mathcal{M}$ is then generated by taking a Gaussian blur of DSSIM followed by thresholding. $\mathbf{V}$ is computed from $\mathcal{M}$ by Eq. 2 and $y$ is one. The second type is the fake image augmented by I2G on real images, where $\mathbf{V}$ is computed with the mask + +from I2G and $y$ is one. By training with I2G-augmented datasets, whenever a real data $(X^t,\mathbf{1},0)$ is sampled during the training, there is a $50\%$ chance that it is dynamically transformed by I2G into a fake data $(X^{g},\mathbf{V},1)$ where $X^{g}$ and $\mathcal{M}$ are the outputs of I2G as described in Alg. 1 and $\mathbf{V}$ is computed with $\mathcal{M}$ by Eq. 2. + +More specifically, in the in-dataset experiments, our train set includes both the pristine and deepfake videos from the train split of the dataset (to be evaluated). Unless otherwise noted, we also utilize the fake samples augmented by I2G as data augmentation. In the cross-dataset experiments, we follow prior work [23] and train with only real videos from the raw version of FaceForensics++ $(\mathrm{FF}++)$ [41], augmented by I2G. Note that the cross-dataset setting is more close to the real-world scenarios where the potential attack types are not aware. + +Test Data. FaceForensics++ (FF++) [41] is by far the most popular benchmark for deepfake detection. Its raw version contains 700 videos for testing, including 140 pristine and 560 fake videos from 4 different algorithms, which are Deepfakes (DF) [11], Face2Face (F2F) [44], FaceSwap (FS) [20] and NeuralTextures (NT) [45]. DeepfakeDetection (DFD) [10] dataset is released incorporated with FF++, supporting the deepfake detection research. Celeb-DF-v1 (CD1) & -v2 (CD2) [28] datasets consist of high-quality forged celebrity videos using advanced synthesis process. Deepfake Detection Challenge (DFDC) [8] public test set is released for the Deepfake Detection Challenge, and DFDC Preview (DFDC-P) [9] is its preliminary version. DFDC and DFDC-P contain many extremely low-quality videos, making them exceptionally challenging. DeeperForensics-1.0 (DFR) [15] modifies the pristine videos in FF++ with new face IDs and more advanced techniques. More detailed statistics are provided in the Appendix. + +Evaluation Metrics. We report the deepfake detection results with the most commonly used metrics in the literature, including the area under the ROC curve (AUC) and average precision (AP). A higher AUC or AP value indicates better performance. To provide a comprehensive benchmark for future work, we report our performance on all datasets in terms of AUC, AP, as well as Equal Error Rate (EER) in the Appendix. Unless otherwise noted, the evaluation results in the experiments are at video-level, computed by averaging the classification scores of the video frames. + +# 4.3. In-Dataset Evaluation + +In-dataset evaluation is abundantly adopted in the literature, where the focus is on specialization but not generalization. To compare against the existing work, we consider three of the most popular datasets, which are $\mathrm{FF}++$ , CD2, and DFDC-P. Given a dataset, our model is trained on both real and deepfake data from train split, and performance is + +
MethodBackboneTrain SetTest Set (AUC (%))
DFF2FFSNTFF++
MIL [54]XceptionFF++99.5198.5994.8697.9697.73
Fakespotter [51]ResNet-50FF++, CD2, DFDC----98.50
XN-avg [41]XceptionFF++99.3899.5399.3697.2998.89
Face X-ray [23]HRNetFF++99.1299.3199.0999.2799.20
S-MIL-T [25]XceptionFF++99.8499.3499.6198.8599.41
PCL + I2GResNet-34FF++100.0099.57100.0099.5899.79
+ +Table 1: In-dataset evaluation results on ${FF} + +$ . Our method performs better on all manipulation types with a smaller backbone. + +
MethodBackboneTrain SetTest Set (AUC (%))
CD2
Fakespotter [51]ResNet-50CD266.80
Tolosana et al. [46]XceptionCD283.60
S-MIL-T [25]XceptionCD298.84
PCL + I2GResNet-34CD299.98
+ +Table 2: In-dataset evaluation results on CD2. We achieve saturated performance in terms of AUC. + +
MethodBackboneTrain SetTest Set (AUC (%))
DFDC-P
Tolosana et al. [46]XceptionDFDC-P91.10
S-MIL-T [25]XceptionDFDC-P85.11
PCL + I2GResNet-34DFDC-P94.38
+ +Table 3: In-dataset evaluation results on DFDC-P. Our method improves the best existing result by $3.28\%$ in terms of AUC. + +evaluated with the corresponding test set. + +The results for $\mathrm{FF + + }$ , CD2, DFDC-P are shown in Table 1, Table 2, Table 3, respectively. On average, compared to the state of the art, our approach improves the AUC score on these three datasets, from $96.45\%$ to $98.05\%$ . Our models achieve the state of the art with near-perfect performance on CD2 (99.98%) and all four manipulations of $\mathrm{FF + + }$ (100.00% on DF, 99.57% on F2F, 100.00% on FS, 99.58% on NT), surpassing all existing work. For DFDC-P, our model outperforms the state-of-the-art result by $3.28\%$ in terms of AUC score. Note that the results reported for DFDC-P are comparably lower, due to the fact that a nonnegligible portion of the dataset is of extremely low quality, e.g., human faces in some videos are hardly recognizable. We also compare with prior work in terms of frame-level AUC on CD2, and outperform the state of the art [31] by $8\%$ (see Appendix for more details). + +# 4.4. Cross-Dataset Evaluation + +The generalization ability is an important indicator of the superiority of an algorithm. In the real world, the defense method cannot get any prior knowledge of the attacks. The cross-dataset evaluation is a widely-used approach to evaluate the generalization ability of an algorithm. + +Table 4 presents the cross-dataset evaluation results on + +$\mathrm{FF}++$ and DFD, where we only used the real videos of $\mathrm{FF}++$ for training. The performance of our model is on par with Face X-ray [23] on $\mathrm{FF}++$ , achieving convincing results with more than $99.00\%$ in terms of AUC. Interestingly, the performance gap between our model and Face X-ray [23] is much larger (99.07% vs. 93.47%) on DFD. It is possible that the test data of $\mathrm{FF}++$ is highly correlated with its training data, since they are very likely to be collected from the same source, whereas the correlation disappears in DFD. The results demonstrate that predicting the source feature consistency can effectively generalize across different source cues, without overfitting to any spurious correlation among data from the same generation method. + +We further evaluate our model on five more advanced datasets, as shown in Table 5. In particular, our model outperforms the state of the art on CD1 and CD2, by about $18.00\%$ and $13.00\%$ in terms of AUC, and provides pioneering cross-dataset baselines on DFR $(99.51\%)$ and DFDC $(67.52\%)$ . On DFDC-P, our performance is comparable with Face X-ray [23], where we get a lower AUC but a higher AP score, as shown in Table 6. We compute the average AUC score among five out of seven datasets (except DFR and DFDC that has no published benchmarks) and find that our model's performance outperforms the state of the art $(92.18\%$ vs. $86.03\%)$ . Meanwhile, we observe that both our model and state-of-art-art methods cannot achieve appealing results on DFDC/DFDC-P datasets, which motivates us to do failure analysis in Section 4.7 and 4.6. + +# 4.5. Ablation Studies + +Effect of PCL. We use $\lambda$ to balance between the consistency and classification losses, as shown in Eq. 4. By setting $\lambda = 0$ , we disable PCL and get a network architecture equivalent to vanilla ResNet-34 with binary classification loss. To exhibit the advantage of our consistency loss, we train models with increasing $\lambda$ s and evaluate their cross-dataset generalizations with four test sets. As shown in Table 7, we follow the cross-dataset setting and train all models on real data of FF++ augmented by I2G and report the AUC score for performance comparison. We observe that training with $\lambda > 0$ significantly outperforms the training with $\lambda = 0$ . Especially, the performance on DFDC is im + +
MethodBackboneTrain SetTest Set (AUC (%))
DFF2FFSNTFF++DFD
Face X-ray [23]HRNetFF++ (real data)99.1798.5798.2198.1398.5293.47
PCL + I2GResNet-34FF++ (real data)100.0098.9799.8697.6399.1199.07
+ +Table 4: Cross-dataset evaluation results on $FF++$ and DFD. Our model is on par with Face X-ray [23] on $\mathrm{FF}++$ , but has better performance on DFD by $5.67\%$ in terms of AUC, with fewer network parameters. + +
MethodBackboneTrain SetTest Set (AUC (%))
DFRCD1CD2DFDCDFDC-P
Dang et al. [5]Xception + Reg.UADFV [57], DFFD [5]-71.20---
DSP-FWA [27]ResNet-50FF++--69.30--
Xception [41]XceptionFF++--73.04--
Masi et al. [31]LSTMFF++--76.65--
Face X-ray [23]HRNetFF++-80.58--80.92
PCL + I2GResNet-34FF++ (real data)99.4198.3090.0367.5274.37
+ +Table 5: Cross-dataset evaluation results on DFR, CD1, CD2, DFDC and DFDC-P datasets. Our model out-performs the state of the art on CD1 and CD2, by about $18.00\%$ and $13.00\%$ in terms of AUC, and provides pioneering cross-dataset baselines on DFR $(99.51\%)$ and DFDC $(67.52\%)$ . For DFDC-P, we have a lower AUC score but a higher AP score in comparison with the state of the art (see Table 6). + +
MethodBackboneTrain SetTest Set (AP (%))
CD1DFDC-P
Face X-ray [23]HRNetFF++73.3372.65
PCL + I2GResNet-34FF++ (real data)98.9782.94
+ +Table 6: Cross-dataset evaluation results on CD1 and DFDC-P datasets. Our models can identify the attack video more precisely. + +proved by $15.8\%$ in terms of AUC. The results validate that it is beneficial to use large $\lambda$ during training, which also suggests that PCL plays a dominant role in the success. + +Effect of I2G as Joint-Training. We have been training with the consistency loss on datasets augmented by I2G. I2G generates fake data dynamically, enhancing the training data variety, thereby improving the performance and generalization. To demonstrate the effect of I2G, we conduct ablation studies by training on either DF or DFDC-P and benchmarking on DFR, CD2, DFDC, and DFDC-P test sets. Table 8 shows that models trained on data augmented by I2G outperform the straightforward combination of routine data augmentations and blending methods used in the baseline. In particular, we train models on the DF with or without I2G, whereas the performance of the latter is improved by an average AUC score of $7.18\%$ over four test sets. The model trained with the DFDC-P train set has noticeably better performance on DFDC and DFDC-P test sets comparing to previous models, but generalizes poorly on other datasets such as DFR. I2G improves model's generalization, for example, performance on DFR is raised from $51.61\%$ to $92.25\%$ in terms of AUC, with a minor sacrifice to the performance on DFDC-P. + +Effect of I2G as Pre-Training. When even computing the + +DSSIM masks of deepfakes is not feasible, one can always use our consistency loss to pretrain the model with any real data augmented by I2G. After that, any standard training for deepfake detection or related tasks can be conducted with the whole dataset. In particular, we conducted an experiment where we first pretrained a ResNet-34 on the real data of DF augmented by I2G for consistency prediction, and finetuned with both real and fake data of DF for classification. We report the evaluation results on DFR, CD2, DFDC, DFDC-P with $99.57\%$ , $91.88\%$ , $68.95\%$ , $79.17\%$ (84.89% on average) in terms of AUC, respectively. These results are unsurprisingly lower than those of joint-training, but still significantly outperform the baseline (79.19% on average). Besides, our pretrained models may not necessarily be trained from the established deepfake datasets. I2G can be potentially applied to any face image or video datasets, such as IMDb-Face [50] and YouTube Faces [56], providing a stronger pretrained model for deepfake-related research. + +Choice of Patch Size. We evaluate the effectiveness of using different patch sizes. Conceptually, larger patches get coarser consistency maps that may reduce their efficacy on forgery detection, while smaller patches may not contain enough information of source features and induce extra computation cost. In particular, we evaluate our cross-dataset model from Table 4 with the patch size of $4 \times 4$ , $8 \times 8$ , $16 \times 16$ , and $32 \times 32$ on FF++, and get $98.32\%$ , $98.35\%$ , $99.11\%$ , and $98.74\%$ in terms of AUC, respectively. + +# 4.6. Qualitative Results + +PCL not only improves the representation learning for deepfake detection, but also can be used to generate the in + +![](images/d499f05afd92dd6159d2fa68da217739685e84b994a7f33cf62fa2c4b47c0125.jpg) +Figure 4: Visualization of the predicted consistency maps $\widehat{\mathcal{M}}$ , which try to localize the modified regions. We use the model trained with real videos of FF++ augmented by I2G in the cross-dataset, and the predictions are computed from the predicted consistency volume, as mentioned in Section 3.1. The ground truth modified regions are generated by DSSIM, as discussed in Section 4.2. + +
MethodHyper-ParameterTest Set (AUC (%))Avg
DFRCD2DFDCDFDC-P
I2Gλ = 095.1278.1851.7269.9373.74
PCL + I2Gλ = 199.186.5260.6574.1380.10
PCL + I2Gλ = 1099.4190.0367.5274.3782.83
PCL + I2Gλ = 10099.7890.9863.2274.3682.09
+ +Table 7: Ablation study on the effect of PCL on DFR, CD2, DFDC, and DFDC-P datasets. The use of large $\lambda$ significantly improves the cross-dataset performance, especially on DFDC. + +
MethodTrain SetTest Set (AUC (%))Avg
DFRCD2DFDCDFDC-P
PCLDF90.4284.5966.2675.4979.19
PCL + I2GDF99.6491.9273.0880.8386.37
PCLDFDC-P51.6182.8269.1495.5374.78
PCL + I2GDFDC-P92.2587.6571.1294.3886.35
+ +Table 8: Ablation study on the effect of I2G as joint-training on DF and DFDC-P datasets. I2G can enhance the variety of training data, thereby improving the generalization of our model. + +terpretable visualizations clues (Sec. 3.1) about the modified region. Figure 4 visualizes some examples generated by PCL along with the corresponding input images and ground truth. When feeding a real image, in most cases, the visualization is a pure blank image, indicating that the input's source features are consistent. When testing the deep-fakes, the predicted consistency map can adequately match with the ground truth. We also compute the average value of the consistency volume from real images, and get 0.9854 and 0.9866 using in- and cross-dataset models, respectively. These statistical numbers indicate that PCL predicts all entries in the consistency volume of correctly predicted samples to be consistent with high average confidence, rather than simply segmenting the full face region. We also invest + +tigate some failure cases, the inconsistencies are caught by mistake in our model, which might be caused by the lighting and unusual texture. Besides, we observe that lower quality samples lead to false-negative predictions due to either high compression or high/low exposure. + +# 4.7. Limitations + +Although our results are encouraging, our approaches still have limitations, which raise opportunities for future work. First, as the game between the forger and the detector is an arms race, one can expect the cues that any published detection method relies on to be removed with the best efforts in the near future. For example, entire face synthesis trains a generative model that directly outputs the whole image, which should be self-consistent by our hypothesis; it is unknown if PCL can handle this type of face forgery. Second, as the false prediction samples indicated, our model can be further improved on low-quality data. + +# 5. Conclusion + +We proposed pair-wise self-consistency learning (PCL) to detect face forgeries generated by stitching-based techniques and localize the manipulated regions, based on a less attended cue: the inconsistency of source features within the modified images. PCL only contains a few parameters and can serve as a plugin module upon common backbone networks. We also developed a new light-weight image synthesis method, called inconsistency image generator (I2G), to efficiently support PCL training by dynamically generating forged images along with annotations of their manipulated regions. Experimental results showed that PCL and I2G are competitive against state-of-the-art methods on seven popular datasets, providing a strong baseline for future research. + +# References + +[1] Mauro Barni, Luca Bondi, Nicolò Bonettini, Paolo Bestagini, Andrea Costanzo, Marco Maggini, Benedetta Tondi, and Stefano Tubaro. Aligned and non-aligned double jpeg detection using convolutional neural networks. Journal of Visual Communication and Image Representation, 49:153-163, 2017. +[2] Luca Bondi, Luca Baroffio, David Güera, Paolo Bestagini, Edward J Delp, and Stefano Tubaro. First steps toward camera model identification with convolutional neural networks. IEEE Signal Processing Letters, 24(3):259-263, 2016. +[3] Adrian Bulat and Georgios Tzimiropoulos. How far are we from solving the 2D & 3D face alignment problem? (and a dataset of 230,000 3D facial landmarks). In Proc. IEEE/CVF International Conference on Computer Vision, pages 1021-1030, Oct. 22-29 2017. +[4] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. StarGAN v2: Diverse image synthesis for multiple domains. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8188-8197, Jun. 14-19 2020. +[5] Hao Dang, Feng Liu, Joel Stehouwer, Xiaoming Liu, and Anil Jain. On the detection of digital face manipulation. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5781-5790, Jun 14-19 2020. +[6] Oscar de Lima, Sean Franklin, Shreshtha Basu, Blake Karwoski, and Annet George. Deepfake detection using spatiotemporal convolutional networks. arXiv:2006.14749, 2020. +[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 248-255, Jun. 20-25 2009. +[8] Brian Dolhansky, Joanna Bitton, Ben Pflaum, Jikuo Lu, Russ Howes, Menglin Wang, and Cristian Canton Ferrer. The deepfake detection challenge dataset. arXiv:2006.07397, 2020. +[9] Brian Dolhansky, Russ Howes, Ben Pflaum, Nicole Baram, and Cristian Canton Ferrer. The deepfake detection challenge (dfdc) preview dataset. arXiv:1910.08854, 2019. +[10] Nick Dufour and Andrew Gully. Contributing data to deepfake detection research, 2019. https://ai.googleblog.com/2019/09/contributing-data-to-deepfake-detection.html. +[11] FaceSwapDevs. Deepfakes, 2019. https://github.com/deepfakes/faceswap. +[12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 770-778, Jun. 26-Jul. 1 2016. +[13] Yihao Huang, Felix Juefei-Xu, Run Wang, Xiaofei Xie, Lei Ma, Jianwen Li, Weikai Miao, Yang Liu, and Geguang Pu. FakeLocator: Robust localization of GAN-based face manipulations via semantic segmentation networks with bells and whistles. arXiv:2001.09598, 2020. +[14] Minyoung Huh, Andrew Liu, Andrew Owens, and Alexei A. Efros. Fighting fake news: Image splice detection via learned self-consistency. In Proc. European Conference on + +Computer Vision, pages 101-117, Sep 8-14 2018. +[15] Liming Jiang, Ren Li, Wayne Wu, Chen Qian, and Chen Change Loy. DeeperForensics-1.0: A large-scale dataset for real-world face forgery detection. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2886–2895, Jun. 14–19 2020. +[16] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4401-4410, Jun. 16-20 2019. +[17] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. arXiv:1912.04958, 2019. +[18] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proc. International Conference on Learning Representations, 2015. +[19] Pavel Korshunov and Sebastien Marcel. DeepFakes: a new threat to face recognition? assessment and detection. arXiv:1812.08685, 2018. +[20] Marek Kowalski. FaceSwap, 2018. https://github.com/MarekKowalski/FaceSwap. +[21] Akash Kumar and Arnav Bhavsar. Detecting deepfakes with metric learning. arXiv:2003.08645, 2020. +[22] Lingzhi Li, Jianmin Bao, Hao Yang, Dong Chen, and Fang Wen. Advancing high fidelity identity swapping for forgery detection. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, Jun. 14-19 2020. +[23] Lingzhi Li, Jianmin Bao, Ting Zhang, Hao Yang, Dong Chen, Fang Wen, and Baining Guo. Face X-ray for more general face forgery detection. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5001-5010, Jun. 14-19 2020. +[24] Wei Li, Yuanjun Xiong, Shuo Yang, Siqi Deng, and Wei Xia. SMOT: Single-shot multi object tracking. arXiv:2010.16031, 2020. +[25] Xiaodan Li, Yining Lang, Yuefeng Chen, Xiaofeng Mao, Yuan He, Shuhui Wang, Hui Xue, and Quan Lu. Sharp multiple instance learning for DeepFake video detection. In Proc. ACM Multimedia, Oct. 12-16 2020. +[26] Yuezun Li, Ming-Ching Chang, and Siwei Lyu. In ictu oculi: Exposing ai created fake videos by detecting eye blinking. In Proc. International Workshop on Information Forensics and Security, 2018. +[27] Yuezun Li and Siwei Lyu. Exposing deepfake videos by detecting face warping artifacts. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Jun. 16-20 2019. +[28] Yuezun Li, Xin Yang, Pu Sun, Honggang Qi, and Siwei Lyu. Celeb-DF: A large-scale challenging dataset for deepfake forensics. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3207-3216, Jun. 14-19 2020. +[29] Ming Liu, Yukang Ding, Min Xia, Xiao Liu, Errui Ding, Wangmeng Zuo, and Shilei Wen. STGAN: A unified selective transfer network for arbitrary image attribute editing. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3673-3682, Jun. 16-20 2019. +[30] Jan Lukas, Jessica Fridrich, and Miroslav Goljan. Determining digital image origin using sensor imperfections. In Proc. + +Image and Video Communications and Processing, 2005. +[31] Iacopo Masi, Aditya Killekar, Royston Marian Mascarenhas, Shenoy Pratik Gurudatt, and Wael AbdAlmageed. Two-branch recurrent network for isolating deepfakes in videos. In Proc. European Conference on Computer Vision, Aug. 23–28 2020. +[32] Owen Mayer and Matthew C Stamm. Learned forensic source similarity for unknown camera models. In International Conference on Acoustics, Speech and Signal Processing, pages 2012-2016, 2018. +[33] Owen Mayer and Matthew C Stamm. Forensic similarity for digital images. IEEE Transactions on Information Forensics and Security, 15:1331-1346, 2019. +[34] Owen Mayer and Matthew C Stamm. Exposing fake images with forensic similarity graphs. IEEE Journal of Selected Topics in Signal Processing, 14(5):1049-1064, 2020. +[35] Jacek Naruniec, Leonhard Helminger, Christopher Schroers, and Romann M. Weber. High-resolution neural face swapping for visual effects. In Proc. Eurographics Symposium on Rendering, 2020. +[36] João C. Neves, Ruben Tolosana, Ruben Vera-Rodriguez, Vasco Lopes, Hugo Proença, and Julian Fierrez. GANprintR: Improved fakes and evaluation of the state-of-the-art in face manipulation detection. Journal of Selected Topics in Signal Processing, 14(5):1038-1048, 2020. +[37] Huy H. Nguyen, Fuming Fang, Junichi Yamagishi, and Isao Echizen. Multi-task learning for detecting and segmenting manipulated facial images and videos. In Proc. Biometrics Theory, Applications and Systems, Sep. 23-26 2019. +[38] Yuval Nirkin, Lior Wolf, Yosi Keller, and Tal Hassner. Deepfake detection based on the discrepancy between the face and its context. In IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. +[39] Patrick Pérez, Michel Gangnet, and Andrew Blake. Poisson image editing. ACM Transactions on Graphics, 2003. +[40] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In Proc. Medical Image Computing and Computer-assisted Intervention, 2015. +[41] Andreas Rössler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. FaceForensics++: Learning to detect manipulated facial images. In Proc. IEEE/CVF International Conference on Computer Vision, pages 1-11, Oct. 27-Nov. 2 2019. +[42] Ekraam Sabir, Jiaxin Cheng, Ayush Jaiswal, Wael AbdAlmageed, Iacopo Masi, and Prem Natarajan. Recurrent convolutional strategies for face manipulation detection in videos. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshop, Jun. 16-20 2019. +[43] Ayush Tewari, Michael Zollhofer, Hyeongwoo Kim, Pablo Garrido, Florian Bernard, Patrick Perez, and Christian Theobalt. MoFA: Model-based deep convolutional face autoencoder for unsupervised monocular reconstruction. In Proc. IEEE/CVF International Conference on Computer Vision Workshops, pages 1274-1283, Oct. 22-29 2017. +[44] J. Thies, M. Zollhöfer, M. Stamminger, C. Theobalt, and M. Nießner. Face2Face: Real-time Face Capture and Reenactment of RGB Videos. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2387- + +2395, Jun. 26-Jul. 1 2016. +[45] Justus Thies, Michael Zollhöfer, and Matthias Nießner. Deferred neural rendering: Image synthesis using neural textures. In ACM Transactions on Graphics, volume 38, pages 1-12, 2019. +[46] Ruben Tolosana, Sergio Romero-Tapiador, Julian Fierrez, and Ruben Vera-Rodriguez. DeepFakes evolution: Analysis of facial regions and fake detection performance. arXiv:2004.07532, 2020. +[47] Ruben Tolosana, Ruben Vera-Rodriguez, Julian Fierrez, Aythami Morales, and Javier Ortega-Garcia. Deepfakes and beyond: A survey of face manipulation and fake detection. arXiv preprint arXiv:2001.00179, 2020. +[48] Loc Trinh, Michael Tsang, Sirisha Rambhatla, and Yan Liu. Interpretable and trustworthy deepfake detection via dynamic prototypes. In Proceedings of the IEEE Winter Conference on Applications of Computer Vision, 2021. +[49] Arash Vahdat and Jan Kautz. NVAE: A deep hierarchical variational autoencoder. In Proc. Advances in Neural Information Processing Systems, Dec. 6-12 2020. +[50] Fei Wang, Liren Chen, Cheng Li, Shiyao Huang, Yanjie Chen, Chen Qian, and Chen Change Loy. The devil of face recognition is in the noise. arXiv:1807.11649, 2018. +[51] Run Wang, Felix Juefei-Xu, Lei Ma, Xiaofei Xie, Yihao Huang, Jian Wang, and Yang Liu. FakeSpotter: A simple yet robust baseline for spotting ai-synthesized fake faces. arXiv:1909.06122, 2019. +[52] Sheng-Yu Wang, Oliver Wang, Richard Zhang, Andrew Owens, and Alexei A. Efros. CNN-generated images are surprisingly easy to spot... for now. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8695-8704, Jun 14-19 2020. +[53] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7794-7803, Jun. 18-22 2018. +[54] Xinggang Wang, Yongluan Yan, Peng Tang, Xiang Bai, and Wenyu Liu. Revisiting multiple instance neural networks. Pattern Recognition, 74:15-24, 2018. +[55] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600-612, 2004. +[56] Lior Wolf, Tal Hassner, and Itay Maoz. Face recognition in unconstrained videos with matched background similarity. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 529-534, Jun. 20-25 2011. +[57] Xin Yang, Yuezun Li, and Siwei Lyu. Exposing deep fakes using inconsistent head poses. In International Conference on Acoustics, Speech, and Signal Processing, 2018. +[58] Ning Yu, Larry Davis, and Mario Fritz. Attributing fake images to GANs: Analyzing fingerprints in generated images. In Proc. IEEE/CVF International Conference on Computer Vision, pages 7556-7566, Oct. 27-Nov. 2 2019. +[59] Hanqing Zhao, Wenbo Zhou, Dongdong Chen, Tianyi Wei, Weiming Zhang, and Nenghai Yu. Multi-attentional deep-fake detection. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021. +[60] P. Zhou, X. Han, V. I. Morariu, and L. S. Davis. Two- + +stream neural networks for tampered face detection. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Jun. 21-26 2017. +[61] Bojia Zi, Minghao Chang, Jingjing Chen, Xingjun Ma, and Yu-Gang Jiang. WildDeepfake: A challenging real-world dataset for deepfake detection. In Proc. ACM International Conference on Multimedia, pages 2382-2390, Oct. 2020. \ No newline at end of file diff --git a/learningselfconsistencyfordeepfakedetection/images.zip b/learningselfconsistencyfordeepfakedetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ec1059c8260efa7298db6e1268703c56ea67a947 --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a019e59f2403b32eaa9f4ace487af6464b7e033a37bd062644d07ba3edd8ef4 +size 416865 diff --git a/learningselfconsistencyfordeepfakedetection/layout.json b/learningselfconsistencyfordeepfakedetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a3a982dfb4fb3b20485a078fba245ac64d61625a --- /dev/null +++ b/learningselfconsistencyfordeepfakedetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca8e488653bc5fc133d3499264a96bcace39377b0de06c6c7f0a13d8e6d81616 +size 495261 diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_content_list.json b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..37925201121cce1ac90533effa7b170a45ebb6ef --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0e38fd482ab00abcfc639811edeba0cb010440c5566d8211544c6a8d21d1fcf +size 82736 diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_model.json b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1ba0acf2cb24420397aec2867580061f97691a13 --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0be7e044482202e8116347be9737fd16b8a4710ba625256634cb3dc255160976 +size 102498 diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_origin.pdf b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..18c269fbd58c352580a1b65f713453e7f42d62c5 --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/97753b2f-00a4-4799-963e-2ddf237a8476_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9c02fdb1acd41007b52d87fff27d0c541159872fd545088fe4a91b50a4a356a +size 1433560 diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/full.md b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f499e01e3dd2b394626a26032d6aa6f9808dc5b8 --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/full.md @@ -0,0 +1,347 @@ +# Learning Self-Similarity in Space and Time as Generalized Motion for Video Action Recognition + +Heeseung Kwon* + +Manjin Kim* + +Suha Kwak + +Minsu Cho + +Pohang University of Science and Technology (POSTECH), South Korea + +http://cvlab.postech.ac.kr/research/SELFY/ + +# Abstract + +Spatio-temporal convolution often fails to learn motion dynamics in videos and thus an effective motion representation is required for video understanding in the wild. In this paper, we propose a rich and robust motion representation based on spatio-temporal self-similarity (STSS). Given a sequence of frames, STSS represents each local region as similarities to its neighbors in space and time. By converting appearance features into relational values, it enables the learner to better recognize structural patterns in space and time. We leverage the whole volume of STSS and let our model learn to extract an effective motion representation from it. The proposed neural block, dubbed SELFY, can be easily inserted into neural architectures and trained end-to-end without additional supervision. With a sufficient volume of the neighborhood in space and time, it effectively captures long-term interaction and fast motion in the video, leading to robust action recognition. Our experimental analysis demonstrates its superiority over previous methods for motion modeling as well as its complementarity to spatio-temporal features from direct convolution. On the standard action recognition benchmarks, Something-Something-V1 & V2, Diving-48, and FineGym, the proposed method achieves the state-of-the-art results. + +# 1. Introduction + +Learning spatio-temporal dynamics is the key to video understanding. While extending standard convolution in space and time has been actively investigated for the purpose in recent years [1, 44, 46], the empirical results so far indicate that spatio-temporal convolution alone is not sufficient for grasping the whole picture; it often learns irrelevant context bias rather than motion information [32, 33] and thus the additional use of optical flow turns out to boost the performance in most cases [1, 29]. Motivated by this, re + +![](images/ba0aae180780af504dec3bab253c1f412eca4939a34343288b3ccddd0a904191.jpg) +Figure 1: Spatio-temporal self-similarity (STSS) representation learning. STSS describes each position (query) by its similarities (STSS tensor) with its neighbors in space and time (neighborhood). It allows to take a generalized, far-sighted view on motion, i.e., both short-term and long-term, both forward and backward, as well as spatial self-motion. Our method learns to extract a rich motion representation from STSS without additional supervision. + +cent action recognition methods learn to extract explicit motion, i.e., flow or correspondence, between feature maps of adjacent frames to improve the performance [22, 27]. But, is it essential to extract such an explicit form of flows or correspondences? How can we learn a richer and more robust form of motion information for videos in the wild? + +In this paper, we propose to learn spatio-temporal self-similarity (STSS) representation for video understanding. Self-similarity is a relational descriptor for an image that effectively captures intra-structures by representing each local region as similarities to its spatial neighbors [37]. As illustrated in Fig. 1, given a sequence of frames, i.e., a video, it + +extends along time and thus represents each local region as similarities to its neighbors in space and time. By converting appearance features into relational values, STSS enables a learner to better recognize structural patterns in space and time. For neighbors at the same frame it computes a spatial self-similarity map, while for neighbors at a different frame it extracts a motion likelihood map. Note that if we fix our attention to the similarity map to the very next frame within STSS and attempt to extract a single displacement vector to the most likely position at the frame, the problem reduces to optical flow, which is a limited type of motion information. In contrast, we leverage the whole volume of STSS and let our model learn to extract a generalized motion representation from it in an end-to-end manner. With a sufficient volume of the neighborhood in space and time, it effectively captures long-term interaction and fast motion in the video, leading to robust action recognition. + +We introduce a neural block for STSS representation, dubbed SELFY, that can be easily inserted into neural architectures and learned end-to-end without additional supervision. Our experimental analysis demonstrates its superiority over previous methods for motion modeling as well as its complementarity to spatio-temporal features from direct convolutions. On the standard benchmarks for action recognition, Something-Something V1&V2 [10], Diving-48 [28], and FineGym [36], the proposed method achieves the state-of-the-art results. + +# 2. Related Work + +Video action recognition. Video action recognition aims to categorize videos into pre-defined action classes and one of the main issues in action recognition is to capture temporal dynamics in videos. For modern neural networks, previous methods attempt to learn temporal dynamics in different ways: two-stream networks with external optical flows [38, 49], recurrent networks [3], temporal pooling methods [9, 23], and 3D CNNs [1, 44]. Recent methods have introduced the advanced 3D CNNs [5, 7, 29, 45, 46] and showed the effectiveness of capturing spatio-temporal features, so that 3D CNNs now become a de facto approach to learn temporal dynamics in the video. However, spatiotemporal convolution is vulnerable unless relevant features are well aligned across frames within the fixed-sized kernel. To address this issue, a few methods adaptively translate the kernel offsets with deformable convolutions [25, 55], while several methods [8, 26] modulate the other hyperparameters, e.g., higher frame rate or larger spatial receptive fields. Unlike these methods, we address the problem of the spatio-temporal convolution by a sufficient volume of STSS, capturing far-sighted spatio-temporal relations. + +Learning motion features. Since using the external optical flow benefits 3D CNNs to improve the action recognition accuracy [1, 46, 57], several methods propose to learn + +frame-by-frame motion features from RGB sequences inside neural architectures. Some methods [6, 34] internalize TV-L1 [54] optical flows into the CNN. Frame-wise feature differences [14, 24, 27, 42] are also utilized as the motion features. Recent correlation-based methods [22, 48] adopt a correlation operator [4, 41, 53] to learn motion features between adjacent frames. However, these methods compute frame-by-frame motion features between two adjacent frames and then rely on stacked spatio-temporal convolutions for capturing long-range motion dynamics. In contrast, we propose to learn STSS features, as generalized motion features, that enable to capture both short-term and long-term interactions in the video. + +Self-similarity. Self-similarity describes a relational structure of individual image features by computing similarities between them [37]. Several methods [15, 16, 37, 43] use the self-similarity as a shallow relational descriptor, which is robust to photometric variations, in fields of template matching [37], capturing view-invariant geometric patterns [15, 16], or finding semantic correspondences [17, 21, 43]. In video understanding, there are a few approaches [30, 50] that use the self-similarity of a video as a form of STSS. These methods, however, use STSS for a subsequent feature aggregation step rather than learn representation from it; non-local operation [50] uses STSS as attention weights in aggregating features [13, 35, 39, 47] and CPNet [30] uses STSS in selecting pairs of appearance features. All these methods lose rich motion information of STSS during aggregation, being not suitable for capturing motion content of videos. In contrast, we advocate using STSS directly for motion representation learning. Our method leverages the full STSS as generalized motion information and learns an effective representation for action recognition within a video-processing architecture. To the best of our knowledge, our work is the first in learning STSS representation using modern neural networks. + +The contribution of our paper can be summarized as follows. First, we revisit the notion of self-similarity and propose to learn a generalized, far-sighted motion representation from STSS. Second, we implement STSS representation learning as a neural block, dubbed SELFY, that can be integrated into existing neural architectures. Third, we provide comprehensive evaluations on SELFY, achieving the state-of-the-art on benchmarks: Something-Something V1&V2 [10], Diving-48 [28], and FineGym [36]. + +# 3. Our approach + +In this section, we first revisit the notions of self-similarity and discuss its relation to motion. We then introduce our method for learning effective spatio-temporal self-similarity representation, which can be easily integrated into video-processing architectures and learned end-to-end. + +![](images/8e9778848077360b774626c1d4d74fd2ce1db2dcf2f49b7223aff22cd7ce6905.jpg) +Figure 2: Overview of our self-similarity representation block (SELFY). SELFY block takes as input a video feature tensor $\mathbf{V}$ , transforms it to a STSS tensor $\mathbf{S}$ , and extracts a feature tensor $\mathbf{F}$ from $\mathbf{S}$ . It then produces the final STSS representation $\mathbf{Z}$ via the feature integration, which is the same size as the input $\mathbf{V}$ . The resultant representation $\mathbf{Z}$ is fused into the input feature $\mathbf{V}$ by element-wise addition, thus making SELFY act as a residual block. See text for details. + +# 3.1. Self-Similarity Transformation + +Self-similarity is a relational descriptor that suppresses variations in appearance and reveals structural patterns [37]. + +Given an image feature map $\mathbf{I} \in \mathbb{R}^{X \times Y \times C}$ , self-similarity transformation of $\mathbf{I}$ results in a 4D tensor $\mathbf{S} \in \mathbb{R}^{X \times Y \times U \times V}$ , whose elements are defined as + +$$ +\mathbf {S} _ {x, y, u, v} = \operatorname {s i m} \left(\mathbf {I} _ {x, y}, \mathbf {I} _ {x + u, y + v}\right), +$$ + +where $\mathrm{sim}(\cdot ,\cdot)$ is a similarity function, e.g., cosine similarity. Here, $(x,y)$ is a query coordinate while $(u,v)$ is a spatial offset from it. To impose a locality, the offset is restricted to its neighborhood: $(u,v)\in [-d_{\mathrm{U}},d_{\mathrm{U}}]\times [-d_{\mathrm{V}},d_{\mathrm{V}}]$ , so that $U = 2d_{\mathrm{U}} + 1$ and $V = 2d_{\mathrm{V}} + 1$ , respectively. By converting $C$ -dimensional appearance feature $\mathbf{I}_{x,y}$ into $UV$ -dimensional relational feature $\mathbf{S}_{x,y}$ , it suppresses variations in appearance and reveals spatial structures in the image. Note that the self-similarity transformation closely relates to conventional cross-similarity (or correlation) across two different feature maps $(\mathbf{I},\mathbf{I}^{\prime}\in \mathbb{R}^{X\times Y\times C})$ , which can be defined as + +$$ +\mathbf {S} _ {x, y, u, v} = \operatorname {s i m} (\mathbf {I} _ {x, y}, \mathbf {I} _ {x + u, y + v} ^ {\prime}). +$$ + +Given a moving object of two images, the cross-similarity transformation effectively captures motion information and thus is commonly used in optical flow and correspondence estimation [4, 41, 53]. + +For a sequence of frames, i.e., a video, one can naturally extend the spatial self-similarity along the temporal axis. Let $\mathbf{V} \in \mathbb{R}^{T \times X \times Y \times C}$ denote a feature map of the video with $T$ frames. Spatio-temporal self-similarity (STSS) transformation of $\mathbf{V}$ results in a 6D tensor $\mathbf{S} \in \mathbb{R}^{T \times X \times Y \times L \times U \times V}$ , whose elements are defined as + +$$ +\mathbf {S} _ {t, x, y, l, u, v} = \operatorname {s i m} \left(\mathbf {V} _ {t, x, y}, \mathbf {V} _ {t + l, x + u, y + v}\right), \tag {1} +$$ + +where $(t,x,y)$ is a query coordinate and $(l,u,v)$ is a spatiotemporal offset from the query. In addition to the locality of spatial offsets above, the temporal offset $l$ is also restricted + +to its temporal neighborhood: $l \in [-d_{\mathrm{L}}, d_{\mathrm{L}}]$ , so that $L = 2d_{\mathrm{L}} + 1$ . + +What types of information does STSS describe? Interestingly, for each time $t$ , the STSS tensor $\mathbf{S}$ can be decomposed along temporal offset $l$ into a single spatial self-similarity tensor (when $l = 0$ ) and $2d_{\mathrm{L}}$ spatial cross-similarity tensors (when $l \neq 0$ ); the partial tensors with a small offset (e.g., $l = -1$ or $+1$ ) collect motion information from adjacent frames and those with larger offsets capture it from further frames both forward and backward in time. Unlike previous approaches to learn motion [4, 22, 48], which rely on cross-similarity between adjacent frames, STSS allows to take a generalized, far-sighted view on motion, i.e., both short-term and long-term, both forward and backward, as well as spatial self-motion. + +# 3.2. Spatio-temporal self-similarity representation learning + +By leveraging the rich information in STSS, we propose to learn a generalized motion representation for video understanding. To achieve this goal without additional supervision, we design a neural block, dubbed SELFY, which can be inserted into video-processing architectures and learned end-to-end. Figure 2 illustrates the overall structure. It consists of three steps: self-similarity transformation, feature extraction, and feature integration. + +Given the input video feature tensor $\mathbf{V}$ , the self-similarity transformation step converts it to the STSS tensor $\mathbf{S}$ as in Eq. 1. In the following, we describe feature extraction and integration steps. + +# 3.2.1 Feature extraction + +From the STSS tensor $\mathbf{S} \in \mathbb{R}^{T \times X \times Y \times L \times U \times V}$ , we extract a $C_F$ -dimensional feature for each spatio-temporal position $(t, x, y)$ and temporal offset $l$ so that the resultant tensor is $\mathbf{F} \in \mathbb{R}^{T \times X \times Y \times L \times C_F}$ , which is equivariant to translation in space, time, and temporal offset. The dimension of $L$ is preserved to extract motion information across different + +![](images/18ebec9c2943252ffa3c7e11a27db6df0362d8087886d2fcfac98adda470630e.jpg) +Figure 3: Feature extraction from STSS. For a spatio-temporal position $(t,x,y)$ , each method transforms $(L,U,V)$ volume of STSS tensor $\mathbf{S}$ into $(L,C_F)$ . See text for details. + +![](images/675aaa6f64319e75de97600f86076d773706c974cfd7221d50d06b3642d9cb1c.jpg) + +![](images/37efb0e9fff19bdf821bae0bad315e9b6edd6ea1cda57482daf4b92467d01a5f.jpg) + +temporal offsets in a consistent manner. While there exist many design choices, we introduce three methods for feature extraction in this work. + +Soft-argmax. The first method is to compute explicit displacement fields using S, which previous motion learning methods adopt using spatial cross-similarity [4,41,53]. One may extract the displacement field by indexing the positions with the highest similarity value via $\arg \max_{(u,v)}$ , but it is not differentiable. We instead use soft-argmax [2], which aggregates displacement vectors with softmax weighting (Fig. 3a). The soft-argmax feature extraction can be formulated as + +$$ +\mathbf {F} _ {t, x, y, l} = \sum_ {u, v} \frac {\exp \left(\mathbf {S} _ {t , x , y , l , u , v} / \tau\right)}{\sum_ {u ^ {\prime} , v ^ {\prime}} \exp \left(\mathbf {S} _ {t , x , y , l , u ^ {\prime} , v ^ {\prime}} / \tau\right)} [ u; v ], \tag {2} +$$ + +which results in a feature tensor $\mathbf{F} \in \mathbb{R}^{T \times X \times Y \times L \times 2}$ . The temperature factor $\tau$ adjusts the softmax distribution, and we set $\tau = 0.01$ in our experiments. + +Multi-layer perceptron (MLP). The second method is to learn an MLP that converts self-similarity values into a feature. For this, we flatten the $(U,V)$ volume into $UV$ -dimensional vectors, and apply an MLP to them (Fig. 3b). For the reshaped tensor $\mathbf{S} \in \mathbb{R}^{T \times X \times Y \times L \times UV}$ , a perceptron $f(\cdot)$ can be expressed as + +$$ +f (\mathbf {S}) = \operatorname {R e L U} \left(\mathbf {S} \times_ {5} \mathbf {W} _ {\phi}\right), \tag {3} +$$ + +where $\times_{n}$ denotes the $n$ -mode tensor product, $\mathbf{W}_{\phi} \in \mathbb{R}^{C' \times UV}$ is the perceptron parameters, and the output is $f(\mathbf{S}) \in \mathbb{R}^{T \times X \times Y \times L \times C'}$ . The MLP feature extraction can thus be formulated as + +$$ +\mathbf {F} = \left(f _ {n} \circ f _ {n - 1} \circ \dots \circ f _ {1}\right) (\mathbf {S}), \tag {4} +$$ + +which produces a feature tensor $\mathbf{F} \in \mathbb{R}^{T \times X \times Y \times L \times C_F}$ . This method is more flexible and may also be more effective than the soft-argmax because not only can it encode displacement information but also it can directly access the similarity values, which may be helpful for learning motion distribution. + +Convolution. The third method is to learn convolution kernels over $(L,U,V)$ volume of $\mathbf{S}$ (Fig. 3c). When we regard $\mathbf{S}$ as a 7D tensor $\mathbf{S} \in \mathbb{R}^{T \times X \times Y \times L \times U \times V \times C}$ with $C = 1$ , the convolution layer $g(\cdot)$ can be expressed as + +$$ +g (\mathbf {S}) = \operatorname {R e L U} \left(\operatorname {C o n v} \left(\mathbf {S}, \mathbf {K} _ {e}\right)\right), \tag {5} +$$ + +where $\mathbf{K}_e\in \mathbb{R}^{1\times 1\times 1\times L_\kappa \times U_\kappa \times V_\kappa \times C\times C'}$ is a multi-channel convolution kernel. Starting from $\mathbb{R}^{T\times X\times Y\times L\times U\times V\times 1}$ we gradually downsample (U,V) and expand channels via multiple convolutions with strides, finally resulting in $\mathbb{R}^{T\times X\times Y\times L\times 1\times 1\times C_F}$ ; we preserve the L dimension, since maintaining fine temporal resolution is shown to be effective for capturing detailed motion information [8, 29]. In practice, we reshape S and then apply a regular 3D convolution along $(l,u,v)$ dimension of S. The convolutional feature extraction with $n$ layers can thus be formulated as + +$$ +\mathbf {F} = \left(g _ {n} \circ g _ {n - 1} \circ \dots \circ g _ {1}\right) (\mathbf {S}), \tag {6} +$$ + +which results in a feature tensor $\mathbf{F} \in \mathbb{R}^{T \times X \times Y \times L \times C_F}$ . This method is effective in learning structural patterns with their convolution kernels, thus outperforming the former methods as will be seen in our experiments. + +# 3.2.2 Feature integration + +In this step, we integrate the extracted STSS features $\mathbf{F} \in \mathbb{R}^{T \times X \times Y \times L \times C_F}$ to feed them back to the original input stream with $(T, X, Y, C)$ volume. + +We first use spatio-temporal convolution kernels along $(t,x,y)$ dimension of $\mathbf{F}$ . The convolution layer $h(\cdot)$ can be expressed as + +$$ +h (\mathbf {F}) = \operatorname {R e L U} \left(\operatorname {C o n v} \left(\mathbf {F}, \mathbf {K} _ {i}\right)\right), \tag {7} +$$ + +where $\mathbf{K}_i\in \mathbb{R}^{T_\kappa\times X_\kappa\times Y_\kappa\times 1\times C_F\times C_F'}$ is a multi-channel convolution kernel. This type of convolution integrates the extracted STSS features by extending receptive fields along $(t,x,y)$ dimension. In practice, we reshape $\mathbf{F}$ and then apply a regular 3D convolution along $(t,x,y)$ dimension of $\mathbf{F}$ . + +The resultant features $\mathbf{F}^{\star}\in \mathbb{R}^{T\times X\times Y\times L\times C_F^{\star}}$ is defined as + +$$ +\mathbf {F} ^ {\star} = \left(h _ {n} \circ h _ {n - 1} \circ \dots \circ h _ {1}\right) (\mathbf {F}). \tag {8} +$$ + +We then flatten the $(L, C_F^\star)$ volume into $LC_F^\star$ -dimensional vectors to obtain $\mathbf{F}^\star \in \mathbb{R}^{T \times X \times Y \times LC_F^\star}$ , and apply an $1 \times 1 \times 1$ convolution layer to obtain the final output. This convolution layer integrates features from different temporal offsets and also adjusts its channel dimension to fit that of the original input $\mathbf{V}$ . The final output tensor $\mathbf{Z}$ is expressed as + +$$ +\mathbf {Z} = \operatorname {R e L U} \left(\mathbf {F} ^ {\star} \times_ {4} \mathbf {W} _ {\theta}\right), \tag {9} +$$ + +where $\times_{n}$ is the $n$ -mode tensor product and $\mathbf{W}_{\theta} \in \mathbb{R}^{C \times LC_F^{\star}}$ is the weights of the convolution layer. + +Finally, we combine the resultant STSS representation $\mathbf{Z}$ into the input feature $\mathbf{V}$ by element-wise addition, thus making SELFY act as a residual block [11]. + +# 4. Experiments + +# 4.1. Implementation details + +Action recognition architecture. We employ TSN ResNets [49] as 2D CNN backbones and TSM ResNets [29] as 3D CNN backbones. TSM enables to obtain the effect of spatio-temporal convolutions using spatial convolutions by shifting a part of input channels along the temporal axis before the convolution operation. TSM is inserted into each residual block of the ResNet. We adopt ImageNet pretrained weights for our backbones. To transform the backbones to the self-similarity network (SELFYNet), we insert a single SELFY block after the third stage in the backbone with additive fusion. For the feature extraction and integration in SELFY block, we use four $1 \times 3 \times 3$ convolution layers along $(l, u, v)$ dimensions and four $1 \times 3 \times 3$ convolution layers along $(t, x, y)$ dimensions, respectively. For more details, please refer to supplementary material A. + +Training & testing. For training, we sample a clip of 8 or 16 frames from each video using segment-based sampling [49]. The spatio-temporal matching region $(L,U,V)$ of SELFY block is set as $(5,9,9)$ or $(9,9,9)$ when using 8 or 16 frames, respectively. For testing, we sample one or two clips from a video, crop their center, and evaluate the averaged prediction of the sampled clips. For more details, please refer to supplementary material A. + +# 4.2. Datasets + +For evaluation, we use benchmarks that contain fine-grained spatio-temporal dynamics in videos. + +Something-Something V1 & V2 (SS-V1 & V2) [10], which are both large-scale action recognition datasets, contain $\sim 108\mathrm{k}$ and $\sim 220\mathrm{k}$ video clips, respectively. Both + +datasets share the same 174 action classes that are labeled, e.g., 'pretending to put something next to something.' + +Diving-48 [28], which contains $\sim 18\mathrm{k}$ videos with 48 different diving action classes, is an action recognition dataset that minimizes contextual biases, i.e., scenes or objects. + +FineGym [36] is a fine-grained action dataset built on top of gymnastic videos. We adopt the Gym288 and Gym99 sets that contain 288 and 99 classes, respectively. + +# 4.3. Comparison with the state-of-the-art methods + +For a fair comparison, we compare our model with other models that are not pre-trained on additional large-scale video datasets, e.g., Kinetics [20] or Sports1M [19], in the following experiments. + +Table 1 summarizes the results on SS-V1&V2. The first and second compartment of the table shows the results of other 2D CNN and (pseudo-) 3D CNN models, respectively. The last part of each compartment shows the results of SELFYNet. SELFYNet with TSN-ResNet (SELFYNet-TSN-R50) achieves $50.7\%$ and $62.7\%$ at top-1 accuracy, respectively, which outperforms other 2D models using 8 frames only. When we adopt TSM ResNet (TSM-R50) as our backbone and use 16 frames, our method (SELFYNet-TSM-R50) achieves $54.3\%$ and $65.7\%$ at top-1 accuracy, respectively, which is the best among the single models. Compared to TSM-R50, a single SELFY block obtains the significant gains of $7.0\% \mathrm{p}$ and $4.5\% \mathrm{p}$ at top-1 accuracy, respectively; our method is more accurate than TSM-R50 two-stream on both datasets. Finally, our ensemble model (SELFYNet-TSM- $R_{50_{EN}}$ ) with 2-clip evaluation sets a new state-of-the-art on both datasets by achieving $56.6\%$ and $67.7\%$ at top-1 accuracy, respectively. + +Tables 2 and 3 summarize the results on Diving-48 and FineGym. For Diving-48, TSM-R50 using 16 frames shows $38.8\%$ at top-1 accuracy in our implementation. SELFYNet-TSM-R50 outperforms TSM-R50 by $2.8\%$ at top-1 accuracy so that it sets a new state-of-the-art top-1 accuracy as $41.6\%$ on Diving-48. For FineGym, SELFYNet-TSM-R50 achieves $49.5\%$ and $87.7\%$ at given 288 and 99 classes, respectively, surpassing all the other models reported in [36]. + +# 4.4. Ablation studies + +We conduct ablation experiments to demonstrate the effectiveness of the proposed method. All experiments are performed on SS-V1 using 8 frames. Unless specified otherwise, we set ImageNet pre-trained TSM ResNet-18 (TSM-R18) with the single SELFY block of which $(L,U,V) = (5,9,9)$ , as our default SELFYNet. + +Types of similarity. In Table 4a, we investigate the effect of different types of similarity by varying the set of temporal offset $l$ on both TSN-ResNet-18 (TSN-R18) and TSM-R18. Interestingly, learning spatial self-similarity ( $\{0\}$ ) im + +
modelflow#frameFLOPs×clipsSS-V1SS-V2
top-1top-5top-1top-5
TSN-R50 from [29]833 G×119.746.630.060.5
TRN-BNIncep [56]816 G×N/A34.4-48.8-
TRN-BNIncep Two-Stream [56]✓8+816 G×N/A42.0-55.5-
MFNet-R50 [24]10N/A×1040.370.9--
CPNet-R34 [30]24N/A×96--57.784.0
TPN-R50 [52]8N/A×1040.6-59.1-
SELFYNet-R50 (ours)837 G×150.779.362.788.0
I3D from [51]32153 G×241.672.2--
NL-I3D from [51]32168 G×244.476.0--
TSM-R50 [29]1665 G×147.377.161.286.9
TSM-R50 Two-Stream from [22]✓16+16129 G×152.681.965.089.4
CorrNet-R101 [48]32187 G×1050.9---
STM-R50 [14]1667 G×3050.780.464.289.8
TEA-R50 [27]1670 G×3052.381.9--
MSNet-TSM-R50 [22]1667 G×152.182.364.789.4
MSNet-TSM-R50EN [22]8+16101 G×1055.184.067.191.0
SELFYNet-TSM-R50 (ours)837 G×152.580.864.589.4
SELFYNet-TSM-R50 (ours)1677 G×154.382.965.789.8
SELFYNet-TSM-R50EN (ours)8+16114 G×155.883.967.491.0
SELFYNet-TSM-R50EN (ours)8+16114 G×256.684.467.791.1
+ +Table 1: Performance comparison on SS-V1&V2. Top-1, 5 accuracy $(\%)$ and FLOPs (G) are shown. + +
model#frameFLOPs ×clipsTop-1
TSN from [28]--16.8
TRN from [18]--22.8
Att-LSTM [18]64N/A×135.6
P3D from [31]16N/A×132.4
C3D from [31]16N/A×134.5
GST-R50 [31]1659 G×138.8
CorrNet-R101 [48]32187 G×1038.2
GSM-IncV3 [40]1654 G×240.3
TSM-R50 (our impl.)1665 G×238.8
SELFYNet-TSM-R50 (ours)1677 G×241.6
+ +proves accuracy on both backbones, which implies that self-similarity features help capture structural patterns of visual features. Learning cross-similarity with a short temporal range (\{1\}) shows a noticeable gain at accuracy on both backbones, indicating the significance of motion features. Learning STSS outperforms other types of similarity, and the accuracy of SELFYNet increases as the temporal range becomes longer. When STSS takes a far-sighted view on motion, STSS learns both short-term and long-term interactions in videos, as well as spatial self-similarity. + +Feature extraction and integration methods. In Table 4b, we compare the performance of different combinations of + +Table 2: Performance comparison on Diving-48. Top-1 accuracy $(\%)$ and FLOPs (G) are shown. + +
model#frameGym288 MeanGym99 Mean
TSN [49]326.561.4
TRN [56]333.168.7
I3D [1]827.963.2
NL I3D [50]827.162.1
TSM [29]334.870.6
TSM Two-Stream [29]N/A46.581.2
TSM-R50 (our impl.)335.373.7
TSM-R50 (our impl.)847.986.6
SELFYNet-TSM-R50 (ours)849.587.7
+ +Table 3: Performance comparison on FineGym. The averaged per-class accuracy (\%) is shown. All results in the upper part are from FineGym paper [36]. + +feature extraction and integration methods. From the $2^{\mathrm{nd}}$ to the $4^{\mathrm{th}}$ rows, different feature extraction methods are compared, fixing the feature integration methods to a single fully-connected (FC) layer. Compared to the baseline, the use of soft-argmax, which extracts spatial displacement features, improves the top-1 accuracy by $1.0\% \mathrm{p}$ . Replacing soft-argmax with MLP provides the additional gain of $1.9\% \mathrm{p}$ at top-1 accuracy, showing the effectiveness of directly using similarity values. When using the convolution method for feature extraction, we achieve $46.7\%$ at top-1 accuracy; the multi-channel convolution kernel is more effective in capturing structural patterns along $(u,v)$ dimensions than MLP. From the $4^{\mathrm{th}}$ to the $6^{\mathrm{th}}$ rows, different fea + +ture integration methods are compared, fixing the feature extraction method to convolution. Replacing the single FC layer with MLP improves the top-1 accuracy by $0.6\%$ p. Replacing MLP with convolutional layers further improves and achieves $48.4\%$ at top-1 accuracy. These results demonstrate that our design choice of using convolutions along $(u,v)$ and $(h,w)$ dimensions is the most effective in learning the geometry-aware STSS representation. For more experiments, please refer to supplementary material C. + +# 4.5. Relation with self-attention mechanisms + +Note that self-similarity is also used in self-attention mechanisms [13, 35, 39, 47, 50], but both the purpose and the scheme are very different. Self-attention mechanisms aim to perform dynamic feature transformation based on the image context and thus use the self-similarity as attention weights in aggregating individual features. In contrast, our method focuses on learning relational representation from the self-similarity tensor itself. We directly transform the tensor into a relational representation with learnable convolution kernels, where the relational representation of video is interpreted as generalized motion representation. + +For an apple-to/apple empirical validation, we compare our method with popular self-attention methods [35,39,50]. We re-implement the local self-attention [35] and Transformer [39] blocks, and extend them to a temporal dimension. For a fair comparison, we insert a single block after $res_3$ of ResNet-18. All other experimental details are the same as those in supplementary material A. Table 5 summarizes the results. Our method outperforms the self-attention methods at both top-1 and top-5 accuracies with large margins. These results demonstrate that learning the STSS representation effectively leverages motion features, which play a crucial role in action recognition. For more experiments, please refer to supplementary material C. + +# 4.6. Complementarity of STSS features + +We conduct experiments for analyzing different meanings of spatio-temporal features and STSS features. We organize two basic blocks for representing two different features: spatio-temporal convolution block (STCB) that consists of several spatial-temporal convolutions (Fig. 4a) and SELFY-s block, light-weighted version of the SELFY block by removing spatial convolution layers (Fig. 4b). Both blocks have the same receptive fields and a similar number of parameters for a fair comparison. Different combinations of the basic blocks are inserted after the third stage of TSN-ResNet-18. Table 6 summarizes the results on SS-V1. STSS features (Figs. 4b and 4d) are more effective than spatio-temporal features (Figs. 4a and 4c) at top-1 and top-5 accuracy when the same number of blocks are inserted. Interestingly, the combination of two different features (Figs. 4e and 4f) shows better results at top-1 and top-5 + +
modelrange of lFLOPstop-1top-5
TSN-R18-14.6 G16.240.8
SELFYNet{0}15.3 G16.842.2
{1}15.3 G39.768.9
{-1,0,1}16.3 G44.773.9
{-2,···,2}17.3 G46.975.9
{-3,···,3}18.3 G46.976.2
+ +
TSM-R18-14.6 G43.072.3
SELFYNet{0}15.3 G45.073.4
{1}15.3 G47.176.3
{-1,0,1}16.3 G47.876.7
{-2,···,2}17.3 G48.477.6
{-3,···,3}18.3 G48.677.7
+ +(a) Types of similarity. Performance comparison with different sets of temporal offset in SELFY block. $\{\cdot\}$ denotes a set of temporal offset $l$ . + +
modelextractionintegrationtop-1top-5
TSM-R18--43.072.3
SELFYNetSmaxFC44.072.3
MLPFC45.975.1
ConvFC46.775.8
ConvMLP47.275.9
ConvConv48.477.6
+ +(b) Feature extraction and integration methods. Smax denotes the soft-argmax operation. MLP consists of four FC layers. The $1 \times 1 \times 1$ layer in the feature integration stage is omitted. +Table 4: Ablations on SS-V1. Top-1 & 5 accuracy (%) are shown. + +
model(L,U,V)top-1top-5
TSM-R18-43.072.3
TSM-R18 + LSA [35](5,9,9)43.872.8
TSM-R18 + NL [50]global43.573.4
TSM-R18 + MHSA [39]global44.072.8
SELFYNet(5,9,9)48.477.6
+ +Table 5: Performance comparison with self-attention methods [35, 39, 50]. LSA, NL, and MHSA denote a local self-attention block [35], non-local block [50], and multi-head self-attention block [39], respectively. + +accuracy compared to the single feature cases (Figs. 4c and 4d), which demonstrate that both features complement each other. We conjecture that this complementarity comes from different characteristics of the two features; while spatiotemporal features are obtained by directly encoding appearance features, STSS features are obtained by suppressing variations in appearance and focusing on the relational features in space and time. + +![](images/89cac68eee05f926d85f76e9b6d49cfedae7a6e2bfb6ca721b546357d9488606.jpg) +Figure 4: Basic blocks and their combinations. (a) spatiotemporal convolution block (STCB), (b) SELFY-s block, and (c-f) their different combinations. + +![](images/4e626159831b6595b2f4bc16fa626268ac477901b205f240105fe7824a5209f5.jpg) + +![](images/b0e92d7f3540d49ad20602b8367df98a3cb53c63dfaf9ab19de75a2887bd8fff.jpg) +(a) corruption: occlusion + +![](images/ed87ec051915b001a84104ca96ff7b3bc75336a3d0810fa3adbfe96075a69cd7.jpg) +(b) corruption: motion blur +(✓) $I \in \{-3, \dots, 3\}$ : Putting something in front of something +(c) qualitative results on corrupted videos + +
model, TSN-R18top-1top-5
baseline16.240.8
(a) STCB42.471.7
(b) SELFY-s46.375.1
(c) STCB + STCB44.473.7
(d) SELFY-s + SELFY-s46.875.9
(e) SELFY-s + STCB (parallel)46.976.5
(f) SELFY-s + STCB (sequential)47.676.6
+ +Table 6: Spatio-temporal features v.s. STSS features. The basic blocks and their different combinations in Fig. 4 are compared on SS-V1. + +![](images/6e7a449fb406f981d29c88d4b7604f15e63b96265577c42d63920785fde29483.jpg) +$(\times) I \in \{1\}$ : Covering something with something + $(\checkmark) I \in \{-3, \dots, 3\}$ : Putting something onto something + +![](images/458984b87ab8882e7b935172ae2be40ba06e596e472c646a490c70e6fe80627c.jpg) +$(\times) I \in \{1\}$ : Hitting something with something +Figure 5: Robustness experiments. (a) and (b) show top-1 accuracy of SELFYNet variants (Table 4a) when different degrees of occlusion and motion blur, respectively, are added to input. (c) shows qualitative examples where SELFYNet $\{-3,\dots ,3\}$ succeeds while SELFYNet $\{1\}$ fails. + +# 4.7. Improving robustness with STSS + +In this experiment, we demonstrate that STSS representation helps video-processing models to be more robust to video corruptions. We test two types of corruption that are likely to occur in real-world videos: occlusion and motion blur. To induce the corruptions, we either cut out a rectangle patch of a particular frame or generate a motion blur [12]. We corrupt a single center-frame for every clip of SS-V1 at the testing phase and gradually increase the severity of corruption. We compare the results of TSM-R18 and SELFYNet variants of Table 4a. Figures 5a and 5b summarize the results of two corruptions, respectively. Top-1 accuracy of TSM-R18 and SELFYNets with the short temporal range $\{0\}$ , $\{1\}$ , and $\{-1,0,1\}$ significantly drops as the severity of corruption becomes harder. We conjecture that features of the corrupted frame propagate through the stacked TSMs, confusing the entire network. However, the SELFYNets with the long temporal range $\{-2,\dots,2\}$ and $\{-3,\dots,3\}$ show more robust performance than the other models. As shown in Figs. 5a and 5b, the accuracy gap between SELFYNets with the long temporal range and the others increases as the sever + +ity of corruptions becomes higher, indicating that the larger size of STSS features can improve the robustness on action recognition. We also present some qualitative results (Fig. 5c) where two SELFYNets with different temporal ranges, $\{1\}$ and $\{-3,\dots ,3\}$ , both answer correctly without corruption, while the SELFYNet with $\{1\}$ fails for the corrupted input. + +# 5. Conclusion + +We have proposed to learn a generalized, far-sighted motion representation from STSS for video understanding. The comprehensive analyses on the STSS demonstrate that STSS features effectively capture both short-term and long-term interactions, complement spatio-temporal features, and improve the robustness of video-processing models. Our method outperforms other state-of-the-art methods on the three benchmarks for video action recognition. + +Acknowledgements. This work is supported by Samsung Advanced Institute of Technology (SAIT), the NRF grant (NRF-2021R1A2C3012728), and the IITP grant (No.2019-0-01906, AI Graduate School Program - POSTECH) funded by Ministry of Science and ICT, Korea. + +# References + +[1] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 1, 2, 6 +[2] Olivier Chapelle and Mingrui Wu. Gradient descent optimization of smoothed information retrieval metrics. Information retrieval, 13(3):216-235, 2010. 4 +[3] Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 2 +[4] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In Proc. IEEE International Conference on Computer Vision (ICCV), 2015. 2, 3, 4 +[5] Linxi Fan, Shyamal Buch, Guanzhi Wang, Ryan Cao, Yuke Zhu, Juan Carlos Niebles, and Li Fei-Fei. Rubiksnet: Learnable 3d-shift for efficient video action recognition. In Proc. European Conference on Computer Vision (ECCV), 2020. 2 +[6] Lijie Fan, Wenbing Huang, Chuang Gan, Stefano Ermon, Boqing Gong, and Junzhou Huang. End-to-end learning of motion representation for video understanding. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2 +[7] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[8] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proc. IEEE International Conference on Computer Vision (ICCV), 2019. 2, 4 +[9] Rohit Girdhar and Deva Ramanan. Attentional pooling for action recognition. arXiv preprint arXiv:1711.01467, 2017. 2 +[10] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The" something something" video database for learning and evaluating visual common sense. In Proc. IEEE International Conference on Computer Vision (ICCV), 2017. 2, 5 +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 5 +[12] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019. 8 +[13] Han Hu, Zheng Zhang, Zhenda Xie, and Stephen Lin. Local relation networks for image recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 3464-3473, 2019. 2, 7 + +[14] Boyuan Jiang, Mengmeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In Proc. IEEE International Conference on Computer Vision (ICCV), 2019. 2, 6 +[15] Imran N Junejo, Emilie Dexter, Ivan Laptev, and Patrick Perez. View-independent action recognition from temporal self-similarities. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2010. 2 +[16] Imran N Junejo, Emilie Dexter, Ivan Laptev, and Patrick P'Urez. Cross-view action recognition from temporal self-similarities. In Proc. European Conference on Computer Vision (ECCV), 2008. 2 +[17] Dahiyun Kang, Heeseung Kwon, Juhong Min, and Minsu Cho. Relational embedding for few-shot classification. In Proc. IEEE International Conference on Computer Vision (ICCV), 2021. 2 +[18] Gagan Kanojia, Sudhakar Kumawat, and Shanmuganathan Raman. Attentive spatio-temporal representation learning for diving classification. In Proc. IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2019. 6 +[19] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. 5 +[20] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. 5 +[21] Seungryong Kim, Dongbo Min, Bumsub Ham, Sangryul Jeon, Stephen Lin, and Kwanghoon Sohn. Fcss: Fully convolutional self-similarity for dense semantic correspondence. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 2 +[22] Heeseung Kwon, Manjin Kim, Suha Kwak, and Minsu Cho. Motionsqueeze: Neural motion feature learning for video understanding. arXiv preprint arXiv:2007.09933, 2020. 1, 2, 3, 6 +[23] Heeseung Kwon, Yeonho Kim, Jin S Lee, and Minsu Cho. First person action recognition via two-stream convnet with long-term fusion pooling. Pattern Recognition Letters, 112:161-167, 2018. 2 +[24] Myunggi Lee, Seungeui Lee, Sungjoon Son, Gyutae Park, and Nojun Kwak. Motion feature network: Fixed motion filter for action recognition. In Proc. European Conference on Computer Vision (ECCV), 2018. 2, 6 +[25] Jun Li, Xianglong Liu, Mingyuan Zhang, and Deqing Wang. Spatio-temporal deformable 3d convnets with attention for action recognition. Pattern Recognition, 98:107037, 2020. 2 +[26] Xianhang Li, Yali Wang, Zhipeng Zhou, and Yu Qiao. Smallbignet: Integrating core and contextual views for video classification. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[27] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for + +action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 1, 2, 6 +[28] Yingwei Li, Yi Li, and Nuno Vasconcelos. Resound: Towards action recognition without representation bias. In Proc. European Conference on Computer Vision (ECCV), 2018. 2, 5, 6 +[29] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proc. IEEE International Conference on Computer Vision (ICCV), 2019. 1, 2, 4, 5, 6 +[30] Xingyu Liu, Joon-Young Lee, and Hailin Jin. Learning video representations from correspondence proposals. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2, 6 +[31] Chenxu Luo and Alan L Yuille. Grouped spatial-temporal aggregation for efficient action recognition. In Proc. IEEE International Conference on Computer Vision (ICCV), 2019. 6 +[32] Joanna Materzynska, Tete Xiao, Roei Herzig, Huijuan Xu, Xiaolong Wang, and Trevor Darrell. Something-else: Compositional action recognition with spatial-temporal interaction networks. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 1 +[33] Gyeongsik Moon, Heeseung Kwon, Kyoung Mu Lee, and Minsu Cho. Integralaction: Pose-driven feature integration for robust human action recognition in videos. In Proc. IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2021. 1 +[34] AJ Piergiovanni and Michael S Ryoo. Representation flow for action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2 +[35] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Standalone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019. 2, 7 +[36] Dian Shao, Yue Zhao, Bo Dai, and Dahua Lin. Finegym: A hierarchical video dataset for fine-grained action understanding. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2, 5, 6 +[37] Eli Shechtman and Michal Irani. Matching local self-similarities across images and videos. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2007. 1, 2, 3 +[38] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In Proc. Neural Information Processing Systems (NeurIPS), 2014. 2 +[39] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021. 2, 7 +[40] Swathikiran Sudhakaran, Sergio Escalera, and Oswald Lanz. Gate-shift networks for video action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 6 +[41] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2, 3, 4 + +[42] Shuyang Sun, Zhanghui Kuang, Lu Sheng, Wanli Ouyang, and Wei Zhang. Optical flow guided feature: A fast and robust motion representation for video action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2 +[43] Atousa Torabi and Guillaume-Alexandre Bilodeau. Local self-similarity-based registration of human rois in pairs of stereo thermal-visible videos. Pattern Recognition, 46(2):578-589, 2013. 2 +[44] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proc. IEEE International Conference on Computer Vision (ICCV), 2015. 1, 2 +[45] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In Proc. IEEE International Conference on Computer Vision (ICCV), 2019. 2 +[46] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2 +[47] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Ilia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. 2, 7 +[48] Heng Wang, Du Tran, Lorenzo Torresani, and Matt Feiszli. Video modeling with correlation networks. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2, 3, 6 +[49] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In Proc. European Conference on Computer Vision (ECCV), 2016. 2, 5, 6 +[50] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 2, 6, 7 +[51] Xiaolong Wang and Abhinav Gupta. Videos as space-time region graphs. In Proc. European Conference on Computer Vision (ECCV), pages 399-417, 2018. 6 +[52] Ceyuan Yang, Yinghao Xu, Jianping Shi, Bo Dai, and Bolei Zhou. Temporal pyramid network for action recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 6 +[53] Gengshan Yang and Deva Ramanan. Volumetric correspondence networks for optical flow. In Proc. Neural Information Processing Systems (NeurIPS), 2019. 2, 3, 4 +[54] Christopher Zach, Thomas Pock, and Horst Bischof. A duality based approach for realtime tv-1 optical flow. Pattern Recognition, pages 214–223, 2007. 2 +[55] Yue Zhao, Yuanjun Xiong, and Dahua Lin. Trajectory convolution for action recognition. In Proc. Neural Information Processing Systems (NeurIPS), 2018. 2 +[56] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proc. European Conference on Computer Vision (ECCV), 2018. 6 + +[57] Mohammadreza Zolfaghari, Kamaljeet Singh, and Thomas Brox. Eco: Efficient convolutional network for online video understanding. In Proc. European Conference on Computer Vision (ECCV), 2018. 2 \ No newline at end of file diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/images.zip b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9f6fc02fb7996094c93e6aca7213b72d7a9596d8 --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:871ead8f72d29c71377cd022fbd13b85c385d46b6decfeefe4f4992aa356eb08 +size 575449 diff --git a/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/layout.json b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4f0f9d23874bcad67dd13434bb9fa8b2e4590850 --- /dev/null +++ b/learningselfsimilarityinspaceandtimeasgeneralizedmotionforvideoactionrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dc83b79cb9c4b07d52c3742ace116b506e57c43366bf8c36373cf2962a6d2f0 +size 467888 diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_content_list.json b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a1bd2d3322729e1e3defd308562292a65842c59d --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da20eb717c5259420fda143ec5c6732c28042ea8cc2df5f985ae3cc919691e59 +size 85659 diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_model.json b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..22d59465c80e921c6a0010ca4e08215e344ef3a2 --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eda3686c53894aa29c621c9d93fa75f356569b179fc5ee0dabe353bfb27e2354 +size 104821 diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_origin.pdf b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c91585a1b604a1b7b8f8d0026ed1bb21079f3f1b --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/e39bf035-21af-4b79-ba64-423a0c08e4ce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fd51806523b518a019d8b75e8da0e4f5b6534034884db9105c6c231221b0070 +size 7609086 diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/full.md b/learningsigneddistancefieldformultiviewsurfacereconstruction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72f656f61664b27273f12a07687e78ccd5fd1266 --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/full.md @@ -0,0 +1,399 @@ +# Learning Signed Distance Field for Multi-view Surface Reconstruction + +Jingyang Zhang Yao Yao Long Quan + +The Hong Kong University of Science and Technology + +{jzhangbs,yyaoag,quan}@cse.ust.hk + +# Abstract + +Recent works on implicit neural representations have shown promising results for multi-view surface reconstruction. However, most approaches are limited to relatively simple geometries and usually require clean object masks for reconstructing complex and concave objects. In this work, we introduce a novel neural surface reconstruction framework that leverages the knowledge of stereo matching and feature consistency to optimize the implicit surface representation. More specifically, we apply a signed distance field (SDF) and a surface light field to represent the scene geometry and appearance respectively. The SDF is directly supervised by geometry from stereo matching, and is refined by optimizing the multi-view feature consistency and the fidelity of rendered images. Our method is able to improve the robustness of geometry estimation and support reconstruction of complex scene topologies. Extensive experiments have been conducted on DTU, EPFL and Tanks and Temples datasets. Compared to previous state-of-the-art methods, our method achieves better mesh reconstruction in wide open scenes without masks as input. + +# 1. Introduction + +Surface reconstruction from calibrated multi-view images is one of the key problems in 3D computer vision. Traditionally, surface reconstruction can be divided into two substeps: 1) depth maps and point clouds are reconstructed from images via multi-view stereo (MVS) algorithms [2, 8, 41, 37, 44]; 2) a surface, usually represented as a triangular mesh, is extracted from dense points by maximizing the conformity to points [20, 17, 26]. Optionally, a surface refinement step can be applied to recover geometry details through multi-view photo-consistency [34, 42, 5, 4, 7]. While this pipeline has been proven to be effective and robust in various scenarios, the reconstructed geometry may be suboptimal due to the accumulated loss in representation conversions from images to points, then to mesh. For example, errors introduced in point cloud reconstruction would pass to the surface reconstruction, causing wrong + +![](images/9ba8ccf35a980bcc753abfda5c88f8c05eb322ec21dc8fc86d686e4f5180b6bd.jpg) + +![](images/f273533566fe30ad2df05284e4c4b25e4027fc7268e24c6375a3fb7b8044f765.jpg) + +![](images/a0fd8f3736c7f1277211e524ad0745fe9bc3aaf2236c8f7d0b493f6c9d061508.jpg) +Mesh + +![](images/87d7ca8a4864e7e47232275b2cc8ae90cdbcbe1020d69d522ab1acf5e4d34be5.jpg) +Rendered Image +Figure 1. Our reconstructions on Family and Horse of the Tanks and Temples dataset. The proposed MVsDF is able to reconstruct correct mesh topologies with fine details for highly texture-less and reflective surfaces. + +mesh topology and difficult to be recovered. Although recent learning-based MVS [15, 13, 45, 32, 46] and mesh extraction [31, 28, 39, 33] methods have been proposed to boost the reconstruction quality of each substep independently, it is still desirable to reconstruct the optimal surface from images in an end-to-end manner. + +Alternatively, recent works on neural representations show that mesh surface can be directly constructed from images through implicit representations and differentiable rendering [30, 24, 36, 25, 49, 39, 29]. Surface geometry and color information of the scene are usually represented as implicit functions, which are directly modeled by multi-layer perceptrons (MLPs) in the network and optimized through differentiable rendering. The triangle mesh can be extracted from the implicit field via the Marching Cube algorithm [26, 28]. Compared with classical meshing pipelines, these methods are able to reconstruct the scene geometry in an end-to-end manner and generate synthesized images at the + +same time. However, as all scene parameters are jointly optimized at the same time, geometry is only a by-product of the entire differential rendering pipeline, and ambiguities exist in geometry and appearance[52]. To mitigate the problem, implicit differentiable renderer (IDR) [49] applies manually labeled object masks as input, but it is not feasible for a large number of images and is sometimes not well defined for real-world image inputs. + +In this paper, we present MVsDF, a novel neural surface reconstruction framework that combines implicit neural surface estimation with recent advanced MVS networks. On the one hand, we follow the implicit differentiable renderer[49] to represent the surface as zero level set of a signed distance field (SDF) and the appearance as a surface light field, which are jointly optimized through render loss. On the other hand, we introduce deep image features and depth maps from learning-based MVS [46, 51, 50] to assist the implicit SDF estimation. The SDF is supervised by inferred depth values from the MVS network, and is further refined by maximizing the multi-view feature consistency at the surface points of the SDF. We find that the surface topology can be greatly improved with the guidance from MVS depth maps, and our method can be applied to complex geometries even without input object masks. Also, compared to render loss in IDR, the multi-view feature consistency imposes a photometric constraint at an early stage of the differentiable rendering pipeline, which significantly improves the geometry accuracy and helps to preserve high-fidelity details in final reconstructions. + +Our method has been evaluated on DTU [14], EPFL [40] and Tanks and Temples [18] datasets. We compare our method with classical meshing pipelines and recent differentiable rendering based networks on both mesh reconstruction and view synthesis quality. Both quantitative and qualitative results demonstrate that our method is able to recover complex geometries even without object masks as input. + +# 2. Related Works + +Multi-view Stereo Multi-view stereo [38, 10, 6] is a well-developed approach to recover the dense representation of the scene from overlapping images. The fundamental principle of MVS is that a surface point should be visually consistent in all visible views. Traditionally, MVS evaluates the matching cost of image patches for all depth hypotheses and finds the one that best describes the input images. Depth hypotheses can be uniformly sampled from predefined camera frustum [3] or propagated from neighboring pixels and adjacent views [21, 8, 1, 9, 37, 44, 19]. Usually depth map outputs are fused into a unified point cloud, and further converted into a mesh surface [20, 17, 26]. However, such conversions may be lossy. For example, depth maps may be over-filtered so that holes would appear in the final reconstruction. Moreover, surface details may be over + +smoothed during the conversion from point cloud to mesh. + +Recently, deep learning techniques have been applied to multi-view stereo [15, 13, 46, 50, 51]. In the network, handcrafted image features are converted into deep features and engineered cost regularizations are replaced by learned ones [32, 46, 47, 12, 43]. Although the overall depth quality is improved, it is still difficult to match pixels in texture-less or non-Lambertian regions. In this work, we aim to improve the reconstruction of texture-less regions by the interpolation capability of implicit functions, and non-Lambertian regions by explicit view-dependent appearance modeling. + +Implicit Neural Surface Implicit neural representations have also gained popularity in 3D scene reconstructions. Occupancy fields [28, 33] are proposed to model the object surface using the per-point occupancy information, while DeepSDF [31] applies a signed distance field to describe the 3D geometry of the scene. These methods usually take 3D point cloud as input and optimize corresponding implicit fields using ground truth labels, which can be viewed as learned mesh reconstruction from dense point cloud. The marching cube algorithm [26] is usually applied to extract the mesh surface from neural implicit functions. Compared with widely used mesh surfaces and discretized volumes, implicit neural functions are able to model continuous surfaces with fix-sized multi-layer perceptrons, making it more natural and efficient to represent complex geometries with arbitrary topologies. + +Surface Reconstruction by Differentiable Rendering Apart from MVS, rendering and view synthesis based methods [16] provide an alternative to estimate scene geometries by minimizing the difference between rendered and input images. The geometry is either represented using soft representations such as density/transparency fields [39, 29, 23, 27, 52], or explicit representations such as occupancy fields [30] and signed distance fields [24, 25, 49]. + +Our method is most related to IDR [49] which uses SDF and surface light field as the scene representation. These two implicit networks are jointly trained by the render loss, and image masks are applied for constrained SDF optimization. However, the reconstruction quality of IDR highly depends on the accuracy of the input masks, and inaccurate masks may result in either missing or extra mesh surfaces. As auto object segmentation methods [53, 35] cannot always be perfect, IDR applies manually labeled masks to ensure the reconstruction quality. In this work, we introduce multi-view stereo and feature consistency as our geometry constraints to improve the surface quality and relax the requirement of image masks. + +![](images/9eebaa1c9026630766cb091e1c9dbcc9d0f331afc42cd450b0e9b3feefd61981.jpg) +Figure 2. Illustration of the proposed framework. In the network, points are sampled from the space and their signed distance values are directly supervised by MVS depth outputs (Sec. 3.2). Then, surface points are calculated by ray tracing and refined by deep feature consistency (Sec. 3.3). Finally, the SDF geometry and surface light field are jointly optimized by the render loss (Sec. 3.3). + +# 3. Method + +# 3.1. Geometry and Appearance Representations + +In our network, the surface $S_{\theta}$ is explicitly modeled as the zero level set of a SDF, which is represented by a MLP $f$ in the network. We define $\theta$ the learnable parameters of $f$ . The MLP will take a query location $\mathbf{x}$ as input and output a distance from the query to the closest surface point. + +$$ +S _ {\theta} = \left\{\mathbf {x} \in \mathbb {R} ^ {3} \mid f (\mathbf {x}; \theta) = 0 \right\} \tag {1} +$$ + +Inspired by IDR [49], our scene appearance is represented by a surface light field using another MLP $g$ with learnable parameters $\phi$ . The surface light field takes the query surface point $\mathbf{x}$ , its normal vector $\mathbf{n}$ and the unit vector of the viewing ray $\mathbf{v}$ as input and outputs the RGB color $\mathbf{c}$ of the query. + +$$ +\mathbf {c} = g (\mathbf {x}, \mathbf {n}, \mathbf {v}; \phi) \tag {2} +$$ + +During the rendering, the intersection point of the viewing ray and the surface is obtained by sphere tracing, and the point normal can be calculated as the analytical gradient of the implicit surface $\mathbf{n} = \nabla_{\mathbf{x}}f(\mathbf{x};\theta)$ . + +Differentiable Surface Intersection The sphere tracing is not a differentiable operation in the network. Following previous works [30, 49], we construct the first order approximation of the function from network parameters to the intersection location. For the current network parameters $\theta_0$ , viewing ray $\mathbf{v}$ and the intersection point $\mathbf{x}_0$ on this ray, we take implicit differentiation on the equation $f(\mathbf{x};\theta)\equiv 0$ and the surface intersection can be expressed as a function of $\theta$ : + +$$ +\mathbf {x} (\theta) = \mathbf {x} _ {0} - \frac {f \left(\mathbf {x} _ {0} ; \theta\right) - f \left(\mathbf {x} _ {0} ; \theta_ {0}\right)}{\nabla_ {\mathbf {x}} f \left(\mathbf {x} _ {0} ; \theta_ {0}\right) \cdot \mathbf {v}} \mathbf {v} \tag {3} +$$ + +where $f(\mathbf{x}_0;\theta_0)$ and $\nabla_{\mathbf{x}}f(\mathbf{x}_0;\theta_0)$ are constants. + +# 3.2. Geometry Supervision + +Multi-view stereo algorithms are able to provide high-quality depth maps as a dense representation of the scene. In this section, we describe how to use MVS depth maps to supervise our SDF optimization. + +Multi-view Depth Map Estimation In our network, the MVS module aims to generate deep image features and qualified depth maps for all input images. We apply the open-sourced Vis-MVSNet [51] as our depth generation module. For a reference image $\mathbf{I}_0$ and its $N_v$ neighboring source images $\{\mathbf{I}_i\}_{i=1}^{N_v}$ , a standard UNet is first applied to extract deep image feature maps $\{\mathbf{F}_i\}_{i=0}^{N_v}$ . Then, all feature maps will be warped into the camera frustum of $\mathbf{I}_0$ and construct a 3D cost volume $\mathbf{C}$ . We further regularize the cost volume by 3D CNNs and obtain the probability distribution of the depth samples by softmax. Finally, the depth $\mathbf{D}_0$ is regressed from the probability volume by taking the depth expectation. In addition, for a pixel $\mathbf{p}$ in the depth map, we evaluate its probability sum $\mathbf{P}(\mathbf{p})$ around the predicted depth value as an indicator of the depth confidence [46]. Pixels with low confidence will be filtered out to generate a cleaned depth map. + +Direct SDF Supervision Previous work [30] proposes to train the implicit network by minimizing the difference between the traced depth map and the ground truth one. However, such strategy can only affect network outputs near the current surface estimation. To ensure the SDF to be correctly recovered in the whole space, we instead randomly sample points from the whole space and compute the distance from the sample point to the MVS depth map. + +![](images/9c225e38631ab6582f0838e69c452425c3efc5370f69eef831cdf3e4931a469d.jpg) +Figure 3. Approximated signed distance. + +Specifically, given a sample point $\mathbf{x}$ and a depth map $\mathbf{D}$ , we first project $\mathbf{x}$ to the depth map at location $\mathbf{p}$ . Then we backproject the MVS depth $\mathbf{D}(\mathbf{p})$ at the same location to the space as $\mathbf{x}_{\mathbf{D}}(\mathbf{p})$ . As is shown in Fig. 3, the signed distance from $\mathbf{x}$ to MVS surface is approximated as + +$$ +l (\mathbf {x}) = \operatorname {s g n} [ (\mathbf {x} _ {\mathbf {D}} (\mathbf {p}) - \mathbf {x}) \cdot \mathbf {v} ] (- \mathbf {n} _ {d} \cdot \mathbf {v}) \| \mathbf {x} _ {\mathbf {D}} (\mathbf {p}) - \mathbf {x} \| (4) +$$ + +where $\mathbf{n}_d$ is the normal calculated from depth. Also, if the probability sum $\mathbf{P}(\mathbf{p})$ is smaller than a threshold $T_{prob}$ , we consider this pixel as in the background and will exclude the corresponding point from the distance computation. This approximated signed distance can be used to supervise the SDF training, and we define the distance loss $L_{D}$ as: + +$$ +L _ {D} (\theta) = \frac {1}{| \mathbb {S} |} \sum_ {\mathbf {x} \in \mathbb {S}} | f (\mathbf {x}; \theta) - l (\mathbf {x}) | \tag {5} +$$ + +where $\mathbb{S}$ is the set of valid sample points. + +Signed Distance Fusion in a Mini-batch One problem of Eq. 5 is that the approximated signed distance $l(\mathbf{x})$ calculated from a single depth map is usually not reliable. First, a sample point in the free space may be occluded in a given view. Second, the approximated $l(\mathbf{x})$ may be inaccurate when non-planar surfaces occur. To improve the accuracy of $l(\mathbf{x})$ , we group $N_{b}$ views in a mini-batch during training, and $l(\mathbf{x})$ will be refined by fusing multiple observations from $N_{b}$ depth maps within the mini-batch. + +For a query point $\mathbf{x}$ , we first calculate its approximated signed distances $\{l_k(\mathbf{x})\}_{k=1}^{N_b}$ in each depth map. According to the sign of $l_k(\mathbf{x})$ , we define that a point is outside the surface if at least $T_{out}$ distances from $\{l_k(\mathbf{x})\}_{k=1}^{N_b}$ are positive. After the query point is determined to be inside or outside, we collect the per-view distance with the same sign and take the minimum depth distance as the absolute value of the fused distance $l(\mathbf{x})$ . We find that such simple fusion strategy can effectively filter out erroneous observations from single depth map, and the fused $l(\mathbf{x})$ is accurate enough to be used to guide the SDF optimization. + +# 3.3. Local Geometry Refinement + +The geometry supervision in Sec. 3.2 can correctly recover the surface topology. However, as depth maps from + +MVS networks are usually noisy, it is rather difficult to restore surface details in the final mesh reconstruction. To this end, we propose to optimize the feature consistency and the rendered image consistency during the network training. + +Feature Consistency In traditional MVS or mesh reconstruction pipelines, dense point clouds or mesh surfaces are usually refined via multi-view photo-consistency optimization [42, 5, 4, 22, 47]. The photo-consistency of a surface point is defined as the matching cost (e.g., ZNCC) among multiple views. In our work, note that deep image features have already been extracted in Vis-MVSNet. Inspired by [50], we instead minimize the multi-view deep feature consistency. + +Suppose a surface point $\mathbf{x}$ is obtained via ray tracing in view 0, we denote its projections in view 0 and its neighboring views as $\{\mathbf{p}_i\}_{i=0}^{N_v}$ . As these projections refer to the same 3D point in space, their deep image features should be consistent. The feature loss is defined as: + +$$ +L _ {F} (\theta) = \frac {1}{N _ {v} N _ {c}} \sum_ {i = 1} ^ {N _ {v}} \left| \mathbf {F} _ {0} \left(\mathbf {p} _ {0}\right) - \mathbf {F} _ {i} \left(\mathbf {p} _ {i}\right) \right| \tag {6} +$$ + +where $N_{c}$ is the number of feature channels, $\mathbf{p}_i = \mathbf{K}_i(\mathbf{R}_i\mathbf{x} + \mathbf{t}_i)$ is the projection of $\mathbf{x}$ in view $i$ and $[\mathbf{K}_i,\mathbf{R}_i,\mathbf{t}_i]$ the corresponding camera parameters. Deep image feature at pixel $\mathbf{p}_i$ , denoted as $\mathbf{F}_i(\mathbf{p_i})$ , is obtained by bilinear interpolation. To optimize the SDF via the feature consistency loss, we derived the gradient of $L_{F}(\theta)$ with respect to the network parameter $\theta$ as: + +$$ +\frac {\partial L _ {F} (\theta)}{\partial \theta} = \frac {\partial L _ {F}}{\partial \mathbf {x}} \cdot \frac {\partial \mathbf {x}}{\partial \theta} = \left(\sum_ {i = 0} ^ {N _ {v}} \frac {\partial L _ {F}}{\partial \mathbf {F} _ {i}} \frac {\partial \mathbf {F} _ {i}}{\partial \mathbf {p} _ {i}} \frac {\partial \mathbf {p} _ {i}}{\partial \mathbf {x}}\right) \cdot \frac {\partial \mathbf {x}}{\partial \theta} \tag {7} +$$ + +where $\partial \mathbf{F}_i / \partial \mathbf{p}_i$ is the gradient of the feature map. The last term $\partial \mathbf{x} / \partial \theta$ can be calculated from the derivative of Eq. 3. + +Compared with the render loss to be discussed in the next paragraph, the proposed feature loss introduces a photoconsistency constraint in an early stage of the whole differentiable rendering pipeline, which reduces the geometry and appearance ambiguity during the joint optimization. We show in ablation study that $L_{F}(\theta)$ can effectively increase the mesh reconstruction quality (see Tab. 3). + +**Rendered Image Consistency** The rendered image consistency is widely used in recent differentiable rendering pipelines [30, 29, 49]. For pixel $\mathbf{p}$ in the image, we can trace its surface intersection $\mathbf{x}$ in the space. The rendered color $\mathbf{c}(\mathbf{p})$ of pixel $\mathbf{p}$ can be directly fetched from the surface light field by feeding $\mathbf{x}(\theta), \nabla_{\mathbf{x}} f(\mathbf{x}; \theta)$ and $\mathbf{v}$ into function $g$ . The render loss is then calculated as the L1 distance from the rendered color to the input image color: + +$$ +L _ {R} (\theta , \phi) = \frac {1}{| \mathbb {S} _ {I} |} \sum_ {\mathbf {p} \in \mathbb {S} _ {I}} | \mathbf {c} (\mathbf {p}) - \mathbf {I} (\mathbf {p}) | \tag {8} +$$ + +![](images/b89eefd5d801b93b45fd19687506da2d8fbc776b12a30b7c17802022f5486d4c.jpg) + +![](images/f004e807a23eb27658921875f726eb93cc55b41f83b247c0f602dfedd9cad054.jpg) + +![](images/a7526c2772d713f8a539654c7a06be9012ea16d14f27a7beae26822a19da643e.jpg) +Colmap + +![](images/fb53737a01bc484f3e0527bf8148e491776000ffab7fdf5a021563c9e534a236.jpg) + +![](images/48a2cfb95539d95c6b50cd28d66a7a79e896717d4de72b9b5009115b8abe653a.jpg) + +![](images/63ae030c4cac6fb1a25d0aa224cf5c0657a2d05f125223b8706636a10fc8a1c2.jpg) +Vis-MVSNet + +![](images/d5991cb1840ad14490a80d6a848e774f2fdca90793f2f8f24f86d8f478b504a8.jpg) + +![](images/04e5a5791c1ada1721a8c9a63edbda8ba4e790d414c5a81160a12442cb52a6fc.jpg) + +![](images/3e7f005e1ca086756f6bc0ea844ac530d5997fbdfe0f3dde7662ad54a812bf3f.jpg) +IDR (perfect mask) + +![](images/e7c6f9ab7083972a6b4b757663cd3a4bcbc31513db9b94f98639ca7d9b4a17ef.jpg) + +![](images/94bf5fe21233e4eb452cb0761390a51e03e2abbaf92352279542106f9f1db492.jpg) + +![](images/2b887ed395e02ddf1ca899628f0fa3afd719327e5e2347c17c93421ede0d9a9b.jpg) +MVSDF (Ours) + +![](images/2dd5f79a17c994582d54d0199ee8ed20e5c320df1faa8fb226556c1073eaf889.jpg) + +![](images/3f1770b8836be7d742f46db0adb7c8e99f89ccb01f204bfdd1467cca7d74b2d7.jpg) + +![](images/67040c82f9f0847d886e16dd96ca802212e4e4534c278a1b02e6efbf01d6a606.jpg) +MVSDF (Ours) Render + +![](images/cb90da76cfa9a0acd5b3d08460ce90ef376632228281a95d2a90cc672b3c0a74.jpg) +Figure 4. Qualitative results on DTU dataset. Our method produces both high quality meshes and rendered images without requiring masks as input. + +![](images/2298899fd7eb76f08adb8f4ebc27e2da9cedfab35e08355e41862c7a7095c45f.jpg) +Figure 5. Illustration of surface indicator and mesh trimming. Extra surfaces are trimmed with a graph-cut based algorithm (Sec. 4.1) according to learned surface indicators (Sec. 3.4, green indicates accurate surface). + +where $\mathbb{S}_I$ denote the set of image pixels whose view ray can intersect the surface in the space. + +The render loss can jointly optimize the geometry $\theta$ and the appearance $\phi$ . Compared with $L_{F}$ , $L_{R}$ is more sensitive to local color changes, and plays an important role in recovering high-fidelity surface details. + +# 3.4. Valid Surface Indicator + +If input images cannot fully cover the object of interest, the surface of unseen areas will be not well defined, and will tend to produce extrapolated surfaces in the background areas. To distinguish such invalid surface, we use another indicator function to mark whether a space point can be traced from some input views. Specifically, function $h(\mathbf{x};\gamma)$ represents an indicator that $\mathbf{x}$ is in the valid surface. During each training iteration, indicators of successfully traced locations $\{\mathbf{x}^{+}\}$ are set to 1. To prevent $h(\mathbf{x};\gamma)$ reporting 1 + +everywhere, we also randomly sample points $\{\mathbf{x}^{-}\}$ in the space and set the background indicator to 0. We then apply the binary cross entropy as our indicator loss. + +$$ +L _ {P} (\gamma) = \sum_ {\mathbf {x} ^ {+}} - \log h \left(\mathbf {x} ^ {+}; \gamma\right) + \sum_ {\mathbf {x} ^ {-}} - \log \left(1 - h \left(\mathbf {x} ^ {-}; \gamma\right)\right) \tag {9} +$$ + +Note that our MVS depth map is filtered using the corresponding probability map and we will not apply ray tracing on those filtered pixels. As a result, filtered regions in MVS depth maps will tend to be assigned with the background indicator of 0. In other words, we could identify the invalid surface area according to filtered MVS depth maps. + +# 3.5. Loss + +Apart from the aforementioned losses, we further regularize our SDF by a Eikonal loss [11] that restricts the expectation of the gradient magnitude to be 1. + +$$ +L _ {E} (\theta) = \mathbb {E} _ {x \in \mathbb {R} ^ {3}} \left(\| \nabla_ {\mathbf {x}} f (\mathbf {x}; \theta) \| - 1\right) ^ {2} \tag {10} +$$ + +The final loss is expressed as a weighted sum of all the aforementioned losses. + +$$ +\begin{array}{l} L = w _ {R} L _ {R} (\theta , \phi) + w _ {F} L _ {F} (\theta) + w _ {D} L _ {D} (\theta) \tag {11} \\ + w _ {E} L _ {E} (\theta) + w _ {P} L _ {P} (\gamma) \\ \end{array} +$$ + +where the weight $w$ will be changed over the network training. Our training process is divided into three stages: 1) in the first stage $w_{D}$ is set to be dominant so as to determine the initial topology; 2) in the second stage, the significance of $w_{F}$ is increased to recover finer structures in the surface; 3) in the final stage, both $w_{D}$ and $w_{F}$ is decreased so that the render loss can restore fine-scale details of the surface. + +
Chamfer (mm)PSNR
Colmap [37]Vis-MVSNet [51]DVR [30]IDR [49]MVSDF (Ours)Colmap [37]Vis-MVSNet [51]DVR [30]IDR [49]MVSDF (Ours)
240.990.984.101.630.8318.4418.3516.2323.2925.02
372.352.104.541.871.7614.3714.7113.9321.3619.47
400.730.934.240.630.8819.2418.6018.1524.3925.96
550.530.462.610.480.4418.2719.0717.1422.9624.14
631.561.894.341.041.1119.9217.5517.8423.2222.16
651.010.672.810.790.9013.8017.1717.2323.9426.89
690.890.672.530.770.7521.2321.8116.3320.3426.38
831.141.082.931.331.2622.6723.1118.1021.8725.79
970.910.673.031.161.0218.1918.6816.6122.9526.22
1051.460.953.240.761.3520.4321.6818.3922.7127.29
1060.790.662.510.670.8720.7321.0317.3922.8127.78
1101.080.854.800.900.8417.9318.4114.4321.2623.82
1140.440.303.090.420.3419.0819.4217.0825.3527.79
1180.680.451.630.510.4722.0523.8519.0823.5428.60
1220.730.511.580.530.4622.0424.2921.0327.9831.49
Mean1.020.883.200.900.8819.2319.8517.2623.2025.92
+ +Table 1. Quantitative results on DTU dataset. Our method achieves the best mean Chamfer distance as Vis-MVSNet [51] and the highest PSNR score among all methods. + +# 4. Experiments + +# 4.1. Implementation + +Network Architecture The SDF is implemented by an 8-layer MLP with 512 hidden units and a skip connection in the middle. Positional encoding [29] is applied to input position to capture the high frequency information. This MLP simultaneously outputs the distance, the surface indicator probability and a descriptor of the location as an input of the surface light field function. Similarly, the surface light field is implemented by a 4-layer MLP with 512 hidden units. The function takes the point location, its descriptor, normal and viewing ray as input. Only the viewing direction is enhanced by positional encoding as the point descriptor has already included the rich positional information. In MVS module, we use one reference and two source images $(N_v = 2)$ as input to Vis-MVSNet, and will output deep feature $(N_c = 32)$ maps of all images and the reference depth map. The MVS module is pretrained on BlendedMVS [48] dataset and the parameters are fixed during training. + +Training For each input scene, the network is end-to-end trained for 10800 steps with a batch size of $N_{b} = 8$ . In each training step, 4096 pixels are uniformly sampled from each of the 8 images in the mini-batch for tracing surface intersections. Additionally, the same number of 3D points are sampled from the space to calculate the distance loss and the Eikonal loss. To recover correct topologies of thin structures, we need to sample more points near the object surface. This can be achieved by jittering surface points obtained from MVS depth maps. In distance fusion, the minimal number for outside decision $T_{out} = 2$ . The initial learning rate is $10^{-3}$ and is scaled down by 10 when reaching 4/6 and 5/6 of the whole training process. As mentioned in Sec. 3.5, weights of the losses are set according to the training stages. Please refer to the supplementary material for detailed setting. + +The memory consumption is related to batch size, number of samples per images and number of source images. For $DTU$ dataset, our training setting takes $\sim 20$ GB VRAM. And the whole training process takes 5.5 hours for one scan with 49 images on an NVidia RTX Titan. + +Mesh Extraction and Trimming After network training, a mesh can be extracted from the SDF in a predefined bounding box by the Marching Cube algorithm [26] with volume size of $512^{3}$ . For scenes whose camera trajectory does not surround the object (e.g., DTU dataset), extrapolated surfaces would appear in background areas, and we propose to filter these areas according to the surface indicator described in Sec. 3.4. We first evaluate the valid surface indicator for each mesh vertex, and assign each triangle an indicator score as the average score of its three vertices. Next, instead of deleting all triangles with low indicator scores, we propose a graph-cut based method to smoothly filter out those outlier surfaces. + +We define a graph $G = (V, E)$ over the mesh from Marching Cube, where each triangle represents a graph node $v \in V$ and each edge between two adjacent triangles represents a graph edge $e \in E$ . A source and a sink node $s, t \in V$ are also defined. Triangles are linked to $s$ with edge weights 1 if their indicator scores are greater than $T_{trim} = 0.94$ , or to $t$ otherwise. Adjacent triangles are also linked with weights 10 to encourage smoothness. After a min-cut of the constructed graph is obtained, the triangles linked with $t$ are removed. The proposed trimming algorithm can effectively filter out extrapolated background surfaces, as is illustrated in Fig. 5. + +# 4.2. Benchmark on DTU Dataset + +We first evaluate our method on the DTU MVS dataset. DTU dataset contains 128 scans captured in laboratory. For each scan, there are 49 calibrated cameras located on front side of the upper sphere surrounding the captured object. In this paper, we evaluate both the surface mesh and the + +![](images/f1bcbf80ce6130451646a379d2319ea4a9626b9ded9b2b03f24a1608bb93b17d.jpg) + +![](images/5515af2a2ee4dd5174718f782dd43c70a945093e95576c88a8debf58f44b3d4e.jpg) +Colmap + +![](images/a954a9ea5a3af2a81f558d3f026cd5911fd9943f17ea813da87fd588b48a360a.jpg) + +![](images/73206ea4e6f489afe4136c5118a70bb532b3e53a1e7139f1d048154a92c38139.jpg) +Vis-MVSNet + +![](images/adb5ab0fa5706952d14e969c1f22a33f400e1e8daf1fdd67e8bd38b1333b46ef.jpg) + +![](images/fc3d01e70287d2792e2a27330f0e8d883c23002af44d765a52190777afcab054.jpg) +IDR +Figure 6. Qualitative results on EPFL dataset. Our method is able to generate both high quality mesh and rendering results. + +![](images/deb7384c7c419ccb184a6d3840ded3bf859ca33d2f55e14d8e854f41685c557f.jpg) + +![](images/652d57c4d7719e19f0846562c879ba7d9ce7a47aa8c3a4098035204dad561908.jpg) +IDR (w/o wall) + +![](images/8acbb81a791789ab88110f233344336cfa29e06b0faf419cd643e50eeb5f50a8.jpg) + +![](images/f7de01b81d10a74f6ebdf5e7f5948cb1d9bc506b13282b919b032b8a2907d911.jpg) +MVSDF (Ours) + +
Chamfer (×10-2)PSNR
ColmapVis-MVSNetIDRMVSDF (Ours)ColmapVis-MVSNetIDRMVSDF (Ours)
Fountain-P116.356.1218.42 (7.88)6.8420.1724.3324.58 (23.43)25.27
Herzjesu-P88.997.4732.196.3816.1323.4524.7528.75
Mean7.676.8025.306.6118.1523.8924.6727.01
+ +Table 2. Quantitative results on EPFL dataset. Our method achieves the lowest mean Chamfer distance and the best PSNR score among all methods. Values in the parenthesis represent the results of IDR when the wall is excluded. + +rendered image using the same set of scans as in [49]. + +The reconstructed mesh model is evaluated by the Chamfer distance to the ground truth point cloud, and the rendered image is evaluated using the PSNR score to the input image. We compare our method to 1) Colmap [37], which represents state-of-the-art traditional MVS algorithms; 2) Vis-MVSNet [51], which represents state-of-the-art learning-based algorithms and 3) DVR [30] and IDR [49], which represent recent rendering based surface reconstruction methods. Depth maps from Colmap and Vis-MVSNet are fused into point clouds and converted into surface meshes by the screened Poisson surface reconstruction (sPSR) [17] with trim parameter 5. As Colmap and Vis-MVSNet do not estimate the surface texture, we follow [49] to assign color from input images when back projecting depth maps to point clouds. + +Quantitative results are shown in Tab. 1. The proposed method achieves the best mean Chamfer distance (0.88) and PSNR (25.92) among all methods. Qualitative results are shown in Fig. 4. Both our method and IDR are able to recover high-quality details in mesh surfaces. Compared to IDR, we have less distortions in reconstructed mesh surfaces. It is also noteworthy that our results are reconstructed without any manual masks. + +# 4.3. Benchmark on EPFL Dataset + +Our method is also evaluated on the EPFL dataset. EPFL dataset contains 2 outdoor scenes, Fountain-P11 and Herzjesu-P8, with ground truth meshes. We compare our method with Colmap, Vis-MVSNet and IDR. As Fountain-P11 and Herzjesu-P8 mainly consist of planar surfaces, they can not be well handled by the silhouette based methods. To + +fairly compare our method with IDR, for Fountain-P11, we also test the case where the wall is excluded from the masks. + +Qualitative results are shown in Fig. 6. Similar to $DTU$ , our method is able to produce both high-quality mesh and renderings. The mesh from IDR contains inflated surfaces, which is more serious when the wall is included in input masks. The reason is that there is a large gap between the mask visual hull and the real surface so the solution may stuck at local minimum in this unrestricted area. In contrast, the topology is correctly recovered in our reconstruction. For quantitative results shown in Tab. 2, our method achieves the best mean Chamfer distance (6.61) and PSNR (27.01) among all methods. + +# 4.4. Additional Qualitative Results + +We additionally provide qualitative results on Family and Horse in the Tanks and Temples [18] (Fig. 1,7) and two scenes in the BlendedMVS [48] dataset (Fig. 8). For Horse, as the foundation part is highly texture-less and reflective, the estimated point cloud from Vis-MVSNet is incomplete. Although surfaces can be interpolated in some extent during the mesh reconstruction, the output mesh is bumpy and the rendered image is rather noisy. In contrast, the proposed method is able to produce complete and accurate mesh surface together with realistic view-dependent rendering. + +# 4.5. Ablation Study + +In this section, we discuss how different losses in the network would affect the final geometry reconstruction. The following three settings are tested using the DTU dataset: 1) no feature: the feature loss is removed from the network by setting $w_{F} = 0$ ; 2) no render: the render loss is removed + +![](images/2f7ff7da7fe7a902c9e3bfa250a784da4a1881953793dfe32b86b93bb435c845.jpg) +Vis-MVSNet Point Cloud + +![](images/7197f396dd06ca6723de89480cdde7eb7d3a10785f689290e927056afc54dae5.jpg) +Vis-MVSNet Mesh + +![](images/6d568c18e435eabd2f1183d5b3eb1183a5e0d7c7b3d218110e193b9cd79b7ec2.jpg) +Vis-MVSNet Render + +![](images/e283f8645b465bef2f1a8cf01b545896b1143c9ed6bbd350b7689cb51dbb0f0a.jpg) +MVSDF (Ours) Mesh + +![](images/7e101efce3974a53768a6337b32834fa2e09cbc3fdd65a066d601bc2e43bb542.jpg) +MVSDF (Ours) Render + +![](images/c9692af1310639c109f68494e77ac4cc2015b1f3ba6395d334fb5bbe34f23c31.jpg) + +![](images/58b849b7a126af890c6ce79ba5585353b949dbf46f4967c459b28432cc514286.jpg) +Figure 7. Qualitative results on Tanks and Temples dataset. Traditional methods produce holes in texture-less and reflective regions. In contrast, our end-to-end system is able to reconstruct accurate mesh and rendering results in these areas. + +![](images/71db21c939ca07facfee261b97be5aaad9203a61c768b76d9399d7943ef5e5b1.jpg) +Figure 8. Qualitative results on BlendedMVS dataset. Meshes (upper) and rendered images (lower) of two scenes reconstructed by MVSDF are illustrated. + +![](images/7e6c21db436016d28a060d00c6ac89cf89a50e62fa0205291686077c6826678a.jpg) +Figure 9. Ablation study on training losses. Both the feature loss and the render loss are able to refine the surface geometry. Moreover, the reconstruction is more robust if the feature loss is applied. + +
LDLFLRMean Chamfer (mm)
distance only✓3.56
no render✓✓1.75
no feature✓✓1.06
full✓✓✓0.88
+ +Table 3. Quantitative results of ablation studies on DTU dataset. Both the feature loss and the render loss can improvement the mesh reconstruction quality. + +by setting $w_{R} = 0$ and 3) distance only: both the feature loss and the render loss are disabled $w_{R} = w_{F} = 0$ . + +Mesh surface results of different settings are illustrated in Fig. 9. We find that the feature loss (from distance only to no render) can successfully refine the surface, but is still coarse compared to the full setting. The render loss is able to refine the model to its finest detail level (from distance only to no feature), however, it is not as robust as the feature loss and will causes erroneous surface in the roof area. Quantitative results are shown in Tab. 3. Both the feature loss and the render loss can significantly boost the reconstruction quality, showing the effectiveness of each component of the proposed method. + +![](images/4454691cb16ce43a0d6bc70c3b95f2f07ee3e418890d41564c3963bc5943eec2.jpg) + +![](images/f3236c80b48f62eeca86d9580a81ec45e15b4548a9a4258108551a56ebd1a574.jpg) + +![](images/1416edf9e526c57c94b6bebbb89c15f8237a95bd2f2a346c19d80aa7e7000b42.jpg) +distance only +no feature + +![](images/fa7d8ef9a2ec76a47e9d8f6a51fbda0a07f784c897e288cea9afbc7bd30a8bc9.jpg) +no render +full + +# 5. Conclusion + +In this work, we introduce a novel neural surface reconstruction framework that combines implicit neural surface estimation with recent advanced MVS networks. In our network, the geometry and appearance are represented as neural implicit functions by MLPs. The geometry is directly supervised by MVS depth maps to recover the surface topology and is locally refined via deep feature consistency and rendered image loss. The proposed method has been extensively evaluated on different datasets. Both qualitative and quantitative results have shown that our method outperforms previous methods in terms of both geometry accuracy and rendering fidelity, demonstrating the effectiveness of the proposed framework. + +# 6. Acknowledgments + +This work is supported by Hong Kong RGC GRF 16206819, 16203518, T22-603/15N and Guangzhou Okay Information Technology with the project GZETDZ18EG05. + +# References + +[1] Michael Bleyer, Christoph Rhemann, and Carsten Rother. Patchmatch stereo-stereo matching with slanted support windows. In British Machine Vision Conference (BMVC), 2011. 2 +[2] Neill DF Campbell, George Vogiatzis, Carlos Hernández, and Roberto Cipolla. Using multiple hypotheses to improve depth-maps for multi-view stereo. In European Conference on Computer Vision (ECCV), 2008. 1 +[3] Robert T Collins. A space-sweep approach to true multi-image matching. In Computer Vision and Pattern Recognition (CVPR), 1996. 2 +[4] Amael Delaunoy and Marc Pollefeys. Photometric bundle adjustment for dense multi-view 3d modeling. In Computer Vision and Pattern Recognition (CVPR), 2014. 1, 4 +[5] Amael Delaunoy and Emmanuel Prados. Gradient flows for optimizing triangular mesh-based surfaces: Applications to 3d reconstruction problems dealing with visibility. International Journal of Computer Vision, 95(2):100-123, 2011. 1, 4 +[6] Yasutaka Furukawa and Carlos Hernández. Multi-view stereo: A tutorial. Foundations and Trends® in Computer Graphics and Vision, 9(1-2):1-148, 2015. 2 +[7] Yasutaka Furukawa and Jean Ponce. Carved visual hulls for image-based modeling. In European Conference on Computer Vision (ECCV), 2006. 1 +[8] Yasutaka Furukawa and Jean Ponce. Accurate, dense, and robust multiview stereopsis. IEEE transactions on Pattern Analysis and Machine Intelligence, 32(8):1362-1376, 2009. 1, 2 +[9] Silvano Galliani, Katrin Lasinger, and Konrad Schindler. Massively parallel multiview stereopsis by surface normal diffusion. In International Conference on Computer Vision (ICCV), 2015. 2 +[10] Michael Goesele, Brian Curless, and Steven M Seitz. Multiview stereo revisited. In Computer Vision and Pattern Recognition (CVPR), 2006. 2 +[11] Amos Gropp, Lior Yariv, Niv Haim, Matan Atzmon, and Yaron Lipman. Implicit geometric regularization for learning shapes. In International Conference on Machine Learning (ICML), 2020. 5 +[12] Xiaodong Gu, Zhiwen Fan, Siyu Zhu, Zuozhuo Dai, Feitong Tan, and Ping Tan. Cascade cost volume for high-resolution multi-view stereo and stereo matching. In Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[13] Po-Han Huang, Kevin Matzen, Johannes Kopf, Narendra Ahuja, and Jia-Bin Huang. Deepmvs: Learning multi-view stereopsis. In Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2 +[14] Rasmus Jensen, Anders Dahl, George Vogiatzis, Engil Tola, and Henrik Aanæs. Large scale multi-view stereopsis evaluation. In Computer Vision and Pattern Recognition (CVPR), 2014. 2 +[15] Abhishek Kar, Christian Häne, and Jitendra Malik. Learning a multi-view stereo machine. In Neural Information Processing Systems (NIPS), 2017. 1, 2 + +[16] Hiroharu Kato, Deniz Beker, Mihai Morariu, Takahiro Ando, Toru Matsuoka, Wadim Kehl, and Adrien Gaidon. Differentiable rendering: A survey. arXiv preprint arXiv:2006.12057, 2020. 2 +[17] Michael Kazhdan and Hugues Hoppe. Screened poisson surface reconstruction. ACM Transactions on Graphics (ToG), 32(3):1-13, 2013. 1, 2, 7 +[18] Arno Knapitsch, Jaesik Park, Qian-Yi Zhou, and Vladlen Koltun. Tanks and temples: Benchmarking large-scale scene reconstruction. ACM Transactions on Graphics (ToG), 36(4):78, 2017. 2, 7 +[19] Andreas Kuhn, Christian Sormann, Mattia Rossi, Oliver Erdler, and Friedrich Fraundorfer. Deepc-mvs: Deep confidence prediction for multi-view stereo reconstruction. In International Conference on 3D Vision (3DV), 2020. 2 +[20] Patrick Labatut, Jean-Philippe Pons, and Renaud Keriven. Efficient multi-view reconstruction of large-scale scenes using interest points, delaunay triangulation and graph cuts. In International Conference on Computer Vision (ICCV), 2007. 1, 2 +[21] Maxime Lhuillier and Long Quan. A quasi-dense approach to surface reconstruction from uncalibrated images. IEEE transactions on Pattern Analysis and Machine Intelligence, 27(3):418-433, 2005. 2 +[22] Shiwei Li, Sing Yu Siu, Tian Fang, and Long Quan. Efficient multi-view surface refinement with adaptive resolution control. In European Conference on Computer Vision (ECCV), 2016. 4 +[23] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. In Neural Information Processing Systems (NeurIPS), 2020. 2 +[24] Shichen Liu, Shunsuke Saito, Weikai Chen, and Hao Li. Learning to infer implicit surfaces without 3d supervision. In Neural Information Processing Systems (NeurIPS), 2019. 1, 2 +[25] Shaohui Liu, Yinda Zhang, Songyou Peng, Boxin Shi, Marc Pollefeys, and Zhaopeng Cui. Dist: Rendering deep implicit signed distance function with differentiable sphere tracing. In Computer Vision and Pattern Recognition (CVPR), 2020. 1, 2 +[26] William E Lorensen and Harvey E Cline. Marching cubes: A high resolution 3d surface construction algorithm. ACM siggraph computer graphics, 21(4):163-169, 1987. 1, 2, 6 +[27] Ricardo Martin-Brualla, Noha Radwan, Mehdi SM Sajjadi, Jonathan T Barron, Alexey Dosovitskiy, and Daniel Duckworth. Nerf in the wild: Neural radiance fields for unconstrained photo collections. In Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[28] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 +[29] Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In European Conference on Computer Vision (ECCV), 2020. 1, 2, 4, 6 + +[30] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable volumetric rendering: Learning implicit 3d representations without 3d supervision. In Computer Vision and Pattern Recognition (CVPR), 2020. 1, 2, 3, 4, 6, 7 +[31] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 +[32] Despoina Paschalidou, Osman Ulusoy, Carolin Schmitt, Luc Van Gool, and Andreas Geiger. Raynet: Learning volumetric 3d reconstruction with ray potentials. In Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2 +[33] Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. In European Conference on Computer Vision (ECCV), 2020. 1, 2 +[34] Jean-Philippe Pons, Renaud Keriven, and Olivier Faugeras. Multi-view stereo reconstruction and scene flow estimation with a global image-based matching score. International Journal of Computer Vision, 72(2):179–193, 2007. 1 +[35] Xuebin Qin, Zichen Zhang, Chenyang Huang, Chao Gao, Masood Dehghan, and Martin Jagersand. Basnet: Boundary-aware salient object detection. In Computer Vision and Pattern Recognition (CVPR), 2019. 2 +[36] Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In International Conference on Computer Vision (ICCV), 2019. 1 +[37] Johannes L Schonberger, Enliang Zheng, Jan-Michael Frahm, and Marc Pollefeys. Pixelwise view selection for unstructured multi-view stereo. In European Conference on Computer Vision (ECCV), 2016. 1, 2, 6, 7 +[38] Steven M Seitz, Brian Curless, James Diebel, Daniel Scharstein, and Richard Szeliski. A comparison and evaluation of multi-view stereo reconstruction algorithms. In Computer Vision and Pattern Recognition (CVPR), 2006. 2 +[39] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In Neural Information Processing Systems (NeurIPS), 2019. 1, 2 +[40] Christoph Strecha, Wolfgang Von Hansen, Luc Van Gool, Pascal Fua, and Ulrich Thoennessen. On benchmarking camera calibration and multi-view stereo for high resolution imagery. In Computer Vision and Pattern Recognition (CVPR), 2008. 2 +[41] Engin Tola, Christoph Strecha, and Pascal Fua. Efficient large-scale multi-view stereo for ultra high-resolution image sets. Machine Vision and Applications, 23(5):903-920, 2012. 1 +[42] Hoang-Hiep Vu, Patrick Labatut, Jean-Philippe Pons, and Renaud Keriven. High accuracy and visibility-consistent dense multiview stereo. IEEE transactions on Pattern Analysis and Machine Intelligence, 34(5):889–901, 2011. 1, 4 +[43] Fangjinhua Wang, Silvano Galliani, Christoph Vogel, Pablo Speciale, and Marc Pollefeys. Patchmatchnet: Learned + +multi-view patchmatch stereo. In Computer Vision and Pattern Recognition (CVPR), 2021. 2 +[44] Qingshan Xu and Wenbing Tao. Multi-scale geometric consistency guided multi-view stereo. In Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2 +[45] Youze Xue, Jiansheng Chen, Weitao Wan, Yiqing Huang, Cheng Yu, Tianpeng Li, and Jiayu Bao. Mvscrf: Learning multi-view stereo with conditional random fields. In International Conference on Computer Vision (ICCV), 2019. 1 +[46] Yao Yao, Zixin Luo, Shiwei Li, Tian Fang, and Long Quan. Mvsnet: Depth inference for unstructured multi-view stereo. In European Conference on Computer Vision (ECCV), 2018. 1, 2, 3 +[47] Yao Yao, Zixin Luo, Shiwei Li, Tianwei Shen, Tian Fang, and Long Quan. Recurrent mvsnet for high-resolution multiview stereo depth inference. In Computer Vision and Pattern Recognition (CVPR), 2019. 2, 4 +[48] Yao Yao, Zixin Luo, Shiwei Li, Jingyang Zhang, Yufan Ren, Lei Zhou, Tian Fang, and Long Quan. Blendedmvs: A large-scale dataset for generalized multi-view stereo networks. In Computer Vision and Pattern Recognition (CVPR), 2020. 6, 7 +[49] Lior Yariv, Yoni Kasten, Dror Moran, Meirav Galun, Matan Atzmon, Basri Ronen, and Yaron Lipman. Multiview neural surface reconstruction by disentangling geometry and appearance. In Neural Information Processing Systems (NeurIPS), 2020. 1, 2, 3, 4, 6, 7 +[50] Zehao Yu and Shenghua Gao. Fast-mvsnet: Sparse-to-dense multi-view stereo with learned propagation and gauss-newton refinement. In Computer Vision and Pattern Recognition (CVPR), 2020. 2, 4 +[51] Jingyang Zhang, Yao Yao, Shiwei Li, Zixin Luo, and Tian Fang. Visibility-aware multi-view stereo network. In British Machine Vision Conference (BMVC), 2020. 2, 3, 6, 7 +[52] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. Nerf++: Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020. 2 +[53] Ting Zhao and Xiangqian Wu. Pyramid feature attention network for saliency detection. In Computer Vision and Pattern Recognition (CVPR), 2019. 2 \ No newline at end of file diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/images.zip b/learningsigneddistancefieldformultiviewsurfacereconstruction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..81016034ea4514a19fdaffef83bfd288429a2c14 --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05500d19f63cd594274b834610dd16c042ff635c3a71baf0ce31561bfe49cd35 +size 660662 diff --git a/learningsigneddistancefieldformultiviewsurfacereconstruction/layout.json b/learningsigneddistancefieldformultiviewsurfacereconstruction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..69fd1ada1a54920779988b1fd478aa0c5cae2b5e --- /dev/null +++ b/learningsigneddistancefieldformultiviewsurfacereconstruction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bca5b43a78305837a5e5e7aaf7f33ed3168d21dec49adc493540f951fa6fc60 +size 476841 diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_content_list.json b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9fc7c4a0a3c600b973c601b28a563751297ed8e6 --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73600de83294949cc1c7ffeda7f5d812512f23d6991eada829d89a8447cf9ad7 +size 86115 diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_model.json b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_model.json new file mode 100644 index 0000000000000000000000000000000000000000..15b99e7c450792e8936f37dc11571032d6464bd9 --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8570ef26777701f815649983008f9a669eb740fe297cc84744aa57c88fde54f +size 105418 diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_origin.pdf b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e13305c9c70b95ab209eca1ecee3bb3d532f974a --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/215663cf-c947-4a6c-9427-64eb12e35d87_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5dbbe38ef580722ca539282ef9df3f9b6e8bb5f66ffbddfef221c126f755541 +size 826387 diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/full.md b/learningskeletalgraphneuralnetworksforhard3dposeestimation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8ddf805b3cd529c9c9266f5ca5c18f7f5ae78185 --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/full.md @@ -0,0 +1,345 @@ +# Learning Skeletal Graph Neural Networks for Hard 3D Pose Estimation + +Ailing Zeng1, Xiao Sun2, Lei Yang3, Nanxuan Zhao1, Minhao Liu1, Qiang Xu1 +1The Chinese University of Hong Kong +2Microsoft Research Asia, 3Sensetime Group Ltd. + +# Abstract + +Various deep learning techniques have been proposed to solve the single-view 2D-to-3D pose estimation problem. While the average prediction accuracy has been improved significantly over the years, the performance on hard poses with depth ambiguity, self-occlusion, and complex or rare poses is still far from satisfactory. In this work, we target these hard poses and present a novel skeletal GNN learning solution. To be specific, we propose a hop-aware hierarchical channel-squeezing fusion layer to effectively extract relevant information from neighboring nodes while suppressing undesired noises in GNN learning. In addition, we propose a temporal-aware dynamic graph construction procedure that is robust and effective for 3D pose estimation. Experimental results on the Human3.6M dataset show that our solution achieves $10.3\%$ average prediction accuracy improvement and greatly improves on hard poses over state-of-the-art techniques. We further apply the proposed technique on the skeleton-based action recognition task and also achieve state-of-the-art performance. Our code is available at https://github.com/ailingzengzz/Skeletal-GNN. + +# 1. Introduction + +Single-view skeleton-based 3D pose estimation problem plays an important role in numerous applications, such as human-computer interaction, video understanding, and human behavior analysis. Given the 2D skeletal positions detected by a 2D keypoint detector (e.g., [3, 26, 37]), this task aims to regress the 3D positions of the corresponding joints. It is a challenging task and has drawn lots of attention from academia in recent years. Even though the average performance increases steadily over the years, the prediction errors on some poses are still quite high. + +Fig. 1 shows some examples in a widely used dataset, Human3.6M [9]. Some actions (e.g., "Sit" and "Sit Down") contain many poses with depth ambiguity, self-occlusion, or complex poses. Also, there inevitably exist some poses rarely seen in the training dataset. Similar to the definition of hard examples in object detection [16] and semantic seg + +mentation [14], we collectively regard those poses with high prediction errors as hard poses. + +Early attempts [23, 28] simply use fully-connected networks (FCN) to lift the 2D keypoints into 3D space. However, the dense connection of FCN is prone to overfit, leading to relatively poor performance. To tackle this problem, geometric dependencies are incorporated into the network in [7, 27, 38, 45], which significantly improve prediction accuracy. As articulated human body can be naturally modeled as a graph, with the recent development of graph neural networks (GNN) [10, 12, 1, 40, 46], various GNN-based methods [48, 6, 19, 2, 50] are proposed in the literature for 2D-to-3D pose estimation. + +GNN-based solutions naturally capture the relationship between body joints. For a target node, aggregating features from its neighboring nodes facilitates bringing in semantic information to relieve the uncertainty in estimating its 3D position. In other words, for the estimation of a particular node in the graph (e.g., left hand), both its direct neighbor (i.e., left elbow) and other nodes that are multiple hops away in the graph (e.g., left shoulder and even right foot in some poses) may provide useful information that contributes to the position estimation of the target node, and the learning of skeletal graph neural networks is to capture such context information for better 2D-to-3D pose estimation. However, existing GNN-based solutions do not fully tap the potential of the skeleton graph. The reasons are two-fold: + +- The power of graph neural networks lies in the aggregation of neighboring nodes, which, however, contributes both useful information and undesired noises. On the one hand, aggregating distant nodes in the skeletal graph does provide useful information; On the other hand, the more distant the nodes, the more likely undesired noises are introduced into the aggregation procedure. Existing works do not consider such signal-to-noise issues in message passing over the GNN. +- The relationship between body joints varies with different poses. For example, for poses in "running", the hand-foot joints are closely related, while for poses in "Sitting", there is no such strong relationship. It is rather difficult to capture such information with a static + +![](images/efb7c1ea1aaf057cd72410c2bb16df78b25a7006ba6ac2eff963af7e9e51e9e3.jpg) +Figure 1: The examples of two easy poses, one moderate pose, and four kinds of hard poses in 2D-to-3D pose estimation with 2D detected poses as inputs (shown in the images). Although rapid progress has been made in this field, both non-graph methods and graph-based ones yield large prediction error on these hard poses. + +skeleton graph across all poses. + +This work proposes novel skeletal GNN learning solutions to mitigate the above problems, especially for hard poses. Our contributions are summarized as follows: + +- We propose a hop-aware hierarchical channel-squeezing fusion layer to extract relevant information from neighboring nodes effectively while suppressing undesired noises. This is inspired by the feature squeezing works [49, 43, 44], wherein channel size is reduced to keep valuable information in each layer. Specifically, we squeeze long-range context features (i.e., information from distant nodes) and fuse them with short-range features in a hierarchical manner. +- Inspired by GNN-based action recognition work [35, 42, 20], we build dynamic skeletal graphs, wherein the edges between nodes are not only from the fixed human skeleton topology but also the node features to capture action-specific poses. To cope with the change of dynamic graphs over time and relieve outliers from frame-level features, we further integrate temporal cues into the learning process of dynamic graphs. The proposed temporal-aware dynamic graph construction procedure is robust and effective for 2D-to-3D pose estimation. + +We conduct experiments on Human3.6M dataset [9], and the proposed solution outperforms state-of-the-art techniques [45] in 3D pose estimation by $10.3\%$ on average, and greatly improves on hard poses. Compared to state-of-the-art GNN-based solutions, we surpass [6] by $16.3\%$ . As the proposed method is a plug-and-play module, we further integrate it into the skeleton-based action recognition framework, achieving state-of-the-art performance. + +# 2. Preliminaries and Motivation + +This work focuses on GNN-based 3D pose estimation. We first describe the general skeletal GNN construction + +![](images/d290ef9112a4b050d19ea50c553b7b743d6a3fb48f62e2d0f7989f58563c6859.jpg) +Figure 2: The illustration of a skeletal graph with human physical edges and action-specific dynamic edges. + +procedure in Sec. 2.1. Next, we discuss existing GNN-based solutions for 3D pose estimation in Sec. 2.2. Finally, Sec. 2.3 motivates this work. + +# 2.1. Skeletal Graph Neural Network + +The human skeleton can be naturally modeled as a graph as shown in Fig. 2(a). The nodes in the graph represent the 2D positions of human joints, and the edges between two joints denote bone connections. Hop- $k$ demonstrates the shortest path $k$ between two nodes. For instance, take node 1 (right shoulder) as the target node, node 2 (right elbow) and node 3 (neck) are its hop-1 neighbors (masked in dark blue); while nodes 4 (right hand), 5 (head), 6 (left shoulder), and 7 (spine) are its hop-2 neighbors (masked in light blue). + +In a graph neural network, adjacency matrix determines the information passing among nodes, and the objective of the learning procedure is to obtain each node's features by aggregating features from its neighboring nodes. As hop- $k$ increases during message passing, the information passed from the corresponding neighbors varies from short-range context to long-range context. + +# 2.2. GNN-Based 3D Human Pose Estimation + +Recently, various GNN-based methods [48, 6, 2, 18, 19, 50] are proposed in the literature for 3d pose estimation. As + +weight sharing strategy restricts the representation power, a locally connected network (LCN) [6] is proposed to learn the weight of each node individually for enhancing the representation differences among nodes, achieving better generalization capability. + +High-order GCN [50] explores different aggregation methods on high-order neighbors to capture the long-range dependencies among nodes. However, it may introduce more noises from less-related nodes without differentiating the impacts between short-range and long-range contexts. + +Furthermore, some recent works [48, 6] try to learn the edge weights of the skeletal graph. However, without changing the graph topology, the effectiveness of such a dynamic solution is limited, especially for rare poses. + +# 2.3. Observation and Motivation + +Fig. 1 shows the prediction accuracy of recent 3D pose estimation methods [23, 31, 45, 19, 50]. As can be observed from this figure, most of them suffer from poor performance for some complex actions, such as, "Sit," "Sit Down," and "Take Photos." We attribute this phenomenon to that these hard poses require both short-range and long-range context information for better estimation. Meanwhile, existing solutions do not fuse them effectively in the learning process. + +Distant neighbors pass not only valuable semantic information but also irrelevant noise. Existing GNN-based methods try to aggregate the semantic information in both short-range and long-range neighbors. However, they ignore that the messages passed from distant neighbors also contain irrelevant noise. For example, "Walking" has a clear pattern, which contains strong correlation between arm and leg. Intuitively, we need to take both of them into account. However, due to some personalized style, besides the action pattern, there is also some heterogeneous noise. Therefore, it is necessary to suppress such irrelevant noise. Interestingly, through experiments, we observe that such noise is sensitive to the channel dimension. The channel dimension can constrain the amount of information and noise passed among nodes in a skeleton graph. In other words, an effective channel squeezing strategy could filter out undesired noise while keeping valuable information. Consequently, we propose a hop-aware hierarchical channel-squeezing transform on long-range features to improve aggregation effectiveness in skeletal GNN learning. + +Dynamic graph construction is useful but should be delicately designed. Existing GNN-based methods construct the graph based on the physical skeleton topology [6, 48], like Fig. 2(a). However, the strong hidden relationships among nodes vary with actions. By constructing a dynamic graph as shown in Fig. 2(b), such a relationship might be more useful than physical features. Although the dynamic graphs seem intuitive for representing different motion-specific relations, it usually seems vulnerable to the + +![](images/265914971187f18fd17a25adabe5103cb69d423ac6ed7bf7444952f92ef83a49.jpg) +Figure 3: The framework of our method. The key is a specially designed module called Dynamic Hierarchical Channel-Squeezing Fusion layer (D-HCSF), shown in Fig. 4 with details. + +single-frame outliers. Thus, we introduce temporal information to make dynamic graph learning robust. + +# 3. Method + +In this work, our goal is to reduce errors of 3D human pose estimation, especially on hard poses. More specifically, given 2D keypoints $X \in \mathbb{R}^{N \times 2}$ , with $N$ nodes, the model outputs better 3D positions $Y \in \mathbb{R}^{N \times 3}$ . The framework is designed based on the observations and motivations in Sec. 2.3, and shown in Fig 3. The core of our framework is the module: a Dynamic Hierarchical Channel-Squeezing Fusion Layer (D-HCSF) shown in Fig 4. It contains a hierarchical channel-squeezing fusion scheme for updating features of each node (Fig 4), and a temporal-aware dynamic graph learning component for updating the dynamic graph. + +In this section, we first revisit the formulation of generic GCN [10] and LCN [6] in Sec. 3.1. Then, we introduce our hierarchical channel-squeezing fusion scheme in Sec. 3.2. Finally, we propose the dynamic graph learning and consider temporal-aware strategy in this process in Sec 3.3. + +# 3.1. Vanilla Graph Neural Network + +Given a graph $\mathcal{G} = (\mathcal{V},\mathcal{E})$ , it consists of the nodes $\mathcal{V}$ and the edges $\mathcal{E}$ . We revisit a generic GCN [10] layer defined as follows: + +$$ +\mathbf {H} = \sigma (\hat {\mathbf {A}} \mathbf {X} \mathbf {W}), \tag {1} +$$ + +where $\mathbf{A} \in \mathbb{R}^{N \times N}$ is an adjacency matrix with $N$ nodes, indicating the connections between nodes. If the joint $j$ is dependent on the joint $i$ , then $a_{ij} = 1$ . Otherwise, the connections are set to zero $a_{ij} = 0$ . We denote the input node features as $\mathbf{X} \in \mathbb{R}^{N \times C_{in}}$ , the learnable weight matrix as $\mathbf{W} \in \mathbb{R}^{C_{in} \times C_{out}}$ , and the activation function as $\sigma(\cdot)$ . For simplification, we ignore the $\sigma(\cdot)$ in the following formulas. + +The GCN's representation power is limited by weight sharing strategy in node regression problem, while Ci et al. [6] propose a locally connected network (LCN), which introduces the node-wise trainable parameters to enhance the differences among node features. This aggregation scheme learns different relations among different nodes. Accordingly, we recap its basic formulation. For clarity purposes, we take the embedding learning of node $i$ from the direct neighbors in a layer as an example: + +![](images/52598b924baa0383afe6876320adab5499376aefd7c03760541095c293467936.jpg) +Figure 4: The architecture of our Dynamic Hierarchical Channel-Squeezing Fusion (D-HCSF) layer under $k$ hops. Each dotted box consists of two streams: a weighted graph learning branch based on fixed physical edges (blue lines) and a dynamic graph learning branch to update the graph based on the node features adaptively (orange lines). + +$$ +\mathbf {h} _ {i} = \sum_ {j \in \mathcal {N} _ {1, i}} \left(\hat {a} _ {i j} \mathbf {x} _ {j} \mathbf {W} _ {i j}\right), \tag {2} +$$ + +where $\mathcal{N}_{1,i}$ contains the self-node and direct neighbors (hop=1) of the node $i$ . We denote $\hat{a}_{ij}$ as the value of $i_{th}$ row and $j_{th}$ column in the adjacency matrix $\hat{\mathbf{A}}$ , which distinctly aggregates features among neighbors. $\mathbf{x}_j$ is the inputs of the neighbor $j$ . $\mathbf{W}_{ij} \in \mathbb{R}^{C_{in} \times C_{out}}$ denotes the learnable weights between the node pair $(i,j)$ , and $\mathbf{h}_i$ is the updated features of the node $i$ . Hence, the final output $\mathbf{H}$ is represented by the concatenation of all node features. + +# 3.2. Hierarchical Channel-Squeezing Fusion Layer + +Inspired by the first observation in Sec. 2.3, we find (i) hierarchical spatial features are important to capture better short-to-long range context; (ii) distinguishing short-range and long-range context in fusion strategies is necessary to relieve irrelevant long-range context while keeping their essential components in hard pose estimation. Thus, as illustrated in Fig. 5 (c), we propose a hierarchical channel-squeezing fusion layer to reach the above hypothesis. + +Hierarchical fusion layer. Accordingly, we take node-wise aggregation LCN [6] as a baseline. To capture different ranges in spatial context, we generalize Eq. 2 by modifying + +the direct neighbors $\mathcal{N}_{1,i}$ to hop- $k$ neighbors $\mathcal{N}_{k,i}$ . Then, we can get updated features $\mathbf{h}_{k,i}$ from hop- $k$ neighbors. + +To integrate multi-hop features in a layer, we propose a hierarchical fusion block as follows. It consists of two parts. First, we consider the short-range features $\mathbf{h}_{S,i}$ within hop- $S$ , which contain the most essential context of the target node $i$ . We thus keep the whole information without squeezing them. We then define a farthest hop $L$ to obtain the potentially useful information as a set of long-range context $\mathcal{H}_{L,i}$ defined as: + +$$ +\mathbf {h} _ {S, i} = \sum_ {j \in \mathcal {N} _ {S, i}} \left(\hat {a} _ {i j} \mathbf {x} _ {j} \mathbf {W} _ {i j}\right), \tag {3} +$$ + +$$ +\mathcal {H} _ {L, i} = \left\{\mathbf {h} _ {k, i} | k = S + 1, \dots , L \right\}, \tag {4} +$$ + +where $S$ is less than or equal to $L$ , set empirically. + +To fuse features from different contexts, we introduce two fusion functions, namely $\mathcal{F}_k$ and $\mathcal{F}_a$ , to form a two-stage procedures. $\mathcal{F}_k$ first transforms a set of long-range features $\mathcal{H}_{L,i}$ to obtain a fused long-range features $\mathbf{h}_{L,i}$ and then $\mathcal{F}_a$ fuses $\mathbf{h}_{L,i}$ with short-range features $\mathbf{h}_{S,i}$ to get output $\mathbf{h}_{a,i}$ . We refer to such two-step fusion scheme as hierarchical fusion block. Finally, we process the feature $\mathbf{h}_{a,i}$ through a transformation $\mathbf{W}_a$ to obtain an final output $\mathbf{h}_i$ with pre-defined dimension. Formally, the final output $\mathbf{h}_i$ of this fusion layer is defined as: + +$$ +\mathbf {h} _ {i} = \mathcal {F} _ {a} \left[ \mathbf {h} _ {S, i}, \mathcal {F} _ {k} \left(\mathcal {H} _ {L, i}\right) \right] \mathbf {W} _ {a}. \tag {5} +$$ + +Channel-Squeezing block. To retain useful information while suppressing the irrelevant information of long-range context, we hypothesize that the context contains less relevant information. Hence, we propose a set of bottleneck transformations, named Channel-Squeezing Blocks to filter irrelevance by an end-to-end learning scheme. + +To reach the above hypothesis, we distinguish the learnable matrix $\mathbf{W}_{ij} \in \mathbb{R}^{C_{in} \times C_{k,out}}$ from its output size $C_{k,out}$ of long-range context $\mathcal{H}_{L,j}$ . Moreover, based on the theoretical Information Gain (IG) analysis on the hop- $k$ [8] measured by the average KL-divergence, where the information gain $\mathrm{IG}(k)$ of hop $k$ always fits well on the function $a e^{-bk}$ , where $a, b > 0$ . It means the information gain from long-range context will be decreased exponentially. In our condition, we propose a simplified relation function to decide the output size $C_{k,out}$ for each long-range context to reflect the decay of useful information as $k$ increases. + +$$ +C _ {k, \text {o u t}} = d ^ {(k - L)} * C _ {\text {i n}}, \tag {6} +$$ + +where $d \in [0,1]$ indicates the channel squeezing ratio, and $k \in [S + 1,L]$ . For short-range context $\mathbf{h}_{S,i}$ , the output channels of $\mathbf{W}_{i,j}$ keep the same as $C_{in}$ without squeezing to reduce the loss of useful features. Compared with Eq. 2, LCN is a special kind of HCSF module when $C_{k,out}$ is a constant across hops, and $\mathcal{F}_k, \mathcal{F}_a$ are summations. + +![](images/58bbcb770a8464498bfd8fbd396fe89a838f2b432cdec8807d182013e58f415b.jpg) +(a) Graph Convolution Network + +![](images/2ec7b9f88c0604dae6035d4fd12097958b27a42012671fbe6bf84989302af9c4.jpg) +(b) Locally Connected Network +Figure 5: The architectures of (a) Graph Convolution Network (GCN) [10], (b) Locally Connected Network (LCN) [6], and (c) Our Hierarchical Channel-Squeezing Fusion (HCSF). We take the feature updating of node 1 as an example. The index of the node corresponds to Fig. 2. + +![](images/10928b5fec51ad941a5aea938e10b1e141ccd71afb22da67e3fa5dcd516e4741.jpg) +(c) Hierarchical Channel-Squeezing Fusion + +Please noted that the HCSF layer could also adapt to other graph-based frameworks, like GCN [10], PreAgg, Post-Agg [19], the difference lies in weight sharing schemes, which is orthogonal to our approach. + +# 3.3. Temporal-aware Dynamic Graph Learning + +In this subsection, we present a framework when dealing with dynamic skeleton topology. Based on the second observation in Sec. 2.3, with a static graph, the model is hard to properly reflect the relations, especially for hard poses. + +Learning dynamic graph. We learn the dynamic graph from two streams, where one is to update by physical skeleton topology, and the other is to update through features of nodes. For the first stream (Fig. 4 blue lines), we initialize the graph $\mathbf{M}_k$ as the physical skeleton topology following SemGCN [48]. Then, this graph will be updated during training. After training, this graph $\mathbf{M}_k$ keeps fixed during inference and reflects the distribution of the whole dataset. + +As the poses change, the connections should be varied during testing to capture motion-specific relations. Hence, we introduce a scheme for the second stream (Fig. 4 orange lines) to learn the graph from input features dynamically. Then, the graph can be adapted to the input pose during the inference. The input feature $\mathbf{X}$ is separately transformed by $\mathbf{W}_{k,\theta}$ and $\mathbf{W}_{k,\phi}$ for each branch. After multiplying two transformed features, we obtain a $N\times N$ matrix indicating relations among nodes. + +$$ +\mathbf {O} _ {k} = \mathcal {F} \left\{\left[ (\mathbf {X}) ^ {t r} \mathbf {W} _ {k, \theta} \right] \left[ \left(\mathbf {W} _ {k, \phi}\right) ^ {t r} \mathbf {X} \right] \right\}, \tag {7} +$$ + +where $\mathcal{F}$ denotes the activation function (i.e., $\mathrm{Tanh}$ ), and $tr$ denotes the transpose of a matrix. The output $\mathbf{O}_k$ generates unique connections changing adaptively with input $\mathbf{X}$ . + +Since learning dynamic graphs directly from input features may be sensitive to outliers (e.g., jitter and missing joints). We regard $\mathbf{O}_k$ as dynamic offsets to refine the weighted graph $\mathbf{M}_k$ . Hence, the final formulation of the dynamic graph of Hop- $k$ is as follows: + +$$ +\mathbf {A} _ {k} = \mathbf {M} _ {k} + \alpha \mathbf {O} _ {k}, \tag {8} +$$ + +where $\alpha$ is a learnable scalar to adjust the scale of dynamic offsets. Then, we can aggregate the hop- $k$ features by $\mathbf{A}_k$ , and the following fusion block is the same as Eq. 5. + +Temporal-aware dynamic graph. The connections between nodes may naturally vary over space and time, and the frame-level dynamic graph will suffer from unstable inputs, it is potential to optimize the dynamic graph learning process combining spatial and temporal context as a whole. In terms of introducing temporal information, the input will add a time dimension, where $\mathbf{X} \in \mathbb{R}^{C_{in} \times T_{in} \times N}$ . + +We develop a temporal-aware scheme in Eq. 7. Instead of only applying linear transformations in spatial domain, we integrate temporal context by 1D temporal convolution layer with a kernel size of $1 \times F$ . It can smooth and filter the spatial outliers in input $\mathbf{X}$ to make the learning process robust. + +# 4. Experiment + +In this section, we perform experimental studies to demonstrate the effectiveness of the proposed solution. + +# 4.1.3D Human Pose Estimation + +# 4.1.1 Data Description + +- Human3.6M [9] consists of 3.6 million video frames with 15 actions from 4 camera viewpoints, where accurate 3D human joint positions are captured from high-speed motion capture system. Following previous works [6, 2, 45, 23], we adopt the standard cross-subject protocol with 5 subjects (S1, S5, S6, S7, S8) as training set and another 2 subjects (S9, S11) as test set. It is commonly evaluated by two metrics, namely the mean per joint position error (MPJPE) with 17 joints of each subject and the Procrustes Analysis MPJPE (PA-MPJPE) to relieve the inherent scale, rotation, and translation problems. + +-MPI-INF-3DHP [24, 25] contains both constrained indoor scenes and complex outdoor scenes, covering a greater diversity of poses and actions, where it is usually taken as a cross-dataset setting to verify the generalization ability of the proposed methods. For evaluation, we follow common + +
MethodDirectDiscussEatGreetPhonePhotoPosePurcha.SitSitDSmokeWaitWalkDWalkWalkTAvg.
Luvizon et al. [22]63.864.056.964.862.170.459.860.171.691.760.965.151.363.255.464.1
Martinez et al. [23]51.856.258.159.069.578.455.258.174.094.662.359.165.149.552.462.9
Park et al.[27]49.454.351.655.061.073.353.750.068.588.758.656.857.846.248.658.6
Wang et al. [38]47.456.449.455.758.067.346.046.067.7102.457.057.341.161.440.758.0
Zhao et al. [48]†47.360.751.460.561.149.947.368.186.255.067.861.042.160.645.357.6
Zou et al. [50]†49.054.552.353.659.271.649.649.866.075.555.153.858.540.945.455.6
Liu et al. [19]†48.453.649.653.657.370.651.850.762.874.154.152.658.241.545.054.9
Ci et al. [6]†46.852.344.750.452.968.949.646.460.278.951.250.054.840.443.352.7
Liu et al. [18]†46.352.247.350.755.567.149.246.060.471.151.550.154.540.343.752.4
Pavlo et al. [28]47.150.649.051.853.661.449.447.459.367.452.449.555.339.542.751.8
Cai et al. [2]†46.548.847.650.952.961.348.345.859.264.451.248.453.539.241.250.6
Zeng et al. [45]44.548.247.147.851.256.850.145.659.966.452.145.354.239.140.349.9
Ours-HCSF †43.449.745.147.650.757.547.145.956.561.149.847.151.435.837.848.4
Ours-HCSF w/A†43.150.443.945.346.157.046.347.656.361.547.747.453.535.437.347.9
Martinez et al. [23]37.744.440.342.148.254.944.442.154.658.045.146.447.636.440.445.5
Pham et al. [31]36.643.238.140.844.451.843.738.450.852.042.142.244.032.335.942.4
Zhao et al. [48]†37.849.437.640.945.141.440.148.350.142.253.544.340.547.339.043.8
Wang et al. [38]35.641.339.440.044.251.739.840.250.955.443.142.945.133.137.842.0
Liu et al. [19]†36.240.833.936.438.347.339.934.541.350.838.140.140.030.333.038.7
Liu et al. [18]†36.840.333.036.337.545.039.734.940.347.737.438.538.629.632.037.8
Ci et al. [6]†36.338.829.737.834.642.539.832.536.239.534.438.438.231.334.236.3
Zeng et al. [45]32.934.527.631.733.542.535.129.538.945.933.334.934.426.527.133.9
Ours-HCSF †29.034.127.331.728.834.834.427.333.538.930.432.329.724.625.230.8
Ours-HCSF w/A †26.833.226.730.030.836.731.527.433.138.030.831.830.323.925.030.4
+ +Table 1: Comparison of single-frame 3D pose estimation in terms of MPJPE on Human3.6M. Works above the double line show results from detected 2D poses, and the below results are from 2D ground truth inputs to explore the upper bound of these methods. We highlight the graph-based methods by $\dagger$ . w/A denotes using dynamic graphs. Best results in bold. + +practice [6, 38, 45] by using the Percentage of Correct Keypoints (PCK) with a threshold of $150\mathrm{mm}$ and the Area Under Curve (AUC) for a range of PCK thresholds. + +# 4.1.2 Method Comparison + +In terms of the frames of inputs, single-view 3D pose estimation can be divided into single-frame and temporal settings. We first compare our HCSF module and Dynamic graph learning with other previous works under the single-frame setting. Then, we extend to the temporal setting to compare related works with our Temporal-aware dynamic graph learning with HCSF scheme. + +Comparison with Single-frame methods. As shown in Tab. 1, we compare our methods with other baselines. Under the standard protocol with $2D$ detected inputs [3], our methods can improve the graph-based method [2] from $50.6\mathrm{mm}$ to $47.9\mathrm{mm}$ (relative $5.3\%$ improvement), and surpass the non-graph based method [45] by $2.0\mathrm{mm}$ (relative $4.0\%$ improvement). Since the results of 2D detected poses would affect uncertainty, it is better to consider using 2D ground truth as input to explore the upper bound of these methods. Accordingly, with $2D$ ground truth inputs, our proposed model improves the graph-based state-of-the-art [6] from $36.3\mathrm{mm}$ to $30.4\mathrm{mm}$ (relative $16.3\%$ improvement). Although LCN [6] aggregates long-range $(L = 3)$ information to relieve depth ambiguities, it ignores the fact that distant joints may bring more disruptions while they still contain certain useful information. The proposed HCSF module considers this effect by squeezing the different hop features into different latent spaces and then hierarchically fusing them. Moreover, our method surpasses state-of-the-art non-GNN method [45] by $3.5\mathrm{mm}$ (relative + +$10.3\%$ improvement), which further proves the effectiveness among the general methods. + +Comparison with Temporal methods. We compare with temporal methods with nine frames as inputs and Tab. 2 shows the comparison in terms of average error. For all methods, we select their reported results with similar input frames for comparison. The result shows that the proposed method can outperform previous approaches consistently. With temporal-aware dynamic graph construction, the proposed solution further improves the result by $0.7\mathrm{mm}$ . + +Improvements on hard poses. As discussed earlier, we define hard poses as those with high prediction errors and they are model-specific. That is, while hard poses have some inherent characteristics (e.g., depth ambiguity and self-occlusion), they are handled differently with different models [6, 48, 45, 50]. Consequently, one pose that exhibits large errors on one model may show satisfactory results on another model and vice versa (we show more detailed analyses in the supplemental material). However, statistically speaking, if a model handles hard poses better, it would have the following properties: (1) those actions with high prediction errors would be improved more; (2) the proportion of poses with high errors would be smaller; (3) the upper bound of high-error poses would be smaller. + +Compared with state-of-the-art solution [45], our method reduces the prediction errors by $7.9\mathrm{mm}$ , $6.1\mathrm{mm}$ , $5.8\mathrm{mm}$ , and $5.8\mathrm{mm}$ (relative $17.2\%$ , $18.5\%$ , $14.9\%$ , $13.6\%$ improvements) on the actions "SitDown", "Direct", "Sit" and "Photo", respectively. The average improvement of the hard poses is $16.1\%$ in Tab. 1. Next, in Fig. 6, we compare the error distribution in the test set with four existing solutions [23, 48, 6, 45]. We can observe that there are much fewer poses with high prediction errors with our proposed + +
MethodHossain et al. [33]Lee et al. [11]Pavllo et al. [28]Cai et al. [2]Lin et al. [15]Ours w/o TOurs
MPJPE (mm)58.352.849.848.848.846.445.7
+ +solution. Specially, there are only $3.6\%$ cases with MPJPE above $60\mathrm{mm}$ with our solution, while it is more than $6\%$ with all the other methods. In fact, the number of cases with MPJPE above $40\mathrm{mm}$ is consistently lower, and the number of cases with MPJPE less than $30\mathrm{mm}$ is consistently higher with our solution than that with other methods. + +![](images/d759e229ec6412cbe972808be484bb330825adc0a133cb7289c733424a56c746.jpg) +Figure 6: MPJPE distribution on the testset of Human3.6M. + +Last, we present the mean errors for the top $5\%$ hardest poses of five methods in Fig. 7, ours is $70.7mm$ , which is $13.8\%$ and $17.1\%$ smaller than the SOTA methods LCN $(82.0mm)$ and SRNet $(85.3mm)$ , respectively. + +![](images/5bcd9d6a64193827324498f085daf4c0ddf55e6314a8b4083036fd1a210ad391.jpg) +Figure 7: Mean-Error comparison of the $5\%$ Hardest Poses. + +We also show visualization results in Fig. 8, compared with SOTA methods (upper LCN, below SRNet). In summary, the above results demonstrate the benefits of the proposed technique on hard poses. + +Comparison on MPI-INF-3DHP. We further test our model trained with the Human3.6M dataset on the MPI-INF-3DHP dataset to verify its generalization capability. Tab. 3 shows about $5.5\%$ improvements on all metrics over related methods. + +Table 2: Comparison on temporal 2D detected poses input with similar input frames (5, 3, 9, 7, 10, 9, 9 frames, individually) for comparison. The noted w/o $T$ denotes using dynamic graphs without temporal-aware scheme. + +
MethodFCN [23]OriNet [21]LCN [6]SRNet [45]Ours
Outdoor31.265.777.380.384.6 ↑5.4%
All PCK42.565.674.077.682.1 ↑5.8%
All AUC17.033.236.743.846.2 ↑5.5%
+ +![](images/c650894a2e1f7d763317d15d1bcfd1f1d0f92052d4a690e2bf8dd93952bac345.jpg) +Figure 8: Qualitative results of hard poses. 3D ground truth, SOTA methods, and ours are black, red, blue in order. + +![](images/0a943b274dcde3427e3dd9f0ef78d921002f2bf4dd8c455656949a8ed48e0a7b.jpg) + +Table 3: Cross-dataset results on MPI-INF-3DHP. + +
L23456
Non-hierarchy37.236.237.737.439.9
Hierarchy w/o hop-aware34.634.234.735.436.2
Hierarchy-32.632.933.734.4
+ +Table 4: Comparison of aggregating without hierarchy strategy (Non-hierarchy), with hierarchy scheme but regarding all hops information equally (Hierarchy w/o hop-aware) and our full design (Hierarchy). + +# 4.2. Ablation Study + +To study some important design choices in the proposed method, we take 2D ground truth poses as inputs and adopt MPJPE as an evaluation metric for analysis. + +Impact of hierarchical fusion. Tab. 4 shows that (1) two hierarchical design consistently outperforms Non-hierarchy by $2\mathrm{mm} \sim 3.7\mathrm{mm}$ under different $L$ , indicating that it is not appropriate to fuse long-range and short-range information in a single stage; (2) without considering different contributions from different hops, the performance of Hierarchy w/o hop-aware is inferior to Hierarchy, leading to a consistent performance drop of $1.6\mathrm{mm} \sim 1.8\mathrm{mm}$ . It illustrates that the importance of processing long-range contexts according to hops. We fix $S = 1$ , $d = 1/16$ by default. + +Impact of squeezing ratio $d$ . We set $S = 1, L = 2$ to study the influence of the squeezing ratio $d$ . Tab. 6 shows that as $d$ decreases, the corresponding MPJPE first decreases and then increases. As $d$ controls the output channel size of different hop features, the small value of $d$ indicates the small output dimension for channel-squeezing transform. The decrease of $d$ may first reduce the irrelevant information from long-range context, and thus reducing the pose estimation error. When $d$ takes an extreme value $\frac{1}{16}$ , the useful information may also be substantially squeezed, leading to a performance drop. + +Impact of $S$ and $L$ . As shown in Tab. 7, $S = 1$ yields consistently good results under different $L$ . As features + +
MethodBaselineabcdefg
AkoriOnly Mk(ori)Only Mk(dense)Only Mk(rand)Only OkMk+OkEq. 8Eq. 8 w/T
MPJPE(mm)30.832.135.740.844.330.530.429.7
+ +Table 5: Comparison on the effects of dynamic graph learning $\mathbf{A}$ . ori is the static graph with physical connections. Baseline takes $\mathbf{A}_k$ as ori. Only $\mathbf{M}_k(\cdot)$ denotes applying $\mathbf{M}_k$ with different initialization. Only $\mathbf{O}_k$ keeps the dynamic offset in Eq. 8. $\mathbf{M}_k + \mathbf{O}_k$ equals to set $\alpha = 1$ in Eq. 8. $w / T$ represents the temporal-aware scheme defined in Sec. 3.3. + +
d11/21/41/81/16
MPJPE (mm)35.434.733.831.432.6
+ +within hop- $S$ will not be squeezed, it is in line with our intuition that the direct neighbors provide the most relevant information to the target node. Besides, a random combination of $S$ and $L$ surpasses the strong baseline LCN [6], demonstrating the effectiveness of our design. + +Impact of the dynamic graph learning In Sec. 3.3, we introduce a dynamic graph $\mathbf{A}_k$ consisting of a learnable graph $\mathbf{M}_k$ and a graph offset $\mathbf{O}_k$ learned from input features. As Tab. 5a, 5b and 5c illustrate, the initialization of the dynamic graph learning is important. The result shows that it is hard for all connected initialization (Tab. 5b) and random (Tab. 5c) to converge well. On the other hand, taking the physical topology as an initial graph (Tab. 5a) can achieve better results (32.1mm). Only learning the dynamic offsets (Tab. 5d) leads to severe performance drop. Relying only on input features may weaken its capability of dealing with data noise. + +Tab. 5e adds the weighted graph $\mathbf{M}_k$ and dynamic offsets $\mathbf{O}_k$ , obtaining a $0.3\mathrm{mm}$ performance gain over baseline. Moreover, although the dynamic graph shows priority in representing different motion-specific relations, it is usually vulnerable to the single-frame outliers. After considering the temporal context, we can further improve the baseline from $30.8\mathrm{mm}$ to $29.7\mathrm{mm}$ . + +# 4.3. Skeleton-based Action Recognition + +As a plug-and-play module, we integrate the proposed HCSF layer and temporal-aware dynamic graph learning into skeleton-based action recognition. Given a sequence of human skeleton coordinates in videos, this task categorizes them into a predefined action class. We conduct experiments on two commonly used datasets, namely, NTU RGB+D 60 [34] and NTU RGB+D 120 [17]. Due to the limits of contents, we leave detailed datasets, implementation details, and ablation study in the supplemental material. + +Following related works [41, 35, 36, 20, 5, 42], we employ a GNN model with ten spatial-temporal convolution neural layers as the baseline framework. We adopt the pro + +Table 6: Influence of the squeezing ratio $d$ . + +
L123456
S=035.534.634.834.735.436.1
S=1-32.633.434.034.735.7
S=2--34.935.135.636.2
LCN [6]38.035.736.237.737.439.9
+ +posed framework shown in Fig. 3 to this task by changing the final regression branch into classification branch. Our results use the multi-stream framework as in [36, 5]. Single stream results are in the supplemental material. + +Tab. 8 shows that our solution outperforms SOTA on both benchmarks. In particular, the top-1 accuracy is $89.2\%$ and $87.5\%$ in the X-Set and X-Sub settings on the more complex dataset [17], surpassing state-of-the-art solutions irrespective of the fact that they employ sophisticated attention modules [36] and temporal-dilated combinations in each layer [20]. Our method can construct robust dynamic relations through the proposed HCSF layer and temporal-aware scheme. Therefore, those inherent relations among joints are better captured, enhancing the capability to distinguish different actions. + +Table 7: The influence of the hop- $S$ and the hop- $L$ . + +
MethodNTU RGB+D 60NTU RGB+D 120
X-Sub (%)X-View (%)X-Sub (%)X-Set (%)
ST-GCN [41]84.392.771.372.4
AS-GCN [13]86.894.277.778.9
SGN [47]89.094.579.281.5
2s-AGCN [35]88.995.182.984.9
NAS-GCN [29]89.495.7--
Mix-dim [30]89.796.080.583.2
ST-Transformer [32]89.396.182.784.7
MS-AAGCN [36]90.096.2--
Shift-GCN [5]90.796.585.987.6
MMDGCN [39]90.896.586.888.0
DecoupleGCN [4]90.896.686.588.1
MS-G3D [20]91.596.286.988.4
Ours91.696.787.589.2
+ +Table 8: Comparison against state-of-the-art methods on the NTU RGB+D 60 and 120 Skeleton dataset in terms of Top-1 accuracy(%) . Best results in bold. + +# 5. Conclusion + +In this work, we explore a novel skeleton-based representation learning method for better dealing with hard poses in 3D pose estimation. The proposed Hierarchical Channel-Squeezing Fusion module can encode short-range and long-range contexts, keeping essential information while reducing irrelevant noises. Besides, we learn dynamic graphs that adaptively evolved based on the input poses rather than relying on a fixed pre-defined graph. Our method surpasses all non-graph methods by $10.3\%$ and enhances the effectiveness of graph-based methods. We hope that our method would inspire the field of skeleton-based representation learning. + +# Acknowledgements + +This work was supported in part by the Innovation and Technology Fund (ITF) under Grant No. MRP/022/20X, Innovation and Technology Commission, Hong Kong S.A.R. + +# References + +[1] Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. arXiv preprint arXiv:1905.00067, 2019. 1 +[2] Yujun Cai, Liuhao Ge, Jun Liu, Jianfei Cai, Tat-Jen Cham, Junsong Yuan, and Nadia Magnenat Thalmann. Exploiting spatial-temporal relationships for 3d pose estimation via graph convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2272-2281, 2019. 1, 2, 5, 6, 7 +[3] Yilun Chen, Zhicheng Wang, Yuxiang Peng, Zhiqiang Zhang, Gang Yu, and Jian Sun. Cascaded pyramid network for multi-person pose estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7103-7112, 2018. 1, 6 +[4] Ke Cheng, Yifan Zhang, Congqi Cao, Lei Shi, Jian Cheng, and Hanqing Lu. Decoupling gcn with dropgraph module for skeleton-based action recognition. In Proceedings of the European Conference on Computer Vision (ECCV), 2020. 8 +[5] Ke Cheng, Yifan Zhang, Xiangyu He, Weihan Chen, Jian Cheng, and Hanqing Lu. Skeleton-based action recognition with shift graph convolutional network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 183-192, 2020. 8 +[6] Hai Ci, Chunyu Wang, Xiaoxuan Ma, and Yizhou Wang. Optimizing network structure for 3d human pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2262-2271, 2019. 1, 2, 3, 4, 5, 6, 7, 8 +[7] Hao-Shu Fang, Yuanlu Xu, Wenguan Wang, Xiaobai Liu, and Song-Chun Zhu. Learning pose grammar to encode human body configuration for 3d pose estimation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. 1 +[8] Li S, Gao Z, Lin H. Lookhops: light multi-order convolution and pooling for graph classification. arXiv preprint arXiv:2012.15741, 2020. 4 +[9] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3. 6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE transactions on pattern analysis and machine intelligence, 36(7):1325-1339, 2013. 1, 2, 5 +[10] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. 1, 3, 5 +[11] Kyoungoh Lee, Inwoong Lee, and Sanghoon Lee. Propagating LSTM: 3d pose estimation based on joint interdependency. In Proceedings of the European Conference on Computer Vision (ECCV), pages 119-135, 2018. 7 +[12] Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. Deep GCNs: Can GCNs go as deep as cnns? In Proceedings of the IEEE International Conference on Computer Vision, pages 9267-9276, 2019. 1 +[13] Maosen Li, Siheng Chen, Xu Chen, Ya Zhang, Yanfeng Wang, and Qi Tian. Actional-structural graph convolutional + +networks for skeleton-based action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3595-3603, 2019. 8 +[14] Xiaoxiao Li, Ziwei Liu, Ping Luo, Chen Change Loy, and Xiaou Tang. Not all pixels are equal: Difficulty-aware semantic segmentation via deep layer cascade. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3193-3202, 2017. 1 +[15] Jiahao Lin and Gim Hee Lee. Trajectory space factorization for deep video-based 3d human pose estimation. arXiv preprint arXiv:1908.08289, 2019. 7 +[16] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. 1 +[17] Jun Liu, Amir Shahroudy, Maurizio Lisboa Perez, Gang Wang, Ling-Yu Duan, and Alex Kot Chichung. Ntu rgb+d 120: A large-scale benchmark for 3d human activity understanding. IEEE transactions on pattern analysis and machine intelligence, 2019. 8 +[18] Kenkun Liu, Rongqi Ding, Zhiming Zou, Le Wang, and Wei Tang. A comprehensive study of weight sharing in graph networks for 3d human pose estimation. In Proceedings of the European Conference on Computer Vision (ECCV), 2020. 2, 6 +[19] Kenkun Liu, Zhiming Zou, and Wei Tang. Learning global pose features in graph convolutional networks for 3d human pose estimation. In Proceedings of the Asian Conference on Computer Vision, 2020. 1, 2, 3, 5, 6 +[20] Ziyu Liu, Hongwen Zhang, Zhenghao Chen, Zhiyong Wang, and Wanli Ouyang. Disentangling and unifying graph convolutions for skeleton-based action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 143-152, 2020. 2, 8 +[21] Chenxu Luo, Xiao Chu, and Alan Yuille. Orinet: A fully convolutional network for 3d human pose estimation. arXiv preprint arXiv:1811.04989, 2018. 7 +[22] Diogo C Luvizon, David Picard, and Hedi Tabia. 2d/3d pose estimation and action recognition using multitask deep learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5137-5146, 2018. 6 +[23] Julieta Martinez, Rayat Hossain, Javier Romero, and James J Little. A simple yet effective baseline for 3d human pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2640-2649, 2017. 1, 3, 5, 6, 7 +[24] Dushyant Mehta, Helge Rhodin, Dan Casas, Pascal Fua, Oleksandr Sotnychenko, Weipeng Xu, and Christian Theobalt. Monocular 3d human pose estimation in the wild using improved cnn supervision. In 2017 international conference on 3D vision (3DV), pages 506-516. IEEE, 2017. 5 +[25] Dushyant Mehta, Srinath Sridhar, Oleksandr Sotnychenko, Helge Rhodin, Mohammad Shafiei, Hans-Peter Seidel, Weipeng Xu, Dan Casas, and Christian Theobalt. Vnect: Real-time 3d human pose estimation with a single rgb camera. ACM Transactions on Graphics (TOG), 36(4):1-14, 2017. 5 + +[26] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In European conference on computer vision, pages 483-499. Springer, 2016. 1 +[27] Suntheon Park and Nojun Kwak. 3d human pose estimation with relational networks. arXiv preprint arXiv:1805.08961, 2018. 1, 6 +[28] Dario Pavllo, Christoph Feichtenhofer, David Grangier, and Michael Auli. 3d human pose estimation in video with temporal convolutions and semi-supervised training. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7753-7762, 2019. 1, 6, 7 +[29] Wei Peng, Xiaopeng Hong, Haoyu Chen, and Guoying Zhao. Learning graph convolutional network for skeleton-based human action recognition by neural searching. In AAAI, pages 2669-2676, 2020. 8 +[30] Wei Peng, Jingang Shi, Zhaoqiang Xia, and Guoying Zhao. Mix dimension in poincaré geometry for 3d skeleton-based action recognition. In Proceedings of the 28th ACM International Conference on Multimedia, pages 1432-1440, 2020. 8 +[31] Huy Hieu Pham, Houssam Salmane, Louahdi Khoudour, Alain Crouzil, Pablo Zegers, and Sergio A Velastin. A unified deep framework for joint 3d pose estimation and action recognition from a single rgb camera. arXiv preprint arXiv:1907.06968, 2019. 3, 6 +[32] Chiara Plizzari, Marco Cannici, and Matteo Matteucci. Spatial temporal transformer network for skeleton-based action recognition. arXiv preprint arXiv:2008.07404, 2020. 8 +[33] Mir Rayat Imtiaz Hossain and James J Little. Exploiting temporal information for 3d human pose estimation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 68-84, 2018. 7 +[34] Amir Shahroudy, Jun Liu, Tian-Tsong Ng, and Gang Wang. Ntu rgb+ d: A large scale dataset for 3d human activity analysis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1010-1019, 2016. 8 +[35] Lei Shi, Yifan Zhang, Jian Cheng, and Hanqing Lu. Skeleton-based action recognition with multi-stream adaptive graph convolutional networks. arXiv preprint arXiv:1912.06971, 2019. 2, 8 +[36] Lei Shi, Yifan Zhang, Jian Cheng, and Hanqing Lu. Skeleton-based action recognition with multi-stream adaptive graph convolutional networks. IEEE Transactions on Image Processing, 29:9532-9545, 2020. 8 +[37] Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5693-5703, 2019. 1 +[38] Luyang Wang, Yan Chen, Zhenhua Guo, Keyuan Qian, Mude Lin, Hongsheng Li, and Jimmy S Ren. Generalizing monocular 3d human pose estimation in the wild. arXiv preprint arXiv:1904.05512, 2019. 1, 6 +[39] Hailun Xia and Xinkai Gao. Multi-scale mixed dense graph convolution network for skeleton-based action recognition. IEEE Access, 2021. 8 + +[40] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. arXiv preprint arXiv:1806.03536, 2018. 1 +[41] Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. arXiv preprint arXiv:1801.07455, 2018. 8 +[42] Fanfan Ye, Shiliang Pu, Qiaoyong Zhong, Chao Li, Di Xie, and Huiming Tang. Dynamic gcn: Context-enriched topology learning for skeleton-based action recognition. arXiv preprint arXiv:2007.14690, 2020. 2, 8 +[43] Jiahui Yu and Thomas Huang. Autoslim: Towards one-shot architecture search for channel numbers. arXiv preprint arXiv:1903.11728, 2019. 2 +[44] Ailing Zeng, Minhao Liu, Zhiwei Liu, Ruiyuan Gao, and Qiang Xu. Hop-aware dimension optimization for graph neural networks. arXiv preprint arXiv:2105.14490, 2021. 2 +[45] Ailing Zeng, Xiao Sun, Fuyang Huang, Minhao Liu, Qiang Xu, and Stephen Lin. Snet: Improving generalization in 3d human pose estimation with a split-and-recombine approach. arXiv preprint arXiv:2007.09389, 2020. 1, 2, 3, 5, 6, 7 +[46] Li Zhang, Yan Ge, and Haiping Lu. Hop-hop relation-aware graph neural networks. arXiv preprint arXiv:2012.11147, 2020. 1 +[47] Pengfei Zhang, Cuiling Lan, Wenjun Zeng, Junliang Xing, Jianru Xue, and Nanning Zheng. Semantics-guided neural networks for efficient skeleton-based human action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1112-1121, 2020. 8 +[48] Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris N Metaxas. Semantic graph convolutional networks for 3d human pose regression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3425-3435, 2019. 1, 2, 3, 5, 6 +[49] Hui Zhu, Zhulin An, Chuanguang Yang, Xiaolong Hu, Kaiqiang Xu, and Yongjun Xu. Rethinking the number of channels for the convolutional neural network. arXiv preprint arXiv:1909.01861, 2019. 2 +[50] Zhiming Zou, Kenkun Liu, Le Wang, and Wei Tang. High-order graph convolutional networks for 3d human pose estimation. BMVC, 2020. 1, 2, 3, 6 \ No newline at end of file diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/images.zip b/learningskeletalgraphneuralnetworksforhard3dposeestimation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..90568a973d65fb7d753bafa40a6dacdd2a7809ef --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a542499ac30b26edc23d826e91dd1d209bc79cfb72e4ce0d4be358ef06a0b33 +size 622128 diff --git a/learningskeletalgraphneuralnetworksforhard3dposeestimation/layout.json b/learningskeletalgraphneuralnetworksforhard3dposeestimation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2cc6c9f5c4d1ad8e9e6e6979b52de31291006abe --- /dev/null +++ b/learningskeletalgraphneuralnetworksforhard3dposeestimation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec20160247f878c4ff66e4754b15644798323f0e263975639000fa5a798dd2e5 +size 487726 diff --git a/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_content_list.json b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f79e2068d7a09d214a0bf9ec442b41cd5192c752 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07bef74a6433acc1845d0fb55b685f52af8318d8559f930a245643655da0e33e +size 80025 diff --git a/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_model.json b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3d3c15dde519fc52f39a0cd8d3c0ed14cf4673e6 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da4c21fb691977689348b8d57aa82f15e8b902a7f263201c1c5494419eb2676b +size 101980 diff --git a/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_origin.pdf b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..463dbbdf243d19ecf4880597bd7a5171a3374943 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/92c6108d-3982-4806-b5cb-91ad324a3ed8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1de5f2cd9b5b0c3f06f7871e0461be42394d5ba8c424f6b12777b62da394b38f +size 624910 diff --git a/learningspatiotemporaltransformerforvisualtracking/full.md b/learningspatiotemporaltransformerforvisualtracking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0b342bd1c5b17a169387cdfcdca5f5f4314670f3 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/full.md @@ -0,0 +1,298 @@ +# Learning Spatio-Temporal Transformer for Visual Tracking + +Bin Yan $^{1,\ast}$ , Houwen Peng $^{2,\dagger}$ , Jianlong Fu $^{2}$ , Dong Wang $^{1,\dagger}$ , Huchuan Lu $^{1}$ $^{1}$ Dalian University of Technology + $^{2}$ Microsoft Research Asia + +# Abstract + +In this paper, we present a new tracking architecture with an encoder-decoder transformer as the key component. The encoder models the global spatio-temporal feature dependencies between target objects and search regions, while the decoder learns a query embedding to predict the spatial positions of the target objects. Our method casts object tracking as a direct bounding box prediction problem, without using any proposals or predefined anchors. With the encoder-decoder transformer, the prediction of objects just uses a simple fully-convolutional network, which estimates the corners of objects directly. The whole method is end-to-end, does not need any postprocessing steps such as cosine window and bounding box smoothing, thus largely simplifying existing tracking pipelines. The proposed tracker achieves state-of-the-art performance on multiple challenging short-term and long-term benchmarks, while running at real-time speed, being $6 \times$ faster than Siam R-CNN [54]. Code and models are open-sourced at https://github.com/researchmm/Stark. + +# 1. Introduction + +Visual object tracking is a fundamental yet challenging research topic in computer vision. Over the past few years, based on convolutional neural networks, object tracking has achieved remarkable progress [28, 11, 54]. However, convolution kernels are not good at modeling long-range dependencies of image contents and features, because they only process a local neighborhood, either in space or time. Current prevailing trackers, including both the offline Siamese trackers and the online learning models, are almost all built upon convolutional operations [2, 44, 3, 54]. As a consequence, these methods only perform well on modeling local relationships of image content, but being limited to capturing long-range global interactions. Such deficiency may degrade the model capacities for dealing with the scenarios where the global contextual information is important + +![](images/0bf10466c38175314cb4809e0783bf40aed8ae0209dc69ee85ebdd7266c8b46d.jpg) +Figure 1: Comparison with state-of-the-arts on LaSOT [15]. We visualize the Success performance with respect to the Frames-Per-Seconds (fps) tracking speed. The circle size indicates a weighted sum of the tracker's speed (x-axis) and success score (y-axis). The larger, the better. Ours-ST101 and Ours-ST50 indicate the proposed trackers with ResNet-101 and ResNet-50 as backbones, respectively. Better viewed in color. + +for localization, such as the objects undergoing large-scale variations or getting in and out of views frequently. + +The problem of long-range interactions has been tackled in sequence modeling through the use of transformer [53]. Transformer has enjoyed rich success in tasks such as natural language modeling [13, 46] and speech recognition [40]. Recently, transformer has been employed in discriminative computer vision models and drawn great attention [14, 5, 41]. Inspired by the recent DEtction TRansformer (DETR) [5], we propose a new end-to-end tracking architecture with encoder-decoder transformer to boost the performance of conventional convolution models. + +Both spatial and temporal information are important for object tracking. The former one contains object appearance information for target localization, while the latter one includes the state changes of objects across frames. Previous Siamese trackers [28, 59, 16, 7] only exploit the spatial information for tracking, while online methods [63, 66, 11, 3] use historical predictions for model updates. Although being successful, these methods do not explicitly model the relationship between space and time. In this work, considering the superior capacity on modeling global dependencies, we resort to transformer to integrate spatial and temporal + +information for tracking, generating discriminative spatiotemporal features for object localization. + +More specifically, we propose a new spatio-temporal architecture based on the encoder-decoder transformer for visual tracking. The new architecture contains three key components: an encoder, a decoder and a prediction head. The encoder accepts inputs of an initial target object, the current image, and a dynamically updated template. The self-attention modules in the encoder learn the relationship between the inputs through their feature dependencies. Since the template images are updated throughout video sequences, the encoder can capture both spatial and temporal information of the target. The decoder learns a query embedding to predict the spatial positions of the target object. A corner-based prediction head is used to estimate the bounding box of the target object in the current frame. Meanwhile, a score head is learned to control the updates of the dynamic template images. + +Extensive experiments demonstrate that our method establishes new state-of-the-art performance on both short-term [20, 43] and long-term tracking benchmarks [15, 25]. For instance, our spatio-temporal transformer tracker surpasses Siam R-CNN [54] by $3.9\%$ (AO score) and $2.3\%$ (Success) on GOT-10K [20] and LaSOT [15], respectively. It is also worth noting that compared with previous long-term trackers [9, 54, 62], the framework of our method is much simpler. Specifically, previous methods usually consist of multiple components, such as base trackers [11, 57], target verification modules [23], and global detectors [47, 21]. In contrast, our method only has a single network learned in an end-to-end fashion. Moreover, our tracker can run at real-time speed, being $6\times$ faster than Siam R-CNN (30 v.s. 5 fps) on a Tesla V100 GPU, as shown in Fig. 1 + +Considering recent trends of over-fitting on small-scale benchmarks, we collect a new large-scale tracking benchmark called NOTU, integrating all sequences from NFS [24], OTB100 [58], TC128 [33], and UAV123 [42]. + +In summary, this work has four contributions. + +- We propose a new transformer architecture dedicated to visual tracking. It is capable of capturing global feature dependencies of both spatial and temporal information in video sequences. +- The whole method is end-to-end, does not need any postprocessing steps such as cosine window and bounding box smoothing, thus largely simplifying existing tracking pipelines. +- The proposed trackers achieve state-of-the-art performance on five challenging short-term and long-term benchmarks, while running at real-time speed. +- We construct a new large-scale tracking benchmark to alleviate the over-fitting problem on previous small-scale datasets. + +# 2. Related Work + +Transformer in Language and Vision. Transformer is originally proposed by Vaswani et al. [53] for machine translation task, and has become a prevailing architecture in language modeling. Transformer takes a sequence as the input, scans through each element in the sequence and learns their dependencies. This feature makes transformer be intrinsically good at capturing global information in sequential data. Recently, transformer has shown their great potential in vision tasks like image classification [14], object detection [5], semantic segmentation [56], multiple object tracking [51, 41], etc. Our work is inspired by the recent work DETR [5], but has following fundamental differences. (1) The studied tasks are different. DETR is designed for object detection, while this work is for object tracking. (2) The network inputs are different. DETR takes the whole image as the input, while our input is a triplet consisting of one search region and two templates. Their features from the backbone are first flattened and concatenated then sent to the encoder. (3) The query design and training strategies are different. DETR uses 100 object queries and uses the Hungarian algorithm to match predictions with groundtruths during training. In contrast, our method only uses one query and always matches it with the ground-truth without using the Hungarian algorithm. (4) The bounding box heads are different. DETR uses a three-layer perceptron to predict boxes. Our network adopts a corner-based box head for higher-quality localization. + +Moreover, TransTrack [51] and TrackFormer [41] are two most recent representative works on transformer tracking. TransTrack [51] has the following features. (1) The encoder takes the image features of both the current and the previous frame as the inputs. (2) It has two decoders, which take the learned object queries and queries from the last frame as the input respectively. With different queries, the output sequence from the encoder is transformed into detection boxes and tracking boxes respectively. (3) The predicted two groups of boxes are matched based on the IoUs using the Hungarian algorithm [27]. While Trackformer [41] has the following features. (1) It only takes the current frame features as the encoder inputs. (2) There is only one decoder, where the learned object queries and the track queries from the last frame interact with each other. (3) It associates tracks over time solely by attention operations, not relying on any additional matching such as motion or appearance modeling. In contrast, our work has the following fundamental differences with these two methods. (1) Network inputs are different. Our input is a triplet consisting of the current search region, the initial template and a dynamic template. (2) Our method captures the appearance changes of the tracked targets by updating the dynamic template, rather than updating object queries as [51, 41]. + +Spatio-Temporal Information Exploitation. Exploita- + +tion of spatial and temporal information is a core problem in object tracking field. Existing trackers can be divided into two classes: spatial-only ones and spatio-temporal ones. Most of offline Siamese trackers [2, 29, 28, 69, 34] belong to the spatial-only ones, which consider the object tracking as a template-matching between the initial template and the current search region. To extract the relationship between the template and the search region along the spatial dimension, most trackers adopt the variants of correlation, including the naive correlation [2, 29], the depth-wise correlation [28, 69], and the point-wise correlation [34, 61]. Although achieving remarkable progress in recent years, these methods merely capture local similarity, while ignoring global information. By contrast, the self-attention mechanism in transformer can capture long-range relationship, making it suitable for pair-wise matching tasks. Compared with spatial-only trackers, spatiotemporal ones additionally exploit temporal information to improve trackers' robustness. These methods can also be divided into two classes: gradient-based and gradient-free ones. Gradient-based methods require gradient computation during inference. One of the classical works is MDNet [44], which updates domain-specific layers with gradient descent. To improve the optimization efficiency, later works [11, 3, 30, 55, 64] adopt more advanced optimization methods like Gauss-Newton method or meta-learning-based update strategies. However, many real-world devices for deploying deep learning do not support backpropagation, which restricts the application of gradient-based methods. In contrast, gradient-free methods have larger potentials in real-world applications. One class of gradient-free methods [63, 66] exploits an extra network to update the template of Siamese trackers [2, 70]. Another representative work LTMU [9] learns a meta-updater to predict whether the current state is reliable enough to be used for the update in long-term tracking. Although being effective, these methods cause the separation between space and time. In contrast, our method integrates the spatial and temporal information as a whole, simultaneously learning them with the transformer. + +Tracking Pipeline and Post-processing. The tracking pipelines of previous trackers [28, 59, 69, 54] are complicated. Specifically, they first generate a large number of box proposals with confidence scores, then use various post-processing to choose the best bounding box as the tracking result. The commonly used post-processing includes cosine window, scale or aspect-ratio penalty, bounding box smoothing, tracklet-based dynamic programming, etc. Though it brings better results, post-processing causes the performance to be sensitive to hyper-parameters. There are some trackers [18, 21] attempting to simplify the tracking pipeline, but their performances still lag far behind that of state-of-the-art trackers. Recent books and surveys on + +![](images/daa49a0fd568ad16f64272dd3f4290490ea05db878c3e7409be4f9afb5ebb8d7.jpg) +Figure 2: Framework for spatial-only tracking. + +object tracking can be found in [37, 31]. This work attempts to close this gap, achieving top performance by predicting one single bounding box in each frame. + +# 3. Method + +In this section, we propose the spatio-temporal transformer network for visual tracking, called STARK. For clarity, we first introduce a simple baseline method that directly applies the original encoder-decoder transformer for tracking. The baseline method only considers spatial information and achieves impressive performance. After that, we extend the baseline to learn both spatial and temporal representations for target localization. We introduce a dynamic template and an update controller to capture the appearance changes of target objects. + +# 3.1. A Simple Baseline Based on Transformer + +We present a simple baseline framework based on visual transformer for object tracking. The network architecture is demonstrated in Fig. 2. It mainly consists of three components: a convolutional backbone, an encoder-decoder transformer, and a bounding box prediction head. + +**Backbone.** Our method can use arbitrary convolutional networks as the backbone for feature extraction. Without loss of generality, we adopt the vanilla ResNet [17] as the backbone. More concretely, except for removing the last stage and fully-connected layers, there is no other change for the original ResNet [17]. The input of the backbone is a pair of images: a template image of the initial target object $z \in \mathbb{R}^{3 \times H_z \times W_z}$ and a search region of the current frame $x \in \mathbb{R}^{3 \times H_x \times W_x}$ . After passing through of the backbone, the template $z$ and the search image $x$ are mapped to two feature maps $f_z \in \mathbb{R}^{C \times \frac{H_z}{s} \times \frac{W_z}{s}}$ and $f_x \in \mathbb{R}^{C \times \frac{H_x}{s} \times \frac{W_x}{s}}$ . + +Encoder. The feature maps output from the backbone require pre-processing before feeding into the encoder. To be specific, a bottleneck layer is first used to reduce the + +channel number from $C$ to $d$ . Then the feature maps are flattened and concatenated along the spatial dimension, producing a feature sequence with length of $\frac{H_z}{s} \frac{W_z}{s} + \frac{H_x}{s} \frac{W_x}{s}$ and dimension of $d$ , which servers as the input for the transformer encoder. The encoder consists of $N$ encoder layers, each of which is made up of a multi-head self-attention module with a feed-forward network. Due to the permutation-invariance of the original transformer [53], we add sinusoidal positional embeddings to the input sequence. The encoder captures the feature dependencies among all elements in the sequence and reinforces the original features with global contextual information, thus allowing the model to learn discriminative features for object localization. + +Decoder. The decoder takes a target query and the enhanced feature sequence from the encoder as the input. Different from DETR [5] adopting 100 object queries, we only input one single query into the decoder to predict one bounding box of the target object. Besides, since there is only one prediction, we remove the Hungarian algorithm [27] used in DETR for prediction association. Similar to the encoder, the decoder stacks $M$ decoder layers, each of which consists of a self-attention, an encoder-decoder attention, and a feed-forward network. In the encoder-decoder attention module, the target query can attend to all positions on the template and the search region features, thus learning robust representations for the final bounding box prediction. + +Head. DETR [5] adopts a three-layer perceptron to predict object box coordinates. However, as pointed by GFLoss [32], directly regressing the coordinates is equivalent to fitting a Dirac delta distribution, which fails to consider the ambiguity and uncertainty in the datasets. This representation is not flexible and not robust to challenges such as occlusion and cluttered background in object tracking. To improve the box estimation quality, we design a new prediction head through estimating the probability distribution of the box corners. As shown in Fig. 3, we first take the search region features from the encoder's output sequence, then compute the similarity between the search region features and the output embedding from the decoder. Next, the similarity scores are element-wisely multiplied with the search region features to enhance important regions and weaken the less discriminative ones. The new feature sequence is reshaped to a feature map $f \in \mathbb{R}^{d \times \frac{H_s}{s} \times \frac{W_s}{s}}$ , and then fed into a simple fully-convolutional network (FCN). The FCN consists of $L$ stacked Conv-BN-ReLU layers and outputs two probability maps $P_{tl}(x,y)$ and $P_{br}(x,y)$ for the top-left and the bottom-right corners of object bounding boxes, respectively. Finally, the predicted box coordinates $(\widehat{x_{tl}}, \widehat{y_{tl}})$ and $(\widehat{x_{br}}, \widehat{y_{br}})$ are obtained by computing the expectation of corners' probability distribution as shown in Eq. (2). Compared with DETR, our method explicitly models uncertainty in the coordinate estimation, generating more accurate and robust predictions for object tracking. + +![](images/f7f04cb37f567c24726bbea4c5e2c68f2ed91fdf99966b6006f8184676e90723.jpg) +Figure 3: Architecture of the box prediction head. + +Training and Inference. Our baseline tracker is trained in an end-to-end fashion with the combination of the $\ell_1$ Loss and the generalized IoU loss [48] as in DETR. The loss function can be written as + +$$ +L = \lambda_ {i o u} L _ {i o u} \left(b _ {i}, \hat {b} _ {i}\right) + \lambda_ {L _ {1}} L _ {1} \left(b _ {i}, \hat {b} _ {i}\right). \tag {1} +$$ + +where $b_{i}$ and $\hat{b}_i$ represent the groundtruth and the predicted box respectively and $\lambda_{iou}, \lambda_{L_1} \in \mathbb{R}$ are hyperparameters. But unlike DETR, we do not use the classification loss and the Hungarian algorithm, thus further simplifying the training process. During inference, the template image together with its features from the backbone are initialized by the first frame and fixed in the subsequent frames. During tracking, in each frame, the network takes a search region from the current frame as the input, and returns the predicted box as the final result, without using any post-processing such as cosine window or bounding box smoothing. + +$$ +(\widehat {x _ {t l}}, \widehat {y _ {t l}}) = (\sum_ {y = 0} ^ {H} \sum_ {x = 0} ^ {W} x \cdot P _ {t l} (x, y), \sum_ {y = 0} ^ {H} \sum_ {x = 0} ^ {W} y \cdot P _ {t l} (x, y)), +$$ + +$$ +\left(\widehat {x _ {b r}}, \widehat {y _ {b r}}\right) = \left(\sum_ {y = 0} ^ {H} \sum_ {x = 0} ^ {W} x \cdot P _ {b r} (x, y), \sum_ {y = 0} ^ {H} \sum_ {x = 0} ^ {W} y \cdot P _ {b r} (x, y)\right), \tag {2} +$$ + +# 3.2. Spatio-Temporal Transformer Tracking + +Since the appearance of a target object may change significantly as time proceeds, it is important to capture the latest state of the target for tracking. In this section, we demonstrate how to exploit spatial and temporal information simultaneously based on the previously introduced baseline. Three key differences are made, including the network inputs, an extra score head, and the training & inference strategy. We elaborate them one by one as below. The spatio-temporal architecture is shown in Fig. 4. + +Input. Different from the baseline method which only uses the first and the current frames, the spatio-temporal method introduces a dynamically updated template sampled from intermediate frames as an additional input, as shown in Fig. 4. Beyond the spatial information from the initial + +template, the dynamic template can captures the target appearance changes with time, providing additional temporal information. Similar to the baseline architecture in Sec. 3.1, feature maps of the triplet are flattened and concatenated then sent to the encoder. The encoder extracts discriminative spatio-temporal features by modeling the global relationships in both spatial and temporal dimensions. + +Head. During tracking, there are some cases where the dynamic template should not be updated. For example, the cropped template is not reliable when the target has been completely occluded or has moved out of view, or when the tracker has drifted. For simplicity, we consider that the dynamic template could be updated as long as the search region contains the target. To automatically determine whether the current state is reliable, we add a simple score prediction head, which is a three-layer perceptron followed by a sigmoid activation. The current state is considered reliable if the score is higher than the threshold $\tau$ . + +Training and Inference. As pointed out by recent works [8, 50], jointly learning of localization and classification may cause sub-optimal solutions for both tasks, and it is helpful to decouple localization and classification. Therefore, we divide the training process into two stages, regarding the localization as a primary task and the classification as a secondary task. To be specific, in the first stage, the whole network, except for the score head, is trained end-to-end only with the localization-related losses in Eq. 1. In this stage, we ensure all search images to contain the target objects and let the model learn the localization capacity. In the second stage, only the score head is optimized with binary cross-entropy loss defined as + +$$ +L _ {c e} = y _ {i} \log (P _ {i}) + (1 - y _ {i}) \log (1 - P _ {i}), \tag {3} +$$ + +where $y_{i}$ is the groundtruth label and $P_{i}$ is the predicted confidence, and all other parameters are frozen to avoid affecting the localization capacity. In this way, the final model learn both localization and classification capabilities after the two-stage training. + +During inference, two templates and corresponding features are initialized in the first frame. Then a search region is cropped and fed into the network, generating one bounding box and a confidence score. The dynamic template is updated only when the update interval is reached and the confidence score is higher than the threshold $\tau$ . For efficiency, we set the update interval as $T_{u}$ frames. The new template is cropped from the original image and then fed into the backbone for feature extraction. + +# 4. Experiments + +This section first presents the implementation details and the results of our STARK tracker on multiple benchmarks, with comparisons to state-of-the-art methods. Then, ablation studies are presented to analyze the effects of the key + +![](images/57c57922b401bbfd16974268a789d9c0e562d03f29645b1e0cd6841f9aff65ca.jpg) +Figure 4: Framework for spatio-temporal tracking. The differences with the spatial-only architecture are in pink. + +components in the proposed networks. We also report the results of other candidate frameworks and compare them with our method to demonstrate its superiority. Finally, visualization on attention maps of the encoder and the decoder are provided to understand how the transformer works. + +# 4.1. Implementation Details + +Our trackers are implemented using Python 3.6 and PyTorch 1.5.1. The experiments are conducted on a server with 8 16GB Tesla V100 GPUs. + +Model. We report the results of three variants of STARK: STARK-S50, STARK-ST50 and STARK-ST101. STARK-S50 only exploits spatial information and takes ResNet-50 [17] as the backbone, i.e., the baseline tracker presented in Sec. 3.1. STARK-ST50 and STARK-ST101 take ResNet-50 and ResNet-101 as the backbones respectively, exploiting both spatial and temporal information, i.e., the spatio-temporal tracker presented in Sec. 3.2. + +The backbones are initialized with the parameters pretrained on ImageNet. The BatchNorm [22] layers are frozen during training. Backbone features are pooled from the fourth stage with a stride of 16. The transformer architecture is similar to that in DETR [5] with 6 encoder layers and 6 decoder layers, which consist of multi-head attention layers (MHA) and feed-forward networks (FFN). The MHA have 8 heads, width 256, while the FFN have hidden units of 2048. Dropout ratio of 0.1 is used. The bounding box prediction head is a lightweight FCN, consisting of 5 stacked Conv-BN-ReLU layers. The classification head is a three-layer perceptron with 256 hidden units in each layer. + +Training. The training data consists of the train-splits of LaSOT [15], GOT-10K [20], COCO2017 [35], and TrackingNet [43]. As required by VOT2019 challenge, we remove 1k forbidden sequences from GOT-10K training set. The sizes of search images and templates are $320 \times 320$ + +![](images/1685d62e5b58a24d91a8ebcabe5a3bdbd594e0aba5229188185c5e29b0e11d6c.jpg) +Figure 5: Comparisons on LaSOT test set [15]. + +![](images/3f934200c15e066e57bcbfde3f5263a87a8837efe5cf491cced690e549e0acad.jpg) + +pixels and $128 \times 128$ pixels respectively, corresponding to $5^{2}$ and $2^{2}$ times of the target box area. Data augmentations, including horizontal flip and brightness jittering, are used. The minimal training data unit for STARK-ST is one triplet, consisting of two templates and one search images. The whole training process of STARK-ST consists of two stages, which take 500 epochs for localization and 50 epochs for classification, respectively. Each epoch uses $6 \times 10^{4}$ triplets. The network is optimized using AdamW optimizer [36] and weight decay $10^{-4}$ . The loss weights $\lambda_{L1}$ and $\lambda_{iou}$ are set to 5 and 2 respectively. Each GPU hosts 16 triplets, hence the mini-batch size is 128 triplets. The initial learning rates of the backbone and the rest parts are $10^{-5}$ and $10^{-4}$ respectively. The learning rate drops by a factor of 10 after 400 epochs in the first stage and after 40 epochs in the second stage. The training setting of STARK-S is almost the same as that of STARK-ST, except that (1) the minimal training data unit of STARK-S is a template-search pair; (2) the training process only has the first stage. + +Inference. The dynamic template update interval $T_{u}$ and the confidence threshold $\tau$ are set to 200 frames and 0.5 by default. The inference pipeline only contains a forward pass and a coordinate transformation from the search region to the original image, without any extra post-processing. + +# 4.2. Comparisons on previous benchmarks + +We compare our STARK with existing state-of-the-art object trackers on three short-term benchmarks (GOT-10K, TrackingNet and VOT2020) and two long-term benchmarks (LaSOT and VOT2020-LT). + +GOT-10K. GOT-10K [20] is a large-scale benchmark covering a wide range of common challenges in object tracking. GOT-10K requires trackers to only use the training set of GOT-10k for model learning. We follow this policy and retrain our models only with the GOT-10K train set. As reported in Tab. 1, with the same ResNet-50 backbone, STARK-S50 and STARK-ST50 outperform PrDiMP50 [12] by $3.8\%$ and $4.6\%$ AO scores, respectively. Furthermore, STARK-ST101 obtains a new state-of-the-art AO score of $68.8\%$ , surpassing Siam R-CNN [54] by $3.9\%$ with the same ResNet-101 backbone. + +TrackingNet. TrackingNet [43] is a large-scale shortterm tracking benchmark containing 511 video sequences in the test set. Tab. 2 presents that STARK-S50 and STARK-ST50 surpass PrDiMP50 [12] by $4.5\%$ and $5.5\%$ in AUC respectively. With a more powerful ResNet-101 backbone, STARK-ST101 achieves the best AUC of $82.0\%$ , outperforming Siam R-CNN by $0.8\%$ . + +VOT2020. Different from previous reset-based evaluations [26], VOT2020 [25] proposes a new anchor-based evaluation protocol and uses binary segmentation masks as the groundtruth. The final metric for ranking is the Expected Average Overlap (EAO). Tab. 3 shows that STARK-S50 achieves a competitive result, which is better than DiMP [3] and UPDT [4]. After introducing temporal information, STARK-ST50 obtains an EAO of 0.308, being superior to previous bounding-box trackers. Inspired by AlphaRef [25], the winner of VOT2020 real-time challenge, we equip STARK with a refinement module in AlphaRef to generate segmentation masks. The new tracker "STARK-ST50+AR" surpasses previous SOTA trackers, like AlphaRef and OceanPlus [69], getting an EAO of 0.505. + +LaSOT. LaSOT [15] is a large-scale long-term tracking benchmark, which contains 280 videos with average length of 2448 frames in the test set. STARK-S50 and STARK-ST50 achieve a gain of $6.0\%$ and $6.6\%$ over PrDiMP [12] respectively, using the same ResNet-50 backbone. Furthermore, STARK-ST101 obtains a success of $67.1\%$ , which is $2.3\%$ higher than Siam R-CNN [54], as shown in Fig. 5. + +VOT2020-LT. VOT2020-LT consists of 50 long videos, in which target objects disappear and reappear frequently. Besides, trackers are required to report the confidence score of the target being present. Precision (Pr) and Recall (Re) are computed under a series of confidence thresholds. F-score, defined as $F = \frac{2Pr\text{Re}}{Pr + Re}$ , is used to rank different trackers. Since STARK-S does not predict this score, we do not report its result on VOT2020-LT. Tab. 4 demonstrates that STARK-ST50 and STARK-ST101 outperform all previous methods with an F-score of $70.2\%$ and $70.1\%$ , respectively. It is also worth noting that the framework of STARK is much simpler than that of LTMU_B, the winner of VOT2020-LT Challenge. To be specific, LTMU_B takes the combination of ATOM [11] and SiamMask [57] as the short-term tracker, MDNet [44] as the verifier, and GlobalTrack [21] as the global detector. Whereas there is only one network in STARK and the result is obtained in one forward pass without post-processing. + +Speed, FLOPs and Params. As demonstrated in Tab. 6, STARK-S50 can run in real-time at more than $40~fps$ . Besides, the FLOPs and Params of STARK-S50 are $4\times$ and $2\times$ less than those of SiamRPN++. Although STARK-ST50 takes a dynamic template as the extra input and introduces an additional score head, the increases of FLOPs and Params is a little, even negligible. This shows that our + +Table 1: Comparisons on GOT-10k test set [20]. + +
SiamFC [2]SiamFCv2 [52]ATOM [11]SiamFC++ [59]D3S [38]DiMP50 [3]Ocean [69]PrDiMP50 [12]SiamRCNN [54]STARK -S50STARK -ST50STARK -ST101
AO(%)34.837.455.659.559.761.161.163.464.967.268.068.8
SR0.5(%)35.340.463.469.567.671.772.173.872.876.177.778.1
SR0.75(%)9.814.440.247.946.249.247.354.359.761.262.364.1
+ +Table 2: Comparisons on TrackingNet test set [43]. + +
DSiamRPN [70]ATOM [11]SiamRPN++ [28]DiMP50 [3]SiamAttn [65]SiamFC++ [59]MAML-FCOS [55]PrDiMP50 [12]SiamRCNN [54]STARK -S50STARK -ST50STARK -ST101
AUC(%)63.870.373.374.075.275.475.775.881.280.381.382.0
Pnorm(%)73.377.180.080.181.780.082.281.685.485.186.186.9
+ +Table 3: Comparisons on VOT2020 [25]. “+AR” means using Alpha-Refine to predict masks. The upper row summarizes trackers that only predict bounding boxes and the lower row presents trackers that report masks. + +
IVT [49]KCF [19]SiamFC [2]CSR-DCF [39]ATOM [11]DiMP [3]UPDT [4]DPMT [1]SuperDiMP [1]STARK -S50STARK -ST50STARK -ST101
EAO(↑)0.0920.1540.1790.1930.2710.2740.2780.3030.3050.2800.3080.303
Accuracy(↑)0.3450.4070.4180.4060.4620.4570.4650.4920.4770.4770.4780.481
Robustness(↑)0.2440.4320.5020.5820.7340.7400.7550.7450.7860.7280.7990.775
STM [45]SiamEMSiamMask [57]SiamMargin [25]Ocean [69]D3S [38]FastOceanAlphaRef [25]OceanPlus [67]STARK -S50+ARSTARK -ST50+ARSTARK -ST101+AR
EAO(↑)0.3080.3100.3210.3560.4300.4390.4610.4820.4910.4620.5050.497
Accuracy(↑)0.7510.5200.6240.6980.6930.6990.6930.7540.6850.7610.7590.763
Robustness(↑)0.5740.7430.6480.6400.7540.7690.8030.7770.8420.7490.8170.789
+ +method can exploit temporal information in a nearly cost-free fashion. When ResNet-101 is used as the backbone, both FLOPs and Params increase significantly but STARK-ST101 can still run at real-time speed, which is 6x faster than Siam R-CNN (5 fps), as shown in Fig. 1. + +# 4.3. Comparisons on newly constructed benchmark + +NOTU. In recent years, an obvious trend of over-fitting has been observed on some small-scale tracking benchmarks like OTB [58]. Performance on these datasets may not accurately reflect the tracking ability of various trackers. To address this issue, we collect a new large-scale tracking benchmark called NOTU, which contains all 401 sequences from NFS [24], OTB100 [58], TC-128 [33], and UAV-123 [42]. Tab. 5 demonstrates that the rankings of trackers on OTB100 are quite different from those on NOTU, verifying the over-fitting phenomenon we mentioned before. Besides, STARK outperforms all previous trackers consistently on NOTU, showing strong generalization ability. + +# 4.4. Component-wise Analysis + +In this section, we choose STARK-ST50 as the base model and evaluate the effects of different components in it on LaSOT [15]. For simplicity, encoder, decoder, positional encoding, corner prediction, and score head are abbreviated as enc, dec, pos, corner, and score respectively. As shown in Tab. 7 #1, when the encoder is removed, the success drops significantly by $5.3\%$ . This illustrates that the deep interaction among features from the template and the search region plays a key role. The performance drops by $1.9\%$ when the decoder is removed as shown in #2. This drop is less than that of removing the encoder, showing that the importance of the decoder is less than the encoder. When the positional + +encoding is removed, the performance only drops by $0.2\%$ as shown in #3. Thus we conclude that the positional encoding is not a key component in our method. We also try to replace the corner head with a three-layer perceptron as in DETR [5]. #4 shows that the performance of STARK with an MLP as the box head is $2.7\%$ lower than that of the proposed corner head. It demonstrates that the boxes predicted by the corner head are more accurate. As shown in #5, when removing the score head, the performance drops to $64.5\%$ , which is lower than that of STARK-S50 without using temporal information. This demonstrates that improper uses of temporal information may hurt the performance and it is important to filter out unreliable templates. + +# 4.5. Comparison with Other Frameworks + +In this section, we choose the STARK-ST50 as our base model and compare it with other possible candidate frameworks. These frameworks include generating queries from the template, using the Hungarian algorithm, updating queries as in TrackFormer [41], and jointly learning localization and classification. Due to the space limitation, the figures of the detailed architectures are presented in the supplementary material. + +Template images serve as the queries. Queries and templates have similar functions in transformer tracking. For example, both of them are expected to encode information about the target objects. From this view, a natural idea is to use template images to serve as the queries of the decoder. Specifically, first, the template and the search region features are separately fed to a weight-shared encoder then the queries generated from the template features are used to interact with the search region features in the decoder. As shown in Tab. 8, the performance of this framework is + +Table 4: Comparisons on VOT-LT2020 benchmark [25]. + +
SPLT [62]ltMDNetSiamDW_LT [68]RLT_DiMPCLGSMegtrackLTMU_B [9]LT_DSESTARK-ST50STARK-ST101
F-score(%)56.557.465.667.067.468.769.169.570.270.1
Pr(%)58.764.967.865.773.970.370.171.571.070.2
Re(%)54.451.463.568.461.967.168.167.769.570.1
+ +Table 5: Success score (%) comparisons on the collected large-scale benchmark NOTU and its subsets [24, 58, 33, 42]. + +
SiamFC [2]RT-MDNet [23]ECO [10]Ocean [69]LightTrack [60]SiamRPN++ [28]ATOM [11]DiMP50 [3]TransT [6]STARK-S50STARK-ST50STARK-ST101
NOTU47.252.956.756.757.459.861.563.465.064.966.066.1
NFS37.743.352.249.449.357.158.361.865.364.365.266.2
OTB10058.365.066.668.465.468.766.368.469.568.368.568.1
TC12848.956.358.955.755.057.759.961.259.660.062.663.1
UAV12346.852.853.557.462.659.363.264.368.168.469.168.2
+ +Table 6: Comparison about the speed, FLOPs and Params. + +
TrackersSpeed(fps)FLOPs(G)Params(M)
STARK-S5042.212.128.1
STARK-ST5041.812.828.2
STARK-ST10131.720.447.2
SiamRPN++35.048.954.0
+ +Table 7: Ablation for important components. Blank denotes the component is used by default, while $\mathbf{x}$ represents the component is removed. Performance is evaluated on LaSOT. + +
#EncDecPosCornerScoreSuccess
1X61.1
2X64.5
3X66.2
4X63.7
5X64.5
666.4
+ +Table 8: Comparison between STARK and other candidate frameworks. Performance is evaluated on LaSOT. + +
Template queryHungarianUpdate queryLoc-Cls JointOurs
Success61.263.764.862.566.4
+ +$61.2\%$ , which is $5.2\%$ lower than that of our design. We conjecture that the underlying reason is that compared with our method, this design lacks the information flow from the template to the search region, thus weakening the discriminative power of the search region features. + +Using the Hungarian algorithm [5]. We also try to use $K$ queries, predicting $K$ boxes with confidence scores. $K$ is equal to 10 in the experiments. The groundtruth is dynamically matched with these queries during the training using the Hungarian algorithm. We observe that this training strategy leads to the "Matthew effect". There are only one or two queries having the ability to predict high-quality boxes. If they are not selected during inference, the predicted box may become unreliable. As shown in Tab. 8, this strategy performs inferior to our method by $2.7\%$ . + +Updating the query embedding. Different from STARK exploiting temporal information by introducing an + +extra dynamic template, TrackFormer [41] encodes temporal information by updating the query embedding. Following this idea, we extend the STARK-S50 to a new temporal tracker by updating the target query. Tab. 8 shows that this design achieves a success of $64.8\%$ , which is $1.6\%$ lower than that of STARK-ST50. The underlying reason might be that the extra information brought by an updatable query embedding is much less than that by an extra template. + +Jointly learning of localization and classification. As mentioned in Sec 3.2, localization is regarded as the primary task and is trained in the first stage. While classification is trained in the second stage as the secondary task. We also make an experiment to jointly learn localization and classification in one stage. As shown in Tab. 8, this strategy leads to a sub-optimal result, which is $3.9\%$ lower than that of STARK. Two potential reasons are: (1) Optimization of the score head interferes with the training of the box head, leading to inaccurate box predictions. (2) Training of these two tasks requires different data. To be specific, the localization task expects that all search regions contain tracked targets to provide strong supervision. By contrast, the classification task expects a balanced distribution, half of search regions containing the targets, while the remaining half not. + +# 5. Conclusion + +This paper proposes a new transformer-based tracking framework, which can capture the long-range dependency in both spatial and temporal dimensions. Besides, the proposed STARK tracker gets rid of hyper-parameters sensitive post-processing, leading to a simple inference pipeline. Extensive experiments show that the STARK trackers perform much better than previous methods on both existing short-term and long-term benchmarks and newly constructed NOTU benchmark, while running in real-time. We expect this work can attract more attention on transformer architecture for visual tracking. + +# Acknowledgement. + +We would like to thank the reviewers for their insightful comments. Lu and Wang are supported in part by National Natural Science Foundation of China under grant No. U1903215, 61725202, 61829102, 62022021 and Dalian Innovation leader's support Plan under Grant No. 2018RD07. + +# References + +[1] https://github.com/visionml/pytracking.7 +[2] Luca Bertinetto, Jack Valmadre, João F Henriques, Andrea Vedaldi, and Philip H S Torr. Fully-convolutional siamese networks for object tracking. In ECCVW, 2016. 1, 3, 7, 8 +[3] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning discriminative model prediction for tracking. In ICCV, 2019. 1, 3, 6, 7, 8 +[4] Goutam Bhat, Joakim Johnander, Martin Danelljan, Fahad Shahbaz Khan, and Michael Felsberg. Unveiling the power of deep tracking. In ECCV, 2018. 6, 7 +[5] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 1, 2, 4, 5, 7, 8 +[6] Xin Chen, Bin Yan, Jiawen Zhu, Dong Wang, Xiaoyun Yang, and Huchuan Lu. Transformer tracking. In CVPR, 2021. 8 +[7] Zedu Chen, Bineng Zhong, Guorong Li, Shengping Zhang, and Rongrong Ji. Siamese box adaptive network for visual tracking. In CVPR, 2020. 1 +[8] Bowen Cheng, Yunchao Wei, Honghui Shi, Rogerio Feris, Jinjun Xiong, and Thomas Huang. Revisiting rcnn: On awakening the classification power of faster rcnn. In ECCV, 2018. 5 +[9] Kenan Dai, Yunhua Zhang, Dong Wang, Jianhua Li, Huchuan Lu, and Xiaoyun Yang. High-performance long-term tracking with meta-updater. In CVPR, 2020. 2, 3, 8 +[10] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ECO: Efficient convolution operators for tracking. In CVPR, 2017. 8 +[11] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ATOM: Accurate tracking by overlap maximization. In CVPR, 2019. 1, 2, 3, 6, 7, 8 +[12] Martin Danelljan, Luc Van Gool, and Radu Timofte. Probabilistic regression for visual tracking. In CVPR, 2020. 6, 7 +[13] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. *NAACL-HLT*, 2019. 1 +[14] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. 1, 2 +[15] Heng Fan, Liting Lin, Fan Yang, Peng Chu, Ge Deng, Sijia Yu, Hexin Bai, Yong Xu, Chunyuan Liao, and Haibin Ling. LaSOT: A high-quality benchmark for large-scale single object tracking. In CVPR, 2019. 1, 2, 5, 6, 7 +[16] Dongyan Guo, Jun Wang, Ying Cui, Zhenhua Wang, and Shengyong Chen. SiamCAR: Siamese fully convolutional classification and regression for visual tracking. In CVPR, 2020. 1 +[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 3, 5 + +[18] David Held, Sebastian Thrun, and Silvio Savarese. Learning to track at 100 fps with deep regression networks. In ECCV, 2016. 3 +[19] João F Henriques, Rui Caseiro, Pedro Martins, and Jorge Batista. High-speed tracking with kernelized correlation filters. In ICVS, 2008. 7 +[20] Lianghua Huang, Xin Zhao, and Kaiqi Huang. GOT-10k: A large high-diversity benchmark for generic object tracking in the wild. TPAMI, 2019. 2, 5, 6, 7 +[21] Lianghua Huang, Xin Zhao, and Kaiqi Huang. Globaltrack: A simple and strong baseline for long-term tracking. In AAAI, 2020. 2, 3, 6 +[22] Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 5 +[23] Ilchae Jung, Jeany Son, Mooyel Baek, and Bohyung Han. Real-time MDNet. In ECCV, 2018. 2, 8 +[24] Hamed Kiani Galoogahi, Ashton Fagg, Chen Huang, Deva Ramanan, and Simon Lucey. Need for speed: A benchmark for higher frame rate object tracking. In ICCV, 2017. 2, 7, 8 +[25] Matej Kristan, Aleš Leonardis, Jiří Matas, Michael Felsberg, Roman Pflugfelder, Joni-Kristian Kämäräinen, Martin Danelljan, Luka Čehovin Zajc, Alan Lukežić, Ondrej Drbohlav, et al. The eighth visual object tracking vot2020 challenge results. In ECCVW, 2020. 2, 6, 7, 8 +[26] Matej Kristan, Jiri Matas, Ales Leonardis, et al. The seventh visual object tracking VOT2019 challenge results. In ICCVW, 2019. 6 +[27] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 1955. 2, 4 +[28] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. SiamRPN++: Evolution of siamese visual tracking with very deep networks. In CVPR, 2019. 1, 3, 7, 8 +[29] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In CVPR, 2018. 3 +[30] Peixia Li, Boyu Chen, Wanli Ouyang, Dong Wang, Xiaoyun Yang, and Hutchuan Lu. GradNet: Gradient-guided network for visual object tracking. In ICCV, 2019. 3 +[31] Peixia Li, Dong Wang, Lijun Wang, and Huchuan Lu. Deep visual tracking: Review and experimental comparison. PR, 2018. 3 +[32] Xiang Li, Wenhai Wang, Lijun Wu, Shuo Chen, Xiaolin Hu, Jun Li, Jinhui Tang, and Jian Yang. Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. In NeurIPS, 2020. 4 +[33] Pengpeng Liang, Erik Blasch, and Haibin Ling. Encoding color information for visual tracking: Algorithms and benchmark. TIP, 2015. 2, 7, 8 +[34] Bingyan Liao, Chenye Wang, Yayun Wang, Yaonong Wang, and Jun Yin. PG-Net: Pixel to global matching network for visual tracking. 3 +[35] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. 5 + +[36] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. 6 +[37] Huchuan Lu and Dong Wang. Online visual tracking. Springer, 2019. 3 +[38] Alan Lukezic, Jiri Matas, and Matej Kristan. D3S-a discriminative single shot segmentation tracker. In CVPR, 2020. 7 +[39] Alan Lukezic, Tomas Vojir, Luka Cehovin Zajc, Jiri Matas, and Matej Kristan. Discriminative correlation filter with channel and spatial reliability. In CVPR, 2017. 7 +[40] Christoph Luscher, Eugen Beck, Kazuki Irie, Markus Kitza, Wilfried Michel, Albert Zeyer, Ralf Schlüter, and Hermann Ney. Rwth asr systems for librispeech: Hybrid vs attention–w/o data augmentation. arXiv preprint arXiv:1905.03072, 2019. 1 +[41] Tim Meinhardt, Alexander Kirillov, Laura Leal-Taixe, and Christoph Feichtenhofer. TrackFormer: Multi-object tracking with transformers. arXiv preprint arXiv:2101.02702, 2021. 1, 2, 7, 8 +[42] Matthias Mueller, Neil Smith, and Bernard Ghanem. A benchmark and simulator for uav tracking. In ECCV, 2016. 2, 7, 8 +[43] Matthias Muller, Adel Bibi, Silvio Giancola, Salman Alsubaihi, and Bernard Ghanem. Trackingnet: A large-scale dataset and benchmark for object tracking in the wild. In ECCV, 2018. 2, 5, 6, 7 +[44] Hyeonseob Nam and Bohyung Han. Learning multi-domain convolutional neural networks for visual tracking. In CVPR, 2016. 1, 3, 6 +[45] Seoung Wug Oh, Joon-Young Lee, Ning Xu, and Seon Joo Kim. Video object segmentation using space-time memory networks. In ICCV, 2019. 7 +[46] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. 1 +[47] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NIPS, 2015. 2 +[48] Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In CVPR, 2019. 4 +[49] David A Ross, Jongwoo Lim, Ruei-Sung Lin, and Ming-Hsuan Yang. Incremental learning for robust visual tracking. ijcv, 2008. 7 +[50] Guanglu Song, Yu Liu, and Xiaogang Wang. Revisiting the sibling head in object detector. In CVPR, 2020. 5 +[51] Peize Sun, Yi Jiang, Rufeng Zhang, Enze Xie, Jinkun Cao, Xinting Hu, Tao Kong, Zehuan Yuan, Changhu Wang, and Ping Luo. TransTrack: Multiple-object tracking with transformer. arXiv preprint arXiv:2012.15460, 2020. 2 +[52] Jack Valmadre, Luca Bertinetto, Joao Henriques, Andrea Vedaldi, and Philip HS Torr. End-to-end representation learning for correlation filter based tracking. In CVPR, 2017. +[53] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017. 1, 2, 4 + +[54] Paul Voigtlaender, Jonathon Luiten, Philip HS Torr, and Bastian Leibe. Siam R-CNN: Visual tracking by re-detection. In CVPR, 2020. 1, 2, 3, 6, 7 +[55] Guangting Wang, Chong Luo, Xiaoyan Sun, Zhiwei Xiong, and Wenjun Zeng. Tracking by instance detection: A meta-learning approach. In CVPR, 2020. 3, 7 +[56] Huiyu Wang, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. MaX-DeepLab: End-to-end panoptic segmentation with mask transformers. arXiv preprint arXiv:2012.00759, 2020. 2 +[57] Qiang Wang, Li Zhang, Luca Bertinetto, Weiming Hu, and Philip H. S. Torr. Fast online object tracking and segmentation: A unifying approach. In CVPR, 2019. 2, 6, 7 +[58] Yi Wu, Jongwoo Lim, and Ming Hsuan Yang. Object tracking benchmark. TPAMI, 2015. 2, 7, 8 +[59] Yinda Xu, Zeyu Wang, Zuoxin Li, Ye Yuan, and Gang Yu. SiamFC++: towards robust and accurate visual tracking with target estimation guidelines. In AAAI, 2020. 1, 3, 7 +[60] Bin Yan, Houwen Peng, Kan Wu, Dong Wang, Jianlong Fu, and Huchuan Lu. LightTrack: Finding lightweight neural networks for object tracking via one-shot architecture search. In ICCV, 2021. 8 +[61] Bin Yan, Xinyu Zhang, Dong Wang, Huchuan Lu, and Xiaoyun Yang. Alpha-refine: Boosting tracking performance by precise bounding box estimation. arXiv preprint arXiv:2012.06815, 2020. 3 +[62] Bin Yan, Haojie Zhao, Dong Wang, Huchuan Lu, and Xiaoyun Yang. 'Skimming-Perusal' Tracking: A framework for real-time and robust long-term tracking. In ICCV, 2019. 2, 8 +[63] Tianyu Yang and Antoni B Chan. Learning dynamic memory networks for object tracking. In ECCV, 2018. 1, 3 +[64] Tianyu Yang, Pengfei Xu, Runbo Hu, Hua Chai, and Antoni B Chan. ROAM: Recurrently optimizing tracking model. In CVPR, 2020. 3 +[65] Yuechen Yu, Yilei Xiong, Weilin Huang, and Matthew R Scott. Deformable siamese attention networks for visual object tracking. In CVPR, 2020. 7 +[66] Lichao Zhang, Abel Gonzalez-Garcia, Joost van de Weijer, Martin Danelljan, and Fahad Shahbaz Khan. Learning the model update for siamese trackers. In ICCV, 2019. 1, 3 +[67] Zhipeng Zhang, Bing Li, Weiming Hu, and Houweng Peng. Towards accurate pixel-wise object tracking by attention retrieval. arXiv preprint arXiv:2008.02745, 2020. 7 +[68] Zhipeng Zhang and Houwen Peng. Deeper and wider siamese networks for real-time visual tracking. In CVPR, 2019. 8 +[69] Zhipeng Zhang, Houwen Peng, Jianlong Fu, Bing Li, and Weiming Hu. Ocean: Object-aware anchor-free tracking. In ECCV, 2020. 3, 6, 7, 8 +[70] Zheng Zhu, Qiang Wang, Bo Li, Wei Wu, Junjie Yan, and Weiming Hu. Distractor-aware siamese networks for visual object tracking. In ECCV, 2018. 3, 7 \ No newline at end of file diff --git a/learningspatiotemporaltransformerforvisualtracking/images.zip b/learningspatiotemporaltransformerforvisualtracking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4bd2baf1b741bc71eebfe866fa7ab48203a888d3 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddb012e20eac3fea04462fa44812354b3c60550c9a0735becb2cf3ae958c8822 +size 455734 diff --git a/learningspatiotemporaltransformerforvisualtracking/layout.json b/learningspatiotemporaltransformerforvisualtracking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f0341020f4c8e2c57b16581eca4b3994f6ee4153 --- /dev/null +++ b/learningspatiotemporaltransformerforvisualtracking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8569cb44267164a4359d401f70c1e43626cee305085f4004a72ad509d535fc60 +size 385333 diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_content_list.json b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6c2abf1db30a96ad6cef78881be4b242926cc352 --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:180ec82861f7dde08a20040949b605934e911ceb99d3ebaa9e925fd0a886fbde +size 70723 diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_model.json b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..083f98e3aa8b8518a873363078273745245f0c81 --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cabf1e73dff15346463b6b5e473c80fc44c9a7581deafd311b3924b81ba0d3e6 +size 87745 diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_origin.pdf b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5c0ba58fd3d4b461f94e7dd3b5c2bca07ecfef4d --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/7e19a4d3-b3dd-4c6b-a74a-1e28fe54ef5d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05d48a59c5f9d254de6583b018798d5065bf9ec9a1693b34f9f2c4f81844719f +size 419759 diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/full.md b/learningspecializedactivationfunctionswiththepiecewiselinearunit/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3ccf33e0557964febf767d1eb842f13ce7030778 --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/full.md @@ -0,0 +1,331 @@ +# Learning specialized activation functions with the Piecewise Linear Unit + +Yucong Zhou +Huawei + +zhouyucongl@huawei.com + +Zezhou Zhu + +Beijing University of + +Posts and Telecommunications + +Zhao Zhong + +Huawei + +zorro.zhongzhao@huawei.com + +zhuzezhou@bupt.edu.cn + +# Abstract + +The choice of activation functions is crucial for modern deep neural networks. Popular hand-designed activation functions like Rectified Linear Unit(ReLU) and its variants show promising performance in various tasks and models. Swish, the automatically discovered activation function, has been proposed and outperforms ReLU on many challenging datasets. However, it has two main drawbacks. First, the tree-based search space is highly discrete and restricted, which is difficult for searching. Second, the sample-based searching method is inefficient, making it infeasible to find specialized activation functions for each dataset or neural architecture. To tackle these drawbacks, we propose a new activation function called Piecewise Linear Unit(PWLU), which incorporates a carefully designed formulation and learning method. It can learn specialized activation functions and achieves SOTA performance on large-scale datasets like ImageNet and COCO. For example, on ImageNet classification dataset, PWLU improves $0.9\% / 0.53\% / 1.0\% / 1.7\% / 1.0\%$ top-1 accuracy over Swish for ResNet-18/ResNet-50/MobileNet-V2/MobileNet-V3/EfficientNet-B0. PWLU is also easy to implement and efficient at inference, which can be widely applied in real-world applications. + +# 1. Introduction + +Activation functions are fundamental components for modern deep neural networks, which affect both the expressiveness and the optimization of models. As a crucial design choice, the combination of Rectified Linear Units(ReLU)[7, 15, 25] with deep neural networks shows six times faster in convergence compared to tanh nonlinearities[18]. With nonsaturating gradients, ReLU mitigates the vanishing gradient problem and shows robust performance across different tasks and neural architectures. + +Beyond ReLU, many new activation functions have been proposed like Leaky ReLU[23], PReLU[10], ELU[4], SELU[16], etc. These human-designed activation functions are either fixed or have a few learnable parameters. All + +![](images/54ecd4702b34af600fc21ce6aab60213b5ff0d859894efe99e70da338be38639.jpg) +Figure 1. Comparing improvements over ReLU on ImageNet dataset. We run experiments on five different architectures for each activation function and show the improvements over ReLU baseline. The proposed PWLU consistently outperforms other methods across architectures. + +these variants are similar in shape, and their gains are not consistent across tasks which limits their applications[26]. + +Besides human-designed activation functions, automatic searched activations function, Swish[26], show better performance across tasks. Swish adopts a tree-structured search space based on unary and binary functions, which is searched by reinforcement learning. Although showing improvements over ReLU, Swish also has its limitations. First, the tree-structured search space is highly discrete and restricted. A slight change in one composing unit may result in an entirely different activation function, making it difficult to search. Second, the sample-based searching method typically requires evaluating hundreds to thousands of candidate activation functions, which is computationally expensive. It is infeasible to use such an inefficient searching process to find specialized activation functions for each dataset or architecture. Instead, the searched Swish is used for most conditions. There are also methods like APL[1] and PAU[24] that use universal approximators as activation + +functions. Contrary to Swish, they are mostly contiguous with respect to their parameters and can be directly optimized by gradients. However, these methods suffer from complicated formulations that may lead to unstable learning or inefficient inference. Besides, simply using gradients may not be sufficient to fully optimize these formulations. + +To overcome these drawbacks and exploit the full potential of activation functions, we propose a new method called Piecewise Linear Unit(PWLU). Our method is composed of two parts: the piecewise-linear-based formulation and the gradient-based learning method. The carefully designed formulation is flexible, easy for learning and efficient for inference. First, it covers a wide range of scalar functions which raise the potential of finding good activation functions. Second, it is mostly differentiable with respect to its parameters and can be easily learned by gradients. Third, its computation is very simple at inference, which is efficient and practical for real-world applications. To effectively learn activations under this formulation, we identify the input-boundary misalignment problem and compensate normal gradient-based learning with statistic-based realignment. Our learning method is both effective and efficient, making it possible to learn specialized activation functions for each dataset or architecture. With the formulation and learning method, PWLU clearly outperforms Swish and other activation functions on large-scale datasets like ImageNet[28] and COCO[21], across a wide variety of architectures. An overall comparison on ImageNet dataset for different activation functions is shown in Figure 1. Particularly our method outperforms Swish for $0.9\% / 0.53\% / 1.0\% / 1.7\% / 1.0\%$ top-1 accuracy for ResNet-18/ResNet-50/MobileNet-V2/MobileNet-V3/EfficientNet-B0. The learned activation functions show different preferences across architectures and layers, which confirms the benefits of learning specialized activation functions. To summarise, our contributions are as follows: + +- We propose a new formulation of activations based on piecewise linear functions, which is flexible, easy for learning and efficient for inference. +- We identify the input-boundary misalignment problem in gradient-based learning and propose a new learning method that is both effective and efficient. +- With the proposed formulation and learning method, we demonstrate the benefits of learning specialized activation functions on large-scale datasets and different architectures. + +# 2. Related Work + +# 2.1. Fixed-shape activation functions + +As a powerful replacement for traditional activation functions like Sigmoid and Tanh, ReLU has been widely + +accepted for its effectiveness and simplicity. Many variants have been proposed to address the drawbacks of ReLU, such as the dead ReLU problem. Some representative activation functions include Leaky ReLU, PReLU, Softplus[25], ELU, SELU, etc. While some of them show improvements in certain cases, the improvements tend to be inconsistent across different datasets and architectures. As one possible reason, all these hand-designed activation functions are fixed in shape or parameterized by only a single parameter. The lack of flexibility makes these activation functions only suitable for limited scenarios. + +# 2.2. Flexible activation functions + +To find novel activation functions, [26] proposes to search for activation functions using automated search techniques. They design a tree-structured search space that constructs activation functions using unary and binary functions. An RNN controller is used to generate candidate activation functions in this space and updated by reinforcement learning. Since this sample-based searching process is time-consuming, they restrict the evaluation of each activation function only on small datasets like Cifar. But it is still too expensive to apply this searching process to each dataset or architecture. As a result, only the searched activation function called Swish is used, but the searching process has not been applied to different datasets or architectures up to our knowledge. Thus Swish is actually a fixed-shape activation function in most cases. + +Except for sample-based method, there are also gradient-based methods such as APL[1] and PAU[24]. These methods use formulations with many learnable parameters, covering a wide range of different activation functions. These parameters are optimized directly by gradients, which is more efficient than sampled-based searching. Our method shares the same spirit, but the designs are substantially different. APL uses a weighted sum of multiple ReLU-like functions which also results in piecewise-linear. However, the formulation of our method is entirely different, which influences the corresponding gradients, learning process, and results. PAU uses Padé approximant which can also cover a wide range of activation functions. However, the formulation is complicated and may introduce instability to optimization. Both APL and PAU do not consider the alignment between input distribution and the parametrized functions, which is explicitly handled in our method. Considering the computation efficiency, Both APL and PAU require much more computation than our method, limiting their applications. + +# 2.3. Contextual-based activation functions + +Former discussed activation functions are all scalar(one-to-one) functions([6, 12, 30, 32, 5]). Recently, some contextual-based methods have been proposed, which use + +many-to-one functions. For example, Dynamic-ReLU[3] generates the parameters of activation function based on the global context. That is, each output element of Dynamic-ReLU depends on all input elements. Funnel-ReLU[22] is in the form of $y = \max (x,\mathbb{T}(x))$ , where $\mathbb{T}(x)$ is a spatial condition. Funnel-ReLU also uses contextual information, but each output element only depends on a local window of $x$ . Both Dynamic-ReLU and Funnel-ReLU are dynamic to some extent. Dynamic-ReLU has different functions for different input samples, while the functions of Funnel-ReLU are different for every single element. These dynamic characteristics increase models' capacity and greatly improve performance. While we focus on scalar function methods in this paper, adding dynamic mechanisms to PWLU is an interesting future direction. + +# 3. Methods + +# 3.1. Definition of the Piecewise Linear Unit + +![](images/0c9eb1171d57fde9f72476c339311b1083b775bb9bc5e29ff27faca6111450db.jpg) +Figure 2. Parameters of Piecewise Linear Unit + +We first define the proposed activation function: Piecewise Linear Unit. As shown in Figure 2, PWLU is defined by following parameters: + +Number of intervals $N$ +- Left boundary $B_{L}$ , right boundary $B_{R}$ +- y-axis value of $N + 1$ demarcation points $Y_{P}$ +- Left most slope $K_{L}$ , right most slope $K_{R}$ + +The number of intervals $N$ is a hyperparameter, which influences the fitting ability of PWLU. A larger number of intervals brings higher degrees of freedom, increasing the capacity of the model. The left and right boundary $B_{L}, B_{R}$ defines the effective region where PWLU mainly focuses on. $[B_{L}, B_{R}]$ is uniformly divided into $N$ intervals, leaving $N + 1$ demarcation points. Each demarcation point has a + +corresponding y-axis value $Y_{P}$ , which determines the shape of PWLU. Beyond $[B_L, B_R]$ , we use two slopes $K_L$ and $K_R$ to control the region out of the boundaries. + +Given these parameters, the forward pass of PWLU is shown in Equation 1: + +$$ +\mathrm {P W L U} _ {N} \left(x, B _ {L}, B _ {R}, Y _ {P}, K _ {L}, K _ {R}\right) = +$$ + +$$ +\left\{ \begin{array}{l l} (x - B _ {L}) * K _ {L} + Y _ {P} ^ {0} & x < B _ {L} \\ (x - B _ {R}) * K _ {R} + Y _ {P} ^ {N} & x \geq B _ {R} \\ (x - B _ {i d x}) * K _ {i d x} + Y _ {P} ^ {i d x} & B _ {L} \leq x < B _ {R} \end{array} \right. \tag {1} +$$ + +where $idx$ indicates the index number of the interval that $x$ belongs to, while $B_{idx}$ and $K_{idx}$ are the corresponding left boundary and slope of the interval. With $d = \frac{B_R - B_L}{N}$ denoting the interval length, these values are computed as follows: + +$$ +i d x = \left\lfloor \frac {x - B _ {L}}{d} \right\rfloor \tag {2} +$$ + +$$ +B _ {i d x} = B _ {L} + i d x * d \tag {3} +$$ + +$$ +K _ {i d x} = \frac {Y _ {P} ^ {i d x + 1} - Y _ {P} ^ {i d x}}{d} \tag {4} +$$ + +With this definition, PWLU has several good properties: + +- As a universal approximator, PWLU can closely approximate any contiguous, bounded scalar functions. +- PWLU changes contiguously with its parameters (except for hyperparameter $N$ ), which is friendly for gradient-based optimization. +- Most of the flexibilities lie in a bounded region, which can maximize the utilization of learnable parameters. +- Thanks to the uniform division of intervals, PWLU is efficient in computation, especially for inference. We will address this point in Sec 4.3. + +# 3.2. Gradients of the Piecewise Linear Unit + +As can be seen in the previous section, the forward pass of PWLU is mostly differentiable, which means it can be directly optimized by gradients. We derive the gradients in Table 1. + +Note that in the derivation we treat $idx$ as constant and omit related gradients. For gradients with respect to $Y_{P}$ , we separate it into four parts for clarity. When $x \in [B_{idx}, B_{idx+1}]$ where $0 \leq idx \leq N$ , the output of PWLU has gradient with respect to both $Y_{P}^{idx}$ and $Y_{P}^{idx+1}$ . When $x \in [-\infty, B_{L}]$ , the output of PWLU only has gradient with respect to $Y_{P}^{0}$ . When $x \in [B_{R}, \infty]$ , the output of PWLU only has gradient with respect to $Y_{P}^{N}$ . As can be seen in the definition and gradients, the computation of PWLU is straightforward. We implement the forward and backward computation in CUDA for efficiency. + +
∂PWLUN/x < BLBL ≤ x < BRx ≥ BR
∂xKLKidxKR
∂BL-KLKidx * (x-BR/BR-BL)0
∂BR0Kidx * (BL-x/BR-BL)-KR
∂KLx - BL00
∂KR00x - BR
∂YPidx0Bidx+1-x/d0
∂YPidx+10x-Bidx/d0
∂YP0100
∂YNP001
+ +Table 1. Gradients of Piecewise Linear Unit + +# 3.3. Learning the Piecewise Linear Unit + +Given the definition and the gradients of PWLU, we can learn the parameters of PWLU by gradient descent directly. Before learning, the parameters of the PWLU should be properly initialized to stabilize training. One straightforward way is to initialize PWLU to existing activation functions such as ReLU. For example, if $N$ is an even number, we can initialize $B_{L}$ to any negative value and set $B_{R} = -B_{L}$ , $K_{L} = 0$ , $K_{R} = 1$ , then set each $Y_{P}^{idx} = \mathrm{ReLU}(B_{idx})$ . This initialization offers a good start, but there is a further problem that needs to be handled during training. + +Input-boundary misalignment $B_{L}, B_{R}$ are important parameters of PWLU which define the main region where the shape can be learned. According to the definition of PWLU, the degree of freedom mainly lies in the region $[B_{L}, B_{R}]$ . There are $N + 1$ parameters $(Y_{P})$ controlling the shape of PWLU in this region, while only two parameters $(K_{L}, K_{R})$ for $[-\infty, B_{L}]$ and $[B_{R}, \infty]$ . Intuitively this main region should be aligned with the input distribution of PWLU, otherwise the effective degrees of freedom can reduce. Consider the situation illustrated in Figure 3. The main part of the input distribution shifts to the left, which only has a little intersection with $[B_{L}, B_{R}]$ . Under this condition, the parameters out of the input distribution have little contribution to the network, wasting the flexibility of PWLU and affecting the final performance. One may expect that gradients can drive $B_{L}, B_{R}$ to their optimal values, but unfortunately we find that gradients do not help either. Gradients with respect to $B_{L}$ and $B_{R}$ only follow the direction that lowers the task loss, which is not directly correlated with the alignment between $[B_{L}, B_{R}]$ and the input distribution. During training, this input-boundary misalignment problem will continuously exist and hinder the + +learning of PWLU. + +![](images/a88dd43bf0821095bf4c20ef1d5d191ffbd5325d654f8475490a963fef9b48c8.jpg) +Figure 3. Illustration of the misalignment between $[B_L, B_R]$ and the input distribution + +Statistic-based realignment To overcome this problem, we propose a statistic-based method to facilitate the learning of PWLU. The training process is split into two phases and the full pipeline is shown in Figure 4. + +![](images/f9f81885f58c081c79fa66995f32f36019fb93765b4d1553953d8b86b386d4f0.jpg) +Figure 4. Learning PWLU with statistic-based realignment + +Phase I Phase I lasts from iteration 0 to $T' - 1$ . At the beginning of phase I, we first initialize all PWLUs to ReLU(Figure 4 A) and then start the training. In addition to standard training, we have two modifications(Figure 4 B): + +- during each forward procedure, we collect statistics of input distribution for each PWLU +- during each update procedure, we do not update the parameters of PwLUs to keep them as initialized ReLU + +For collecting statistics we compute the running mean and running standard deviation of input $x$ for each PWLU, as formulated in Equation 5. These statistics will be used in Phase II. + +$$ +\begin{array}{l} \mu = \mu * 0. 9 + \operatorname {m e a n} (x) * 0. 1 \tag {5} \\ \sigma = \sigma * 0. 9 + \operatorname {s t d} (x) * 0. 1 \\ \end{array} +$$ + +Phase II Phase II lasts from iteration $T'$ to $T$ . At the beginning of Phase II, we first reset parameters of each PWLU as following (Figure 4 C): + +$$ +B _ {L} = \mu - 3 * \sigma , \quad B _ {R} = \mu + 3 * \sigma +$$ + +$$ +K _ {L} = 0, \quad K _ {R} = 1 \tag {6} +$$ + +$$ +Y _ {P} ^ {i d x} = \operatorname {R e L U} \left(B _ {i d x}\right) i d x \in \{0, 1, 2, \dots , N \} +$$ + +Here we adopt the 3-sigma rule, which works well in our experiments. After resetting, the PWLUs are still in ReLU form as in Phase I (there may be a tiny gap around zero point whose influence is negligible), but their boundaries are aligned with the input distribution. Then we start normal training and update parameters of PWLUs by gradients. + +Summary The proposed learning method has many advantages. First, it is highly efficient. With gradient-based learning, it is feasible to learn specialized activation functions for each dataset, architecture, layer or even channel, at the cost of a single training. Second, it is effective and robust. With special handling of the input-boundary misalignment problem, our method fully exploits the potential of PWLU. Third, it is simple to implement. Our method only requires slight changes to normal training procedures, which are limited to PWLU itself and do not affect any other components. Our method offers great compatibility with all kinds of techniques. + +# 4. Experiments + +We first show overall results on ImageNet and COCO in section 4.1 and section 4.2, then ablation studies on several aspects of PWLU in later sections. + +# 4.1. Experiments on ImageNet + +We first evaluate our method on the ImageNet classification dataset, which contains 1.28 million training images and 50k validation images. + +General setups All the architectures are trained on 16 Nvidia V100 GPUs with a total batchsize of 1024, SGD optimizer with momentum 0.9, and the one-cycle cosine learning rate scheduler. Weight decay is set to 0.0001 for ResNet-18 and ResNet-50[11], 0.00004 for MobileNet-V2[29] and MobileNet-V3[13], 0.00001 for EfficientNet-B0[31]. We use the standard random crop + flip augmentation for ResNets and MobileNets, and AutoAugment for EfficientNet, following their original implementations. We train ResNets for 100 epochs, MobileNet-V2 for 200 epochs, MobileNet-V3 and EfficientNet-B0 for 350 epochs. + +PWLU setups When applying PWLU to an architecture, we replace all activation layers except those that have tiny input feature maps, such as activations in SE-block[14]. + +Tiny input feature maps are not suitable for learning parameters of PWLU, so we let these activations unchanged as in their original implementation. $T'$ is set to 5 epochs as it works well across our experiments. We use the channel-wise setting for PWLU. $N$ is set to 16. + +Other activation functions We choose three types of activation functions for comparison. + +- The first type of activation function includes ReLU, PReLU and Swish, which have fixed (or nearly fixed) shape. They are simple in formulation and widely used in different tasks. +- The second type of activation function includes Adaptive Piecewise Linear(APL) activation and Padé Activation Units(PAU). We choose them for they share the same spirit of using a flexible parametric formulation. For APL, we find that the default setting of hyperparameter $S = 5$ is unstable on ImageNet. So we set $S = 3$ , which is the best value that can be successfully trained. For PAU we follow the original setting where $m = 5$ , $n = 4$ . +- For the third type of activation function we choose Funnel-ReLU, which is a many-to-one function. While PWLU is a scalar function, we choose Funnel-ReLU as a representative for another line of works. + +Architectures To compare the general performance of different activation functions, we conduct experiments on 5 widely used architectures including ResNet-18, ResNet-50, MobileNet-V2, MobileNet-V3 and EfficientNet-B0. They cover a wide range of computational complexity and number of parameters that can be applied to different cases. + +![](images/77b43ba8c01a53614494a559aca10b563b3fc783b7de02650b9969fd2b52e7f9.jpg) +Figure 5. Improvements in Top-1 accuracy over ReLU + +Results The top-1 accuracies are shown in Table 2. Our method outperforms ReLU and Swish in all experiments. + +
ResNet-18ResNet-50MobileNet-V2MobileNet-V3EfficientNet-B0
FLOPs1.8G4.1G300M56M384M
#Params11.69M25.5M3.5M2.6M5.3M
ReLU71.3476.9072.8467.7476.45
Swish71.6177.2573.6867.9377.05
PReLU71.3077.0973.6967.8177.10
APL71.0376.4373.8967.6877.28
PAU71.8076.5874.5668.5578.08
F-ReLU71.8277.4974.8568.4877.28
PWLU72.5777.7874.6969.6578.22
+ +To show differences more clearly, we also plot the improvements of top-1 accuracy over ReLU in Figure 5. Although these activation functions are better than ReLU in most cases, an interesting pattern is worth noting: the improvements are highly inconsistent across architectures, except for PWLU. For example, Swish is claimed to perform well especially for mobile-sized models, however it is true only for MobileNet-V2 in our experiments while the improvements for ResNet-18 and MobileNet-V3 are marginal. PReLU and APL have a similar trend with Swish but are more unstable. PAU and Funnel-ReLU generally perform better than Swish, but still have large differences between architectures. On the other hand, PWLU achieves the best results and performs consistently across architectures. + +# 4.2. Experiments on COCO + +To further demonstrate the generalization ability of our method, we apply PWLU to the COCO object detection dataset. We use the train2017 split(118k images) for training and the val2017 split(5k images) for testing. We use two popular detection frameworks: Mask R-CNN[9] and RetinaNet[20]. We mainly follow the settings in [8] which do not use ImageNet pre-train models but train the model from scratch. The detailed settings are as follows. + +Architecture We use ResNet-50 plus Feature Pyramid Network(FPN)[19] as backbone for both Mask R-CNN and RetinaNet. SyncBN is used to facilitate the from-scratch training. For Mask R-CNN the Region Proposal Networks(RPN)[27] is trained jointly with Mask-RCNN. + +Learning rate scheduling Both Mask R-CNN and RetinaNet are trained for 270k iterations(namely, $3 \times$ schedule'). The learning rate is reduced by $10 \times$ in the last 60k + +and the last 20k iterations. + +Hyper-parameters The initial learning rate is 0.02, weight decay is 0.0001 and momentum is 0.9. All models are trained with 8 Nvidia V100 GPUs with two images per GPU. The image scale is 800 pixels for the shorter side. For PWLU we use the same setting as in ImageNet. + +Results We show results for Mask R-CNN and RetinaNet with different activations in Table 3. As Swish outperforms ReLU for $1\% /0.8\%$ AP, our PWLU further improves $0.4\% /0.5\%$ AP over Swish, which is on par with F-ReLU. Note that F-ReLU utilizes contextual information which is likely beneficial for detection tasks, while PWLU does not access this extra information. + +Table 2. Top-1 accuracies on ImageNet for different activation functions and architectures. For each architecture the top-2 results are shown in bold. + +
Mask R-CNNRetinaNet
APbboxAPmaskAPbbox
ReLU39.0635.337.06
Swish40.0536.137.82
F-ReLU40.2536.9038.35
PWLU40.4837.1338.31
+ +Table 3. Results for different activations on COCO dataset + +# 4.3. Efficient inference for PWLU + +As noted in section 3.1, we show how to optimize efficiency for PWLU at inference. Re-write the main computation as $x * K_{idx} + (Y_P^{idx} - B_{idx} * K_{idx})$ , where $K_{idx}$ and $Y_P^{idx} - B_{idx} * K_{idx}$ can be calculated in advance. + +Then the main computation becomes a single Multiply-Add: $x * S_{idx} + O_{idx}$ . The comparisons in Equation 1 can be eliminated as well. The first two conditions can be merged into the third by extending $idx$ . The original $idx$ belongs to $\{0, 1, \dots, N - 1\}$ , now we extend it to $\{-1, 0, \dots, N\}$ by $idx' = \mathrm{clip}\left(\left\lfloor \frac{x - B_L}{d} \right\rfloor, -1, N\right)$ . $idx' = -1$ corresponds to $x < B_L$ while $idx' = N$ corresponds to $x \geq B_R$ . Then we set $S_{-1} = K_L$ , $S_N = K_R$ , $O_{-1} = Y_P^0 - B_L * K_L$ , $O_N = Y_P^N - B_R * K_R$ . After this, the overall inference computation is simplified as: calculate $idx'$ then $x * S_{idx'} + O_{idx'}$ . We implement it in CUDA and test the inference time as shown in Table 4. As expected, PWLU is very efficient at inference, close to ReLU and Swish. As for training, PWLU is around 20% slower compared to ReLU due to more gradient terms. + +
ModelReLUSwishPWLUFReLUAPLPAU
ResNet-1817.118.819.923.340.764.2
MobileNetV315.415.716.218.131.738.6
+ +Table 4. Inference time(ms) measured on an NVIDIA V100 GPU with input size of $64 \times 3 \times 224 \times 224$ , averaged for 500 times. + +# 4.4. Ablation on input-boundary misalignment + +We further study the influences of the input-boundary misalignment problem introduced in Section 3.3. According to our analysis, the $[B_L, B_R]$ and input distribution of PWLU can be misaligned during normal training, wasting the flexibility of PWLU and affecting the final performance. The statistic-based realignment is designed to address this problem, so we compare these two methods: + +- fix-init- $x$ : initialize $[B_L, B_R]$ to a hand-picked $[-x, x]$ then do normal training +- stat-realign: train with statistic-based realignment according to Figure 4 + +We run experiments on ResNet-18 and MobileNet-V3 for both layer-wise and channel-wise PWLU. We choose $N = 16$ for PWLU in all experiments. + +
Methodlayer-wisechannel-wise
ResNet-18 baseline71.34
+ PWLU-fix-init-371.5772.27
+ PWLU-fix-init-671.7071.86
+ PWLU-fix-init-1071.8472.19
+ PWLU-stat-realign72.2272.57
+ +Table 5. Top-1 accuracies on ImageNet for ResNet-18 + +
Methodlayer-wisechannel-wise
MobileNet-V3 baseline67.74
+ PWLU-fix-init-368.5468.98
+ PWLU-fix-init-668.4868.88
+ PWLU-fix-init-1068.4268.20
+ PWLU-stat-realign69.3069.65
+ +Table 6. Top-1 accuracies on ImageNet for MobileNet-V3 + +As shown in Table 5 and Table 6, layer-wise PWLU with fix-init shows slightly improvements over baselines. When using stat-realign, the performance further boosts by a clear margin. Note that channel-wise PWLU is more sensitive to different initial values of fix-init, while stat-realign consistently achieves better results. + +To further verify our analysis, we quantitatively show the alignment between $[B_L, B_R]$ and the input distribution of PWLU. At the end of training, we collect input $x$ of each single channel of all PWLUs, then compute IOU for $[B_L, B_R]$ and $[x_{\mathrm{p0.05}}, x_{\mathrm{p0.95}}]$ : + +$$ +\mathrm {I O U} = \frac {\left[ B _ {L} , B _ {R} \right] \cap \left[ x _ {\mathrm {p} 0 . 0 5} , x _ {\mathrm {p} 0 . 9 5} \right]}{\left[ B _ {L} , B _ {R} \right] \cup \left[ x _ {\mathrm {p} 0 . 0 5} , x _ {\mathrm {p} 0 . 9 5} \right]} \tag {7} +$$ + +This IOU can be regarded as a quantitative measure of alignment at each channel. We choose two experiments in Table 6: PWLU-fix-init-10 and PWLU-stat-realign under channel-wise setting, compute IOUs for each experiment and show their distributions in Figure 6. It clearly shows that stat-realign has much higher IOUs compared to fix-init, successfully addressing the input-boundary misalignment problem. Based on the above results, we can conclude that the input-boundary misalignment problem indeed affects the learning of PWLU, and it can be addressed by our statistic-based realignment method. + +![](images/6beb53f461e9603bebaff0dc4f3ffe4d098f381f72b87b11e9c194dac3da80a5.jpg) +Figure 6. Distribution of IOUs computed for PWLU-fix-init-10 and PWLU-stat-realign + +# 4.5. Ablation on interval numbers + +As described in Section 3.1, the number of intervals $N$ is a hyperparameter. A larger number of intervals brings higher degrees of freedom, increasing the capacity of models. Here we show the influence of $N$ , to facilitate the choice of this hyperparameter. + +We run experiments for $N \in \{4, 8, 12, 16, 20\}$ , for three architectures with channel-wise PWLU. As shown in Table 7, more intervals generally bring greater improvements especially for small models. For example, PWLU with $N = 8$ shows $0.8\%$ improvements over $N = 4$ for MobileNet-V3. One interesting observation is that for all three models, $N = 20$ shows slightly worse results. A possible explanation is that each $Y_{P}^{idx}$ only influences the computation of adjacent two intervals. When $N$ grows larger, each interval gets a fewer number of input data points, which will reduce the number of corresponding gradients received by $Y_{P}^{idx}$ . This may result in higher variances of aggregated gradients and influence the training. Generally, $N \in [8, 16]$ gives good results, which is the recommended range for $N$ . + +
NResNet-18MobileNet-V3EfficientNet-B0
472.2468.7077.90
872.3969.5578.09
1272.4569.2077.96
1672.5769.6578.22
2072.4369.3777.86
+ +Table 7. Top-1 accuracies on ImageNet for different number of intervals. + +# 4.6. Comparing to APL and PAU + +Both APL and PAU use parameterized formulations covering a wide range of scalar functions, similar to PWLU. However, they may have large differences in optimization. For example, APL is a weighted sum of many basis functions: $\mathrm{APL(x) = max(0,x) + \sum_{i = 1}^{S}a_{i}\max(0, -x + b_{i})}$ . One can clearly see that $a_{i}$ and $b_{i}$ only receive gradients when $x < b_{i}$ . Thus the gradients with respect to $a_{i}$ and $b_{i}$ can be highly unbalanced depending on the value of $b_{i}$ . A larger value of $b_{i}$ enables more gradients and vice versa. This unbalance makes the optimization of APL difficult, and we indeed find it unstable in our experiments. PAU uses a more sophisticated formulation based on Padé approximant. It works well sometimes but improvements are not as consistent as PWLU. One possible explanation is that PAU defines a global function for $\mathbb{R}$ but the actual input distribution only lies in a bounded region. This gap may reduce the expressiveness of PAU and weakens the improvements. Comparing to APL and PAU, our PWLU has balanced gra + +dients, focuses on bounded regions and carefully handles the input-boundary misalignment problem. These designs make PWLU consistently outperforms APL and PAU across different architectures. + +# 4.7. Visualization for learned PWLUs + +![](images/3614606860eeb0e05abe973bdd4b5dd1ef6e59b032eef35bada13f72f39e7fb5.jpg) + +![](images/11ded0dc2e5c5ce66669804611e6fc505e105c9d303999fb46c15091752db7c4.jpg) + +![](images/97d75e5fa01dbbd5a30f78c1ed25a20a3300d5e812109934114a61810fea8875.jpg) +Figure 7. Learned PWLUs for different layers and architectures. Only five functions are sampled for clarity. Boundaries are shown by markers with each function. + +![](images/ee57195cc53b8fdcab9937c736c74d2c9062705bd7d64d9175fd5aec20a7f2b7.jpg) + +We visualize learned PWLUs for different layers and architectures in Figure 7. It clearly shows that learned activation functions are substantially different from hand-designed ones. V-shaped functions frequently appear, which are rarely seen in common activation functions. Also, activations for the first layer are close to linear functions. While sharing some common patterns, the learned functions are clearly different across architectures, which is consistent with our motivation of learning specialized activation functions for different architectures. + +# 5. Conclusion + +In this paper, we propose a new activation function called PWLU, which is designed to learn specialized activation functions for each dataset and architecture. To achieve this goal, we carefully design the formulation and the learning method. The piecewise-linear-based formulation is flexible and can be easily learned by gradients, while the statistic-based realignment makes the learning more effective and robust. On large-scale datasets like ImageNet and COCO, PWLU consistently outperforms other activation functions across multiple architectures, which demonstrates the benefits of learning specialized activation functions. PWLU is both simple in implementation and efficient at inference, which has great potential in real-world applications. + +# References + +[1] Forest Agostinelli, Matthew Hoffman, Peter Sadowski, and Pierre Baldi. Learning activation functions to improve deep neural networks. arXiv preprint arXiv:1412.6830, 2014. 1, 2 +[2] Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V Le. Neural optimizer search with reinforcement learning. arXiv preprint arXiv:1709.07417, 2017. +[3] Yinpeng Chen, Xiyang Dai, Mengchen Liu, Dongdong Chen, Lu Yuan, and Zicheng Liu. Dynamic relu. arXiv preprint arXiv:2003.10027, 2020. 3 +[4] Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015. 1 +[5] Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International conference on machine learning, pages 933-941, 2017. 2 +[6] Ian Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In International conference on machine learning, pages 1319-1327. PMLR, 2013. 2 +[7] Richard HR Hahnloser, Rahul Sarpeshkar, Misha A Mahowald, Rodney J Douglas, and H Sebastian Seung. Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit. Nature, 405(6789):947-951, 2000. 1 +[8] Kaiming He, Ross Girshick, and Piotr Dólar. Rethinking imagenet pre-training. In Proceedings of the IEEE international conference on computer vision, pages 4918-4927, 2019. 6 +[9] Kaiming He, Georgia Gkioxari, Piotr Dólár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961-2969, 2017. 6 +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026-1034, 2015. 1 +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 5 +[12] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. 2 +[13] Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetv3. In Proceedings of the IEEE International Conference on Computer Vision, pages 1314-1324, 2019. 5 +[14] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. 5 +[15] Kevin Jarrett, Koray Kavukcuoglu, Marc'Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture + +for object recognition? In 2009 IEEE 12th international conference on computer vision, pages 2146-2153. IEEE, 2009. 1 +[16] Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In Advances in neural information processing systems, pages 971-980, 2017. 1 +[17] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[18] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 25, pages 1097-1105. Curran Associates, Inc., 2012. 1 +[19] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117-2125, 2017. 6 +[20] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. 6 +[21] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740-755. Springer, 2014. 2 +[22] Ningning Ma, Xiangyu Zhang, and Jian Sun. Funnel activation for visual recognition. arXiv preprint arXiv:2007.11824, 2020.3 +[23] Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In Proc. icml, volume 30, page 3, 2013. 1 +[24] Alejandro Molina, Patrick Schramowski, and Kristian Kersting. Padé activation units: End-to-end learning of flexible activation functions in deep networks, 2020. 1, 2 +[25] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010. 1, 2 +[26] Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017. 1, 2 +[27] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91-99, 2015. 6 +[28] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. 2 +[29] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks.* In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510-4520, 2018. 5 + +[30] Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015. 2 +[31] Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019. 5 +[32] Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelCNN decoders. In Advances in neural information processing systems, pages 4790-4798, 2016. 2 \ No newline at end of file diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/images.zip b/learningspecializedactivationfunctionswiththepiecewiselinearunit/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bb5ee95c1d20353971df56490d3710fde006caad --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:688205c7c3f8a9f5144e02d37d625c8ef90bb48098ad3149ec428a706b8883c2 +size 379225 diff --git a/learningspecializedactivationfunctionswiththepiecewiselinearunit/layout.json b/learningspecializedactivationfunctionswiththepiecewiselinearunit/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d478d67bc60ea637a9cb830c27db4b7bd2666146 --- /dev/null +++ b/learningspecializedactivationfunctionswiththepiecewiselinearunit/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9478638ef650bbe9dbdb342f134bae6fce7da29e9812eb84fb1c312f482ba79d +size 399121 diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_content_list.json b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..24cf672996225c22123aeae48a0001a8267929ba --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fec36974c4a2d93dbdf575b16a6ab78169f327410f82ab3a5a68072878ada79 +size 86248 diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_model.json b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e3ba46490681504dc5d61c804d228f5ab4a0fd04 --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ee38db8e70b5191efab6ae43e2e498ea7ff0d6f785fde0e1cca30340fa2944f +size 105539 diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_origin.pdf b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3b9d9d008cb885b739cbff52dd3a122dd1ebf862 --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/f446860f-81a6-4660-9290-f61b8e3d63f5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d94fdad8637e99bfdef667dc00e108a47846ba0470261a93035edb9a3bd57c38 +size 5283635 diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/full.md b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d783e4b9816b89e73875482c3b155fa30e060fd8 --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/full.md @@ -0,0 +1,311 @@ +# Learning Target Candidate Association to Keep Track of What Not to Track + +Christoph Mayer + +Martin Danelljan + +Danda Pani Paudel + +Luc Van Gool + +Computer Vision Lab, D-ITET, ETH Zürich, Switzerland + +# Abstract + +The presence of objects that are confusingly similar to the tracked target, poses a fundamental challenge in appearance-based visual tracking. Such distractor objects are easily misclassified as the target itself, leading to eventual tracking failure. While most methods strive to suppress distractors through more powerful appearance models, we take an alternative approach. + +We propose to keep track of distractor objects in order to continue tracking the target. To this end, we introduce a learned association network, allowing us to propagate the identities of all target candidates from frame-to-frame. To tackle the problem of lacking ground-truth correspondences between distractor objects in visual tracking, we propose a training strategy that combines partial annotations with self-supervision. We conduct comprehensive experimental validation and analysis of our approach on several challenging datasets. Our tracker sets a new state-of-the-art on six benchmarks, achieving an AUC score of $67.1\%$ on LaSOT [21] and a $+5.8\%$ absolute gain on the OxUvA long-term dataset [41]. The code and trained models are available at https://github.com/visionml/pytracking + +# 1. Introduction + +Generic visual object tracking is one of the fundamental problems in computer vision. The task involves estimating the state of the target object in every frame of a video sequence, given only the initial target location. Most prior research has been devoted to the development of robust appearance models, used for locating the target object in each frame. The two currently dominating paradigms are Siamese networks [2, 35, 34] and discriminative appearance modules [3, 13]. While the former employs a template matching in a learned feature space, the latter constructs an appearance model through a discriminative learning formulation. Although these approaches have demonstrated promising performance in recent years, they are effectively limited by the quality and discriminative power of the appearance model. + +![](images/dadd52ef05da9cada783e99e49762c1898d2f8af9f36a692e18e9f41ac3ba47a.jpg) + +![](images/dc7ff67edf6958c21d9782dc55ea8602d0aea9f926c48296bd3a8dc10cd3f727.jpg) +Target Candidate +Figure 1. Visualization of the proposed target candidate association network used for tracking. For each target candidate $(\bullet)$ we extract a set of features such as score, position and appearance in order to associate candidates across frames. The proposed target association network then allows to associate these candidates $(\bullet)$ with the detected distractors $(\bullet)$ and the target object $(\bullet)$ of the previous frame. Lines connecting circles represent associations. + +![](images/a5ac5faba3b657518f0806314bc27a4663962b1acddb03b27c69dcf4470272e9.jpg) +Target Object + +![](images/4cb9b26f880250e1e2ee7541b6e5d3bab221029389586660f1db9e291f807b38.jpg) + +![](images/b914010e77901a377aeb3d94da34a80ccb62097d2720e880dba48fdda05bc53d.jpg) +Distractor Object + +As one of the most challenging factors, co-occurrence of distractor objects similar in appearance to the target is a common problem in real-world tracking applications [4, 56, 46]. Appearance-based models struggle to identify the sought target in such cases, often leading to tracking failure. Moreover, the target object may undergo a drastic appearance change over time, further complicating the discrimination between target and distractor objects. In certain scenarios, e.g., as visualized in Fig. 1, it is even virtually impossible to unambiguously identify the target solely based on appearance information. Such circumstances can only be addressed by leveraging other cues during tracking, for instance the spatial relations between objects. We therefore set out to address problematic distractors by exploring such alternative cues. + +We propose to actively keep track of distractor objects in order to ensure more robust target identification. To this end, we introduce a target candidate association network, that matches distractor objects as well as the target across frames. Our approach consists of a base appearance tracker, from which we extract target candidates in each frame. Each candidate is encoded with a set of distinctive features, consisting of the target classifier score, location, and appearance. The encodings of all candidates are jointly + +processed by a graph-based candidate embedding network. From the resulting embeddings, we compute the association scores between all candidates in subsequent frames, allowing us to keep track of the target and distractor objects over time. In addition, we estimate a target detection confidence, used to increase the robustness of the target classifier. + +While associating target candidates over time provides a powerful cue, learning such a matching network requires tackling a few key challenges. In particular, generic visual object tracking datasets only provide annotations of one object in each frame, i.e., the target. As a result, there is a lack of ground-truth annotations for associating distractors across frames. Moreover, the definition of a distractor is not universal and depends on the properties of the employed appearance model. We address these challenges by introducing an approach that allows our candidate matching network to learn from real tracker output. Our approach exploits the single target annotations in existing tracking datasets in combination with a self-supervised strategy. Furthermore, we actively mine the training dataset in order to retrieve rare and challenging cases, where the use of distractor association is important, in order to learn a more effective model. + +Contributions: In summary, our contributions are as follows: (i) We propose a method for target candidate association based on a learnable candidate matching network. (ii) We develop an online object association method in order to propagate distractors and the target over time and introduce a sample confidence score to update the target classifier more effectively during inference. (iii) We tackle the challenges with incomplete annotation by employing partial supervision, self-supervised learning, and sample-mining to train our association network. (iv) We perform comprehensive experiments and ablative analyses by integrating our approach into the tracker SuperDiMP [11, 16, 3]. The resulting tracker KeepTrack sets a new state-of-the-art on six tracking datasets, obtaining an AUC of $67.1\%$ on LasOT [21] and $69.7\%$ on UAV123 [37]. + +# 2. Related Work + +Discriminative appearance model based trackers [12, 3, 27, 25, 51, 15] aim to suppress distractors based on their appearance by integrating background information when learning the target classifier online. While often increasing robustness, the capacity of an online appearance model is still limited. A few works have therefore developed more dedicated strategies of handling distractors. Bhat et al. [4] combine an appearance based tracker and an RNN to propagate information about the scene across frames. It internally aims to track all regions in the scene by maintaining a learnable state representation. Other methods exploit the existence of distractors explicitly in the method formulation. DaSiamRPN [56] handles distractor objects by subtracting corresponding image features from the target tem + +plate during online tracking. Xiao et al. [46] use the locations of distractors in the scene and employ hand crafted rules to classify image regions into background and target candidates on each frame. SiamRCNN [42] associates subsequent detections across frames using a hand-crafted association score to form short tracklets. In contrast, we introduce a learnable network that explicitly associates target candidates from frame-to-frame. Zhang et al. [55] propose a tracker inspired by the multi object tracking (MOT) philosophy of tracking by detection. They use the top-k predicted bounding boxes for each frame and link them between frames by using different features. In contrast, we omit any hand crafted features but fully learn to predict the associations using self-supervision. + +Many online trackers [12, 3, 13] employ a memory to store previous predictions to fine-tune the tracker. Typically the oldest sample is replaced in the memory and an age-based weight controls the contribution of each sample when updating the tracker online. Danelljan et al. [14] propose to learn the tracking model and the training sample weights jointly. LTMU [10] combines an appearance based tracker with a learned meta-updater. The goal of the meta-updater is to predict whether the employed online tracker is ready to be updated or not. In contrast, we use a learned target candidate association network to compute a confidence score and combine it with sample age to manage the tracker updates. + +The object association problem naturally arises in MOT. The dominant paradigm in MOT is tracking-by-detection [5, 1, 49, 40, 52], where tracking is posed as the problem of associating object detections over time. The latter is typically formulated as a graph partitioning problem. Typically, these methods are non-causal and thus require the detections from all frames in the sequence. Furthermore, MOT typically focuses on a limited set of object classes [17], such as pedestrians, where strong object detectors are available. In comparison we aim at tracking different objects in different sequences solely defined by the initial frame. Furthermore, we lack ground truth correspondences of all distractor objects from frame to frame whereas the ground-truth correspondences of different objects in MOT datasets are typically provided [17]. Most importantly, we aim at associating target candidates that are defined by the tracker itself, while MOT methods associate all detections that correspond to one of the sought objects. + +# 3. Method + +In this section, we describe our tracking approach, which actively associates distractor objects and the sought target across multiple frames. + +# 3.1. Overview + +An overview of our tracking pipeline is shown in Fig. 2. We use a base tracker with a discriminative appearance + +![](images/72277172fe6eecfac6d4632097a5d0ba6a70932477f9a46ba662af701e36b8da.jpg) +Figure 2. Overview of the entire online tracking pipeline, processing the previous and current frames jointly to predict the target object. + +model and internal memory. In particular, we adopt the SuperDiMP [11, 26] tracker, which employs the target classifier in DiMP [3] and the probabilistic bounding-box regression from [16], together with improved training settings. + +We use the base tracker to predict the target score map $s$ for the current frame and extract the target candidates $v_{i}$ by finding locations in $s$ with high target score. Then, we extract a set of features for each candidate. Namely: target classifier score $s_i$ , location $\mathbf{c}_i$ in the image, and an appearance cue $\mathbf{f}_i$ based on the backbone features of the base tracker. Then, we encode this set of features into a single feature vector $\mathbf{z}_i$ for each candidate. We feed these representations and the equivalent ones of the previous frame – already extracted beforehand – into the candidate embedding network and process them together to obtain the enriched embeddings $\mathbf{h}_i$ for each candidate. These feature embeddings are used to compute the similarity matrix $S$ and to estimate the candidate assignment matrix $A$ between the two consecutive frames using an optimal matching strategy. + +Once having the candidate-to-candidate assignment probabilities estimated, we build the set of currently visible objects in the scene $\mathcal{O}$ and associate them to the previously identified objects $\mathcal{O}'$ , i.e., we determine which objects disappeared, newly appeared, or stayed visible and can be associated unambiguously. We then use this propagation strategy to reason about the target object $\hat{o}$ in the current frame. Additionally, we compute the target detection confidence $\beta$ to manage the memory and control the sample weight, while updating the target classifier online. + +# 3.2. Problem Formulation + +Let the set of target candidates, which includes distractors and the sought target, be $\mathcal{V} = \{v_{i}\}_{i = 1}^{N}$ , where $N$ de + +notes the number of candidates present in each frame. We define the target candidate sets $\mathcal{V}'$ and $\mathcal{V}$ corresponding to the previous and current frames, respectively. We formulate the problem of target candidate association across two subsequent frames as, finding the assignment matrix $A$ between the two sets $\mathcal{V}'$ and $\mathcal{V}$ . If the target candidate $v_{i}'$ corresponds to $v_{j}$ then $A_{i,j} = 1$ and $A_{i,j} = 0$ otherwise. + +In practice, a match may not exist for every candidate. Therefore, we introduce the concept of dustbins, which is commonly used for graph matching [38, 18] to actively handle the non-matching vertices. The idea is to match the candidates without match to the dustbin on the missing side. Therefore, we augment the assignment matrix $\mathbf{A}$ by an additional row and column representing dustbins. It follows that a newly appearing candidate $v_{j}$ -which is only present in the set $\mathcal{V}$ - leads to the entry $A_{N^{\prime} + 1,j} = 1$ . Similarly, a candidate $v_{i}^{\prime}$ that is no longer available in the set $\mathcal{V}$ results in $A_{i,N + 1} = 1$ . To solve the assignment problem, we design a learnable approach that predicts the matrix $\mathbf{A}$ . Our approach first extracts a representation of the target candidates, which is discussed below. + +# 3.3. Target Candidate Extraction + +Here, we describe how to detect and represent target candidates and propose a set of features and their encoding. We define the set of target candidates $\mathcal{V}$ as all unique coordinates $\mathbf{c}_i$ that correspond to a local maximum with minimal score in the target score map $s$ . Thus, each target candidate $v_i$ and its coordinate $\mathbf{c}_i$ need to fulfill the following two constraints, + +$$ +\phi_ {\max } (s, \mathbf {c} _ {i}) = 1 \quad \text {a n d} \quad s (\mathbf {c} _ {i}) \geq \tau , \tag {1} +$$ + +where $\phi_{\mathrm{max}}$ returns 1 if the score at $\mathbf{c}_i$ is a local maximum of $s$ or 0 otherwise, and $\tau$ denotes a threshold. This definition allows us to build the sets $\mathcal{V}'$ and $\mathcal{V}$ , by retrieving the local maxima of $s'$ and $s$ with sufficient score value. We use the max-pooling operation in a $5 \times 5$ local neighbourhood to retrieve the local maxima of $s$ and set $\tau = 0.05$ . + +For each candidate we build a set of features inspired by two observations. First, we notice that the motion of the same objects from frame to frame is typically small and thus similar locations and similar distances between different objects. Therefore, the position $\mathbf{c}_i$ of a target candidate forms a strong cue. In addition, we observe only small changes in appearance for each object. Therefore, we use the target classifier score $s_i = s(\mathbf{c}_i)$ as another cue. In order to add a more discriminative appearance based feature $\mathbf{f}_i = \mathbf{f}(\mathbf{c}_i)$ , we process the backbone features (used in the baseline tracker) with a single learnable convolution layer. Finally, we build a feature tuple for each target candidate as $(s_i, \mathbf{f}_i, \mathbf{c}_i)$ . These features are combined in the following way, + +$$ +\mathbf {z} _ {i} = \mathbf {f} _ {i} + \psi \left(s _ {i}, \mathbf {c} _ {i}\right), \quad \forall v _ {i} \in \mathcal {V}, +$$ + +where $\psi$ denotes a Multi-Layer Perceptron (MLP), that maps $s$ and $\mathbf{c}$ to the same dimensional space as $\mathbf{f}_i$ . This encoding permits jointly reasoning about appearance, target similarity, and position. + +# 3.4. Candidate Embedding Network + +In order to further enrich the encoded features and in particular to facilitate extracting features while being aware of neighbouring candidates, we employ a candidate embedding network. On an abstract level, our association problem bares similarities with the task of sparse feature matching. In order to incorporate information of neighbouring candidates, we thus take inspiration from recent advances in this area. In particular, we adopt the SuperGlue [38] architecture that establishes the current state-of-the-art in sparse feature matching. Its design allows to exchange information between different nodes, to handle occlusions, and to estimate the assignment of nodes across two images. In particular, the features of both frames translate to nodes of a single complete graph with two types of directed edges: 1) self edges within the same frame and 2) cross edges connecting only nodes between the frames. The idea is then to exchange information either along self or cross edges. + +The adopted architecture [38] uses a Graph Neural Network (GNN) with message passing that sends the messages in an alternating fashion across self or cross edges to produce a new feature representation for each node after every layer. Moreover, an attention mechanism computes the messages using self attention for self edges and cross attention for cross edges. After the last message passing layer a linear projection layer extracts the final feature representation $\mathbf{h}_i$ for each candidate $v_i$ . + +# 3.5. Candidate Matching + +To represent the similarities between candidates $v_{i}^{\prime} \in \mathcal{V}^{\prime}$ and $v_{j} \in \mathcal{V}$ , we construct the similarity matrix $S$ . The sought similarity is measured using the scalar product: $S_{i,j} = \langle \mathbf{h}_i', \mathbf{h}_j \rangle$ , for feature vectors $\mathbf{h}_i'$ and $\mathbf{h}_j$ corresponding to the candidates $v_{i}^{\prime}$ and $v_{j}$ . + +As previously introduced, we make use of the dustbin-concept [18, 38] to actively match candidates that miss their counterparts to the so-called dustbin. However, a dustbin is a virtual candidate without any feature representation $\mathbf{h}_i$ . Thus, the similarity score is not directly predictable between candidates and the dustbin. A candidate corresponds to the dustbin, only if its similarity scores to all other candidates are sufficiently low. In this process, the similarity matrix $\pmb{S}$ represents only an initial association prediction between candidates disregarding the dustbins. Note that a candidate corresponds either to an other candidate or to the dustbin in the other frame. When the candidates $v_{i}^{\prime}$ and $v_{j}$ are matched, both constraints $\sum_{i = 1}^{N^{\prime}}A_{i,j} = 1$ and $\sum_{j = 1}^{N}A_{i,j} = 1$ must be satisfied for one-to-one matching. These constraints however, do not apply for missing matches since multiple candidates may correspond to the same dustbin. Therefore, we make use of two new constraints for dustbins. These constraints for dustbins read as follows: all candidates not matched to another candidate must be matched to the dustbins. Mathematically, this can be expressed as, $\sum_{j}A_{N^{\prime} + 1,j} = N - M$ and $\sum_{i}A_{i,N + 1} = N^{\prime} - M$ , where $M = \sum_{(i\leq N^{\prime},j\leq N)}A_{i,j}$ represents the number of candidate-to-candidate matching. In order to solve the association problem, using the discussed constraints, we follow Sarlin et al. [38] and use the Sinkhorn [39, 8] based algorithm therein. + +# 3.6. Learning Candidate Association + +Training the embedding network that parameterizes the similarity matrix used for optimal matching requires ground truth assignments. Hence, in the domain of sparse keypoint matching, recent learning based approaches leverage large scale datasets [19, 38] such as MegaDepth [36] or ScanNet [9], that provide ground truth matches. However, in tracking such ground truth correspondences (between distractor objects) are not available. Only the target object and its location provide a single ground truth correspondence. Manually annotating correspondences for distracting candidates, identified by a tracker on video datasets, is expensive and may not be very useful. Instead, we propose a novel training approach that exploits, (i) partial supervision from the annotated target objects, and (ii) self-supervision by artificially mimicking the association problem. Our approach requires only the annotations that already exist in standard tracking datasets. The candidates for matching are obtained by running the base tracker on the given training dataset. + +Partially Supervised Loss: For each pair of consecutive frames, we retrieve the two candidates corresponding to the annotated target, if available. This correspondence forms a partial supervision for a single correspondence while all other associations remain unknown. For the retrieved candidates $v_{i}^{\prime}$ and $v_{j}$ , we define the association as a tuple $(l', l) = (i, j)$ . Here, we also mimic the association for detections and occlusions by occasionally excluding one of the corresponding candidates from $\mathcal{V}'$ or $\mathcal{V}$ . We replace the excluded candidate by the corresponding dustbin to form the correct association for supervision. More precisely, the simulated associations for redetection and occlusion are expressed as, $(l', l) = (N' + 1, j)$ and $(l', l) = (i, N + 1)$ , respectively. The supervised loss, for each frame-pairs, is then given by the negative log-likelihood of the assignment probability, + +$$ +L _ {\sup } = - \log A _ {l ^ {\prime}, l}. \tag {2} +$$ + +Self-Supervised Loss: To facilitate the association of distractor candidates, we employ a self-supervision strategy. The proposed approach first extracts a set of candidates $\mathcal{V}'$ from any given frame. The corresponding candidates for matching, say $\mathcal{V}$ , are identical to $\mathcal{V}'$ but we augment its features. Since the feature augmentation does not affect the associations, the initial ground-truth association set is given by $\mathcal{C} = \{(i,i)\}_{i=1}^{N}$ . In order to create a more challenging learning problem, we simulate occlusions and redetections as described above for the partially supervised loss. Note that the simulated occlusions and redetections change the entries of $\mathcal{V}$ , $\mathcal{V}'$ , and $\mathcal{C}$ . We make use of the same notations with slight abuse for simplicity. Our feature augmentation involves, randomly translating the location $\mathbf{c}_i$ , increasing or decreasing the score $s_i$ , and transforming the given image before extracting the visual features $\mathbf{f}_i$ . Now, using the simulated ground-truth associations $\mathcal{C}$ , our self-supervised loss is given by, + +$$ +L _ {\text {s e l f}} = \sum_ {(l ^ {\prime}, l) \in \mathcal {C}} - \log A _ {l ^ {\prime}, l}. \tag {3} +$$ + +Finally, we combine both losses as $L_{\mathrm{tot}} = L_{\mathrm{sup}} + L_{\mathrm{self}}$ . It is important to note that the real training data is used only for the former loss function, whereas synthetic data is used only for the latter one. + +Data Mining: Most frames contain a candidate corresponding to the target object and are thus applicable for supervised training. However, a majority of these frames are not very informative for training because they contain only a single candidate with high target classifier score and correspond to the target object. Conversely, the dataset contains adverse situations where associating the candidate corresponding to the target object is very challenging. Such situations include sub-sequences with different number of candidates, with changes in appearance or large motion between frames. Thus, sub-sequences where the appearance + +model either fails and starts to track a distractor or when the tracker is no longer able to detect the target with sufficient confidence are valuable for training. However, such failure cases are rare even in large scale datasets. Similarly, we prefer frames with many target candidates when creating synthetic sub-sequences to simultaneously include candidate associations, red detections and occlusions. Thus, we mine the training dataset using the dumped predictions of the base tracker to use more informative training samples. + +Training Details: We first retrain the base tracker SuperDiMP without the learned discriminative loss parameters but keep everything else unchanged. We split the LaSOT training set into a train-train and a train-val set. We run the base tracker on all sequences and save the search region and score map for each frame on disk. We use the dumped data to mine the dataset and to extract the target candidates and its features. We freeze the weights of the base tracker during training of the proposed network and train for 15 epochs by sampling 6400 sub-sequences per epoch from the train-train split. We sample real or synthetic data equally likely. We use ADAM [30] with learning rate decay of 0.2 every 6th epoch with a learning rate of 0.0001. We use two GNN Layers and run 10 Sinkhorn iterations. Please refer to the supplementary for additional details about training. + +# 3.7. Object Association + +This part focuses on using the estimated assignments (see Sec. 3.5) in order to determine the object correspondences during online tracking. An object corresponds either to the target or a distractor. The general idea is to keep track of every object present in each scene over time. We implement this idea with a database $\mathcal{O}$ , where each entry corresponds to an object $o$ that is visible in the current frame. Fig. 3 shows these objects as circles. An object disappears from the scene if none of the current candidates is associated with it, e.g., in Fig. 3 the purple and pink objects $(\bullet, \bullet)$ no longer correspond to a candidate in the last frame. Then, we delete this object from the database. Similarly, we add a new object to the database if a new target candidate appears $(\bullet, \bullet, \bullet)$ . When initializing a new object, we assign it a new object-id (not used previously) and the score $s_i$ . In Fig. 3 object-ids are represented using colors. For objects that remain visible, we add the score $s_i$ of the corresponding candidate to the history of scores of this object. Furthermore, we delete the old and create a new object if the candidate correspondence is ambiguous, i.e., the assignment probability is smaller than $\omega = 0.75$ . + +If associating the target object $\hat{o}$ across frames is unambiguous, it implies that one object has the same object-id as the initially provided object $\hat{o}_{\mathrm{init}}$ . Thus, we return this object as the selected target. However, in real world scenarios the target object gets occluded, leaves the scene or associating the target object is ambiguous. Then, none of + +![](images/647bcc528b6e689e22bfe526f837f0442fc8623bde35f22ea06103e74e0162c6.jpg) +Figure 3. Visual comparison of the base tracker and our tracker. The bounding boxes represent the tracker result, green [■] indicates correct detections and red [■] refers to tracker failure. Each circle represents an object. Circles with the same color are connected to indicate that the object-ids are identical. If a target candidate cannot be matched with an existing object we add a new object (●, ●, ●). Similarly, we delete the object if no candidate corresponds to it anymore in the next frame (●, ●, ●). + +the candidates corresponds to the sought target and we need to redetect. We redetect the target if the candidate with the highest target classifier score achieves a score that exceeds the threshold $\eta = 0.25$ . We select the corresponding object as the target as long as no other candidate achieves a higher score in the current frame. Then, we switch to this candidate and declare it as target if its score is higher than any score in the history (of the currently selected object). Otherwise, we treat this object as a distractor for now, but if its score increases high enough, we will select it as the target object in the future. Please refer to the supplementary material for the detailed algorithm. + +# 3.8. Memory Sample Confidence + +While updating the tracker online is often beneficial, it is disadvantageous if the training samples have a poor quality. Thus, we describe a memory sample confidence score, that we use to decide which sample to keep in the memory and which should be replaced when employing a fixed size memory. In addition, we use the score to control the contribution of each training sample when updating the tracker online. In contrast, the base tracker replaces frames using a first-in-first out policy if the target was detected and weights samples during inference solely based on age. + +First, we define the training samples in frame $k$ as $(x_{k},y_{k})$ . We assume a memory size $m$ that stores samples from frame $k\in \{1,\ldots ,t\}$ , where $t$ denotes the current + +frame number. The online loss then given by, + +$$ +J (\theta) = \lambda R (\theta) + \sum_ {k = 1} ^ {t} \alpha_ {k} \beta_ {k} Q \left(\theta ; x _ {k}, y _ {k}\right), \tag {4} +$$ + +where $Q$ denotes the data term, $R$ the regularisation term, $\lambda$ is a scalar and $\theta$ represents appearance model weights. The weights $\alpha_{k}\geq 0$ control the impact of the sample from frame $k$ , i.e., a higher value increases the influence of the corresponding sample during training. We follow other appearance based trackers [3, 12] and use a learning parameter $\gamma \in [0,1]$ in order to control the weights $\alpha_{k} = (1 - \gamma)\alpha_{k + 1}$ such that older samples achieve a smaller value and their impact during training decreases. In addition, we propose a second set of weights $\beta_{k}$ that represent the confidence of the tracker that the predicted label $y_{k}$ is correct. Instead of removing the oldest samples to keep the memory fixed [3], we propose to drop the sample that achieves the smallest score $\alpha_{k}\beta_{k}$ which combines age and confidence. Thus, if $t > n$ we remove the sample at position $k = \mathrm{argmin}_{1\leq k\leq n}\alpha_k\beta_k$ by setting $\alpha_{k} = 0$ . This means, that if all samples achieve similar confidence the oldest is replaced, or that if all samples are of similar age the least confident sample is replaced. + +We describe the extraction of the confidence weights as, + +$$ +\beta_ {t} = \left\{ \begin{array}{l l} \sqrt {\sigma}, & \text {i f} \hat {o} = \hat {o} _ {\text {i n i t}} \\ \sigma , & \text {o t h e r w i s e}, \end{array} \right. \tag {5} +$$ + +where $\sigma = \max_{i} s_{i}^{t}$ denotes the maximum value of the target classifier score map of frame $t$ . For simplicity, we assume that $\sigma \in [0,1]$ . The condition $\hat{o} = \hat{o}_{\mathrm{init}}$ is fulfilled if the currently selected object is identical to the initially provided target object, i.e., both objects share the same object id. Then, it is very likely, that the selected object corresponds to the target object such that we increase the confidence using the square root function that increases values in the range [0, 1). Hence, the described confidence score combines the confidence of the target classifier with the confidence of the object association module, but fully relies on the target classifier once the target is lost. + +Inference details: We propose KeepTrack and the speed optimized KeepTrackFast. We use the SuperDiMP parameters for both trackers but increase the search area scale from 6 to 8 (from 352 to 480 in image space) for KeepTrack. For the fast version we keep the original scale but reduce the number of bounding box refinement steps from 10 to 3. In addition, we skip running the association module if only one target caiddate with a high score is present in the previous and current frame. Overall, both trackers follow the target longer until it is lost such that small search areas occur frequently. Thus, we reset the search area to its previous size if it was drastically decreased before the target was lost, to facilitate red detections. Please refer to the supplementary for more details. + +# 4. Experiments + +We evaluate our proposed tracking architecture on seven benchmarks. Our approach is implemented in Python using PyTorch. On a single Nvidia GTX 2080Ti GPU, KeepTrack and KeepTrackFast achieve 18.3 and 29.6 FPS, respectively. + +# 4.1. Ablation Study + +We perform an extensive analysis of the proposed tracker, memory sample confidence, and training losses. + +Online tracking components: We study the importance of memory sample confidence, the search area protocol, and target candidate association of our final method KeepTrack. In Tab. 1 we analyze the impact of successively adding each component, and report the average of five runs on the NFS [24], UAV123 [37] and LaSOT [21] datasets. The first row reports the results of the employed base tracker. First, we add the memory sample confidence approach (Sec. 3.8), observe similar performance on NFS and UAV but a significant improvement of $1.5\%$ on LaSOT, demonstrating its potential for long-term tracking. With the added robustness, we next employ a larger search area and increase it if it was drastically shrank before the target was lost. This leads to a fair improvement on all datasets. Finally, we add the target candidate association network, which provides substantial performance improvements on all three datasets, with a $+1.3\%$ AUC on LaSOT. These results clearly demonstrate the power of the target candidate association network. + +Training: In order to study the effect of the proposed training losses, we retrain the target candidate association network either with only the partially supervised loss or only the self-supervised loss. We report the performance on LaSOT [21] in Tab. 2. The results show that each loss individually allows to train the network and to outperform the baseline without the target candidate association network (no TCA), whereas, combining both losses leads to the best tracking results. In addition, training the network with the combined loss but without data-mining decreases the tracking performance. + +
Memory Sample ConfidenceSearch area AdaptationTarget Candidate Association NetworkNFSUAV123LaSOT
---64.468.263.5
✓--64.768.065.0
✓✓-65.269.165.8
✓✓✓66.469.767.1
+ +Table 1. Impact of each component in terms of AUC (\%) on three datasets. The first row corresponds to our SuperDiMP baseline. + +
Loss Data-miningno TCA n.a.\( L_{sup} \) ✓\( L_{self} \) ✓\( L_{sup} + L_{self} \) -\( L_{sup} + L_{self} \) ✓
LaSOT, AUC (%)65.866.066.966.867.1
+ +Table 2. Analysis on LaSOT of association learning using different loss functions with and without data-mining. + +
Sample Replacement with conf. scoreOnline updating with conf. scoreConf. score thresholdLaSOT AUC (%)
---63.5
✓--64.1
✓✓0.064.6
✓✓0.565.0
+ +Memory management: We not only use the sample confidence to manage the memory but also to control the impact of samples when learning the target classifier online. In Tab. 3, we study the importance of each component by adding one after the other and report the results on LaSOT [21]. First, we use the sample confidence scores only to decide which sample to remove next from the memory. This, already improves the tracking performance. Reusing these weights when learning the target classifier as described in Eq. (4) increases the performance again. To suppress the impact of poor-quality samples during online learning, we ignore samples with a confidence score below 0.5. This leads to an improvement on LaSOT. The last row corresponds to the used setting in the final proposed tracker. + +# 4.2. State-of-the-art Comparison + +We compare our approach on seven tracking benchmarks. The same settings and parameters are used for all datasets. In order to ensure the significance of the results, we report the average over five runs on all datasets unless the evaluation protocol requires otherwise. We recompute the results of all trackers using the raw predictions if available or otherwise report the results given in the paper. + +LaSOT [21]: First, we compare on the large-scale LaSOT dataset (280 test sequences with 2500 frames in average) to demonstrate the robustness and accuracy of the proposed tracker. The success plot in Fig. 4a shows the overlap precision $\mathrm{OP}_T$ as a function of the threshold $T$ . Trackers are ranked w.r.t. their area-under-the-curve (AUC) score, denoted in the legend. Tab. 4 shows more results including precision and normalized precision. KeepTrack and KeepTrackFast outperform the recent trackers AlphaRefine [47], TransT [6] and TrDiMP [43] by a large margin and the base tracker SuperDiMP by $4.0\%$ or $3.7\%$ in AUC. The improvement in $\mathrm{OP}_T$ is most prominent for thresholds $T < 0.7$ , demonstrating the superior robustness of our tracker. In Tab. 5, we further perform an apple-to/apple comparison with KYS [4], LTMU [10], AlphaRefine [47] and TrDiMP [43], where all methods use SuperDiMP as base tracker. We outperform the best method on each metric, achieving an AUC improvement of $1.8\%$ . + +Table 3. Analysis of our memory weighting component on LaSOT. + +
Keep Track FastKeep Refine [47]Alpha [6]TransT [42]Siam [43]Super Dimp [11]STM [23]Pr DiMP [16]DM [55]LTMU [10]DiMP [3]Ocean [54]
Precision70.270.068.069.068.466.365.363.360.859.757.256.7
Norm. Prec77.277.073.273.872.273.072.269.368.866.966.265.0
Success (AUC)67.166.865.364.964.863.963.160.659.858.457.256.9
Table 4. State-of-the-art comparison on the LaSOT [21] test set in terms of AUC score.
+ +![](images/984d42802f7ae985d1ecb023b67d86fbe02a0b538aed70e4503e341a8484e306.jpg) +(a) LaSOT [21] + +![](images/75e542f878e65cd160eed79b8fab3f231c077b9f35e6e04a23b4c9fa2fcd7d00.jpg) +(b) LaSOTExtSub [20] +Figure 4. Success plots, showing $\mathrm{OP}_T$ , on LaSOT [21] and LaSO-TExtSub [20]. Our approach outperforms all other methods by a large margin in AUC, reported in the legend. + +
KeepTrackKeepTrackFastAlphaRefine[47]LTMU[10]TrDiMP[43]KYS[4]SuperDiMP[16]
Precision70.270.068.066.561.464.065.3
Norm. Prec.77.277.073.273.7-70.772.2
Success (AUC)67.166.865.364.763.961.963.1
+ +LaSOTExtSub [20]: We evaluate our tracker on the recently published extension subset of LaSOT. LaSOTExtSub is meant for testing only and consists of 15 new classes with 10 sequences each. The sequences are long (2500 frames on average), rendering substantial challenges. Fig. 4b shows the success plot, that is averaged over 5 runs. All results, except ours and SuperDiMP, are obtained from [20], e.g., DaSiamRPN [56], SiamRPN++ [34] and SiamMask [44]. Our method achieves superior results, outperforming LTMU by $6.8\%$ and SuperDiMP by $3.5\%$ . + +OxUvALT [41]: The OxUvA long-term dataset contains 166 test videos with average length 3300 frames. Trackers are required to predict whether the target is present or absent in addition to the bounding box for each frame. Trackers are ranked by the maximum geometric mean (MaxGM) of the true positive (TPR) and true negative rate (TNR). We use the proposed confidence score and set the threshold for target presence using the separate dev. set. Tab. 6 shows the results on the test set, which are obtained through the evaluation server. KeepTrack sets the new state-of-the-art in terms of MaxGM by achieving an improvement of $5.8\%$ compared to the previous best method and exceed the result of the base tracker SuperDiMP by $6.1\%$ . + +VOT2019LT [32]/VOT2020LT [31]: The dataset for both VOT [33] long-term tracking challenges contains 215,294 frames divided in 50 sequences. Trackers need to predict a confidence score that the target is present and the bounding box for each frame. Trackers are ranked by the F-score, evaluated for a range of confidence thresholds. We compare with the top methods in the challenge [32, 31], as well as more recent methods. As shown in Tab. 7, our tracker achieves the best result in terms of F-score and outperforms the base tracker SuperDiMP by $4.0\%$ in F-score. + +UAV123 [37]: This dataset contains 123 videos and is designed to assess trackers for UAV applications. It contains + +Table 5. Results on the LaSOT [21] test set. All trackers use the same base tracker SuperDiMP [11]. + +
Keep TrackKeep Track FastLTMU [10]Super DiMP [11]Siam R-CNN [42]TACT [7]DM Track [55]SPLT [48]Global Track [28]MBMD [53]Siam FC+R [41]TLD [29]
TPR80.682.774.979.770.180.968.649.857.460.942.720.8
TNR81.277.275.470.274.562.269.477.663.348.548.189.5
MaxGM80.979.975.174.872.370.968.862.260.354.445.443.1
+ +Table 6. Results on the OxUvALT [41] test set in terms of TPR, TNR, and the max geometric mean (MaxGM) of TPR and TNR. + +
Keep TrackKeep Track FastLT.DSE [32, 31]LTMU.B [10, 31]Mega track [31]CLGS [32, 31]RLT DiMP [31]Super DiMP [11]Siam DW.LT [32, 31]ItMBNet [31]
Precision72.370.671.570.170.373.965.767.669.764.9
Recall69.768.067.768.167.161.968.466.363.651.4
F-Score70.969.369.569.168.767.467.066.966.557.4
+ +Table 7. Results on the VOT2019LT [32]/VOT2020LT [31] dataset in terms of F-Score, Precision and Recall. + +
Keep TrackKeep Track FastCRACT [22]TrDiMP [43]TransT [6]Super DiMP [11]Pr DiMP [16]STM Track [23]Siam AttN [50]Siam R-CNN [42]KYS [4]DiMP [3]
UAV12369.769.566.467.569.168.168.064.765.064.9-65.3
OTB-10070.971.272.671.169.470.169.671.971.270.169.568.4
NFS66.465.362.566.265.764.763.5--63.963.562.0
+ +Table 8. Comparison with state-of-the-art on the OTB-100 [45], NFS [24] and UAV123 [37] datasets in terms of AUC score. + +small objects, fast motions, and distractor objects. Tab. 8 shows the results, where the entries correspond to AUC for $\mathrm{OP}_T$ over IoU thresholds $T$ . Our method sets a new state-of-the-art with an AUC of $69.7\%$ , exceeding the performance of the recent trackers TransT [6] and TrDiMP [43] by $0.6\%$ and $2.2\%$ in AUC. + +OTB-100 [45]: For reference, we also evaluate our tracker on the OTB-100 dataset consisting of 100 sequences. Several trackers achieve tracking results over $70\%$ in AUC, as shown in Tab. 8. So do KeepTrack and KeepTrackFast that perform similarly to the top methods, with a $0.8\%$ and $1.1\%$ AUC gain over the SuperDiMP baseline. + +NFS [24]: Lastly, we report results on the 30 FPS version of the Need for Speed (NFS) dataset. It contains fast motions and challenging distractors. Tab. 8 shows that our approach sets a new state-of-the-art on NFS. + +# 5. Conclusion + +We propose a novel tracking pipeline employing a learned target candidate association network in order to track both the target and distractor objects. This approach allows us to propagate the identities of all target candidates throughout the sequence. In addition, we propose a training strategy that combines partial annotations with self-supervision. We do so to compensate for lacking ground-truth correspondences between distractor objects in visual tracking. We conduct comprehensive experimental validation and analysis of our approach on seven generic object tracking benchmarks and set a new state-of-the-art on six. + +Acknowledgments: This work was partly supported by the ETH Zürich Fund (OK), Siemens Smart Infrastructure, the ETH Future Computing Laboratory (EFCL) financed by a gift from Huawei Technologies, an Amazon AWS grant, and an Nvidia hardware grant. + +# References + +[1] Philipp Bergmann, Tim Meinhardt, and Laura Leal-Taixe. Tracking without bells and whistles. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 2 +[2] Luca Bertinetto, Jack Valmadre, João F Henriques, Andrea Vedaldi, and Philip HS Torr. Fully-convolutional siamese networks for object tracking. In Proceedings of the European Conference on Computer Vision Workshops (ECCVW), October 2016. 1 +[3] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning discriminative model prediction for tracking. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 1, 2, 3, 6, 7, 8 +[4] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Know your surroundings: Exploiting scene information for object tracking. In Proceedings of the European Conference on Computer Vision (ECCV), August 2020. 1, 2, 7, 8 +[5] Guillem Braso and Laura Leal-Taixe. Learning a neural solver for multiple object tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2 +[6] Xin Chen, Bin Yan, Jiawen Zhu, Dong Wang, Xiaoyun Yang, and Huchuan Lu. Transformer tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 7, 8 +[7] Janghoon Choi, Junseok Kwon, and Kyoung Mu Lee. Visual tracking by tridentalign and context embedding. In Proceedings of the Asian Conference on Computer Vision (ACCV), November 2020. 8 +[8] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, December 2013. 4 +[9] Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Niessner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 4 +[10] Kenan Dai, Yunhua Zhang, Dong Wang, Jianhua Li, Huchuan Lu, and Xiaoyun Yang. High-performance long-term tracking with meta-updater. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 7, 8 +[11] Martin Danelljan and Goutam Bhat. PyTracking: Visual tracking library based on PyTorch. https://github.com/visionml/pytracking, 2019. Accessed: 1/08/2020. 2, 3, 7, 8 +[12] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ATOM: Accurate tracking by overlap maximization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2, 6 +[13] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ECO: efficient convolution operators for + +tracking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2017. 1, 2 +[14] Martin Danelljan, Gustav Hager, Fahad Shahbaz Khan, and Michael Felsberg. Adaptive decontamination of the training set: A unified formulation for discriminative visual tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 2 +[15] Martin Danelljan, Andreas Robinson, Fahad Shahbaz Khan, and Michael Felsberg. Beyond correlation filters: Learning continuous convolution operators for visual tracking. In Proceedings of the European Conference on Computer Vision (ECCV), October 2016. 2 +[16] Martin Danelljan, Luc Van Gool, and Radu Timofte. Probabilistic regression for visual tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 3, 7, 8 +[17] Patrick Dendorfer, Aljosa Osep, Anton Milan, Konrad Schindler, Daniel Cremers, Ian Reid, Stefan Roth, and Laura Leal-Taixe. Motchallenge: A benchmark for single-camera multiple target tracking. International Journal of Computer Vision (IJCV), 129(4):1-37, 2020. 2 +[18] Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), June 2018. 3, 4 +[19] Mihai Dusmanu, Ignacio Rocco, Tomas Pajdla, Marc Pollefeys, Josef Sivic, Akihiko Torii, and Torsten Sattler. D2-net: A trainable cnn for joint description and detection of local features. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 4 +[20] Heng Fan, Hexin Bai, Liting Lin, Fan Yang, Peng Chu, Ge Deng, Sijia Yu, Mingzhen Huang, Juehuan Liu, Yong Xu, et al. Lasot: A high-quality large-scale single object tracking benchmark. International Journal of Computer Vision (IJCV), 129(2):439-461, 2021. 8 +[21] Heng Fan, Liting Lin, Fan Yang, Peng Chu, Ge Deng, Sijia Yu, Hexin Bai, Yong Xu, Chunyuan Liao, and Haibin Ling. Lasot: A high-quality benchmark for large-scale single object tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 1, 2, 7, 8 +[22] Heng Fan and Haibin Ling. Cract: Cascaded regression-alignment-classification for robust visual tracking. arXiv preprint arXiv:2011.12483, 2020. 8 +[23] Zhihong Fu, Qingjie Liu, Zehua Fu, and Yunhong Wang. Stmtrack: Template-free visual tracking with space-time memory networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 7, 8 +[24] Hamed Kiani Galoogahi, Ashton Fagg, Chen Huang, Deva Ramanan, and Simon Lucey. Need for speed: A benchmark for higher frame rate object tracking. In ICCV, 2017. 7, 8 +[25] Hamed Kiani Galoogahi, Ashton Fagg, and Simon Lucey. Learning background-aware correlation filters for visual + +tracking. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2017. 2 +[26] Fredrik K Gustafsson, Martin Danelljan, Radu Timofte, and Thomas B Schon. How to train your energy-based model for regression. In Proceedings of the British Machine Vision Conference (BMVC), September 2020. 3 +[27] João F. Henriques, Rui Caseiro, Pedro Martins, and Jorge Batista. High-speed tracking with kernelized correlation filters. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 37(3):583-596, 2015. 2 +[28] Lianghua Huang, Xin Zhao, and Kaiqi Huang. Globaltrack: A simple and strong baseline for long-term tracking. In Proceedings of the Conference on Artificial Intelligence (AAAI), February 2020. 8 +[29] Zdenek Kalal, Krystian Mikolajczyk, and Jiri Matas. Tracking-learning-detection. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 34(7):1409-1422, 2012. 8 +[30] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2014. 5 +[31] Matej Kristan, Aleš Leonardis, Jiří Matas, Michael Felsberg, Roman Pflugfelder, Joni-Kristian Kämäräinen, Martin Danelljan, Luka Čehovin Zajc, Alan Lukežić, Ondrej Drbohlav, Linbo He, Yushan Zhang, Song Yan, Jinyu Yang, Gustavo Fernández, and et al. The eighth visual object tracking vot2020 challenge results. In Proceedings of the European Conference on Computer Vision Workshops (ECCVW), August 2020. 8 +[32] Matej Kristan, Jiri Matas, Aleš Leonardis, Michael Felsberg, Roman Pflugfelder, Joni-Kristian Kämäräinen, Luka Cehovin Zajc, Ondrej Drbohlav, Alan Lukezic, Amanda Berg, Abdelrahman Eldisokey, Jani Käpylä, Gustavo Fernández, and et al. The seventh visual object tracking vot2019 challenge results. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshop (ICCVW), October 2019. 8 +[33] Matej Kristan, Jiri Matas, Aleš Leonardis, Tomas Vojir, Roman Pflugfelder, Gustavo Fernandez, Georg Nebehay, Fatih Porikli, and Luka Čehovin. A novel performance evaluation methodology for single-target trackers. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 38(11):2137-2155, 2016. 8 +[34] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. Siamrpn++: Evolution of siamese visual tracking with very deep networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 1, 8 +[35] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[36] Zhengqi Li and Noah Snavely. Megadepth: Learning single-view depth prediction from internet photos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 4 + +[37] Matthias Mueller, Neil Smith, and Bernard Ghanem. A benchmark and simulator for uav tracking. In Proceedings of the European Conference on Computer Vision (ECCV), October 2016. 2, 7, 8 +[38] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 3, 4 +[39] Richard Sinkhorn and Paul Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343-348, 1967. 4 +[40] Siyu Tang, Mykhaylo Andriluka, Bjoern Andres, and Bernt Schiele. Multiple people tracking by lifted multicut and person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 2 +[41] Jack Valmadre, Luca Bertinetto, João F. Henriques, Ran Tao, Andrea Vedaldi, Arnold W.M. Smeulders, Philip H.S. Torr, and Efstratos Gavves. Long-term tracking in the wild: a benchmark. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. 1, 8 +[42] Paul Voigtlaender, Jonathon Luiten, Philip H.S. Torr, and Bastian Leibe. Siam R-CNN: Visual tracking by redetection. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 7, 8 +[43] Ning Wang, Wengang Zhou, Jie Wang, and Houqiang Li. Transformer meets tracker: Exploiting temporal context for robust visual tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 7, 8 +[44] Qiang Wang, Li Zhang, Luca Bertinetto, Weiming Hu, and Philip H.S. Torr. Fast online object tracking and segmentation: A unifying approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 8 +[45] Yi Wu, Jongwoo Lim, and Ming-Hsuan Yang. Object tracking benchmark. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 37(9):1834-1848, 2015. 8 +[46] Jingjing Xiao, Linbo Qiao, Rustam Stolkin, and Alevs. Leonardis. Distractor-supported single target tracking in extremely cluttered scenes. In Proceedings of the European Conference on Computer Vision (ECCV), October 2016. 1, 2 +[47] Bin Yan, Xinyu Zhang, Dong Wang, Huchuan Lu, and Xiaoyun Yang. Alpha-refine: Boosting tracking performance by precise bounding box estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 7, 8 +[48] Bin Yan, Haojie Zhao, Dong Wang, Huchuan Lu, and Xiaoyun Yang. 'skimming-perusal' tracking: A framework for real-time and robust long-term tracking. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 8 +[49] Qian Yu, Gérard Medioni, and Isaac Cohen. Multiple target tracking using spatio-temporal markov chain monte carlo data association. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2007. 2 + +[50] Yuechen Yu, Yilei Xiong, Weilin Huang, and Matthew R. Scott. Deformable siamese attention networks for visual object tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 8 +[51] Jianming Zhang, Shugao Ma, and Stan Sclaroff. MEEM: robust tracking via multiple experts using entropy minimization. In Proceedings of the European Conference on Computer Vision (ECCV), September 2014. 2 +[52] Li Zhang, Yuan Li, and Ramakant Nevatia. Global data association for multi-object tracking using network flows. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2008. 2 +[53] Yunhua Zhang, Lijun Wang, Dong Wang, Jinqing Qi, and Huchuan Lu. Learning regression and verification networks for long-term visual tracking. International Journal of Computer Vision (IJCV), 129(9):2536-2547, 2021. 8 +[54] Zhipeng Zhang, Houwen Peng, Jianlong Fu, Bing Li, and Weiming Hu. Ocean: Object-aware anchor-free tracking. In Proceedings of the European Conference on Computer Vision (ECCV), August 2020. 7 +[55] Zikai Zhang, Bineng Zhong, Shengping Zhang, Zhenjun Tang, Xin Liu, and Zhaoxiang Zhang. Distractor-aware fast tracking via dynamic convolutions and mot philosophy. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. 2, 7, 8 +[56] Zheng Zhu, Qiang Wang, Li Bo, Wei Wu, Junjie Yan, and Weiming Hu. Distractor-aware siamese networks for visual object tracking. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. 1, 2, 8 \ No newline at end of file diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/images.zip b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f061f3f407dab15a1c4fb9470e1c118546459837 --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cae17a1d9417a1a9aac0b343cfb8dabbac442b9ab178c3af1e7337c7ac46f8d2 +size 415191 diff --git a/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/layout.json b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..128d93e98670046c31ac3903f546fe44a3b2cc80 --- /dev/null +++ b/learningtargetcandidateassociationtokeeptrackofwhatnottotrack/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bff2450439e06fa1f2d1fcb70b0067b506e187605efef244e6d9692091a37637 +size 455142 diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_content_list.json b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4cd6ca7b5197ad7dce39e01d051268f8bd7c32f3 --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b80b1663744fde5a093f1e84c335c30c5d548ab11596d87eafc76fe93d2bb17 +size 90320 diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_model.json b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f6602d1a5325809b47b2a075a80824c607597d05 --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9481a681417367018ee22bdc42a5ce0b94fead21f88f073d0c56432b19b7b1b0 +size 110783 diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_origin.pdf b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9515930fdf4adcd03299e3cc20ab820316e37936 --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/a5721013-fffd-4215-8bf0-b5bd42c0d810_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d3868fe5a5c55425673129a55eb08f4838d2c1bbe0b2523cd84fbd3fe482c16 +size 4885616 diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/full.md b/learningtemporaldynamicsfromcyclesinnarratedvideo/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9ed5d9d2677def85b1fa104444199c070885cedf --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/full.md @@ -0,0 +1,406 @@ +# Learning Temporal Dynamics from Cycles in Narrated Video + +Dave Epstein +UC Berkeley* + +Jiajun Wu +Stanford University + +Cordelia Schmid Google + +Chen Sun +Google, Brown University + +# Abstract + +Learning to model how the world changes as time elapses has proven a challenging problem for the computer vision community. We introduce a self-supervised approach to this problem that solves a multi-modal temporal cycle consistency objective jointly in vision and language. This objective requires a model to learn modality-agnostic functions to predict the future and past that undo each other when composed. We hypothesize that a model trained on this objective will discover long-term temporal dynamics in video. We verify this hypothesis by using the resultant visual representations and predictive models as-is to solve a variety of downstream tasks. Our method outperforms state-of-the-art self-supervised video prediction methods on future action anticipation, temporal image ordering, and arrow-of-time classification tasks, without training on target datasets or their labels. + +# 1. Introduction + +Prediction is a central problem in computer vision which researchers have been grappling with since the early days of the field [10, 12, 22, 29, 34, 39, 54]. Previous deep learning methods have largely focused on predicting fixed, small offsets into the future. To understand why this formulation is flawed, consider Figure 1. This figure shows a frame (a) from a video at time $t$ and three frames at times $> t$ . Which of the three should be the output of a model that predicts the future? Option (d) is closest to the future that humans are likely to imagine. By predicting frames such as option (b), which occur in the immediate future [15, 16, 47, 53], we limit the scope of temporal transitions that can be learned by models and hurt downstream performance. + +Motivated by this example, we identify three central challenges in training a model to predict the future. First, manually annotating videos with temporal relationships between frames is prohibitively expensive, and ground truth may be difficult to define. Therefore, models should be + +![](images/ea3e212c768781c6e571b4e1b759dd5bdd8bd2c5b738a0fe908a2330f7c3524e.jpg) +Figure 1. Predicting the future is challenging. Given a frame (a) at time $t$ , previous work focuses on predicting frames at a fixed offset, such as (b). However, these frames are often either redundant or stochastic, motivating the prediction of non-immediate futures. Predicting such a frame is highly non-trivial, as many are irrelevant, such as (c). Aided by the textual information in narrated video, we can learn long-term temporal dynamics in video, and predict (d). We learn these dynamics by solving a multi-modal temporal cycle consistency problem. + +![](images/64de50fbf376edb4eea7ddf6702ea8bc5596f9501a851d31f97ae873205ef6f5.jpg) + +![](images/01c9ba40030d86281364686e9bc7924bbd365fe7cc2ee45ee95b02b14d36030e.jpg) + +![](images/ceecda8f411df629590b17faed7cfbe6622aee354b215f09f8960360edb45080.jpg) + +able to learn from large unlabeled datasets of in-the-wild action and discover transitions autonomously, to enable practical applications. Second, modeling the complex long-term transitions in the real world requires learning high-level concepts, more naturally found in abstract latent representations than raw pixels. Finally, the duration elapsed by temporal transitions can vary significantly depending on context, and models must be able to make predictions at varied offsets into the future. To satisfy these desiderata, we introduce a new self-supervised training objective, Multi-Modal Temporal Cycle Consistency (MMCC), and a model that learns a representation to solve it. + +We show the MMCC objective in Figure 2. Starting from a sampled frame in a narrated video, our model learns to attend among all narration text to retrieve a relevant utterance. Combining both modalities, the model learns a function to predict a latent future, attending over the entire video to retrieve a future frame. This frame's corresponding utterance is estimated, and a function to predict a past frame is learned in a similar way. The cycle constraint requires that the final model prediction be equal to the starting frame. + +MMCC addresses all three challenges discussed above. In Figure 1, only (d) is a viable solution to our cycle formulation. Selecting (c) as a future would not allow the model to return to (a), since the two frames have no clear relation + +ship. On the other hand, because the model does not know which modality its input comes from—and therefore must operate equally on vision and language—it is discouraged from selecting lower-level future frames such as (b), which likely do not accompany a predictable change in text. + +We show that our model, trained end-to-end from scratch to solve the MMCC objective on the HowTo100M dataset [37], captures long-term dynamics in its predictive model of the future, and can be used without further training to anticipate future actions, order image collections, and identify salient temporal relationships in long videos. It also learns representations of video and text that contain information relevant to modeling temporal dynamics, which we demonstrate to be crucial to the quality of prediction. + +Our main contributions are: + +- MMCC, a self-supervised multi-modal temporal cycle consistency objective that requires learning visual representations attuned to temporal dynamics, as well as long-term predictive models of the future and past. +- An attention-based model to solve this objective, which uses cross-modal and temporal cues to discover relationships through time in video. +- Since no previous self-supervised benchmarks exist in this area, a suite of qualitative and quantitative tasks to evaluate learned representations and predictive models. Our model outperforms the self-supervised SOTA in video prediction on all tasks. + +# 2. Related Work + +Modeling the future. Building predictive models of the future is a long-studied task in the computer vision community. Early work considers generating or warping pixels or optical flow to synthesize immediate futures [3, 11, 32, 41, 42, 46, 54, 55, 56, 57, 64]. More recent work attempts to model uncertainty in pixel-space, often by learning a distribution of futures that can be sampled [8, 18, 21, 27, 29, 48, 51, 52, 62]. These approaches tend to focus on synthetic or very short-term data, since synthesis is challenging in real video. Rather than predicting pixels, another line of work uses supervision to predict future action labels [19, 24, 28, 36, 45]. Sun et al. [49] also uses narrated video, but quantizes input video using Kinetics supervision, then learns a transformer-based model of vision-and-language sequences. Instead of using supervision, Vondrick et al. [53] predicts representations which are trained to capture abstract concepts but are automatically obtained on large collections of data. Recent work extends this, using contrastive learning or other techniques to predict future representations [13, 15, 16, 47, 60]. With very few exceptions [21], this line of work is concerned with predicting + +![](images/5a5952fdbdcb060bb16210f2d264f3b66b93c8839293230b7fc7de39097d5e06.jpg) +Figure 2. Learning temporal dynamics with cycles. Given an image (here, second from left) as a start node, our model finds corresponding text to build a start state. From this, our model predicts a future image and again builds a multi-modal state. Finally, our model predicts a past image from the future state. The discrepancy between this prediction of the past and the start image gives our cycle-consistency loss. To solve this problem, we learn the temporal and cross-modal edges using soft attention. + +time $t + 1$ given time $t$ . This formulation is highly constraining. Our model can predict arbitrarily far into the future and learns long-term dynamics from unlabeled, narrated video. + +Learning from unlabeled narrated video. Self-supervised learning has a long history, even dating back to the early 1990s, where De Sa [6] considered audiovisual data to "derive label[s] from a co-occurring input to another modality". We join an increasingly popular line of work and leverage automatic textual transcripts extracted from narrated videos uploaded online. Combining video and text has been widely explored in the deep learning era, with datasets largely focusing on manual textual annotation of video [2, 5, 61, 65] or on movies which have provided scripts [43, 44]. Other work instead learns from automatic transcripts of narrations in instructional videos [1, 33, 63]. A main benefit of learning from unlabeled video is that it unlocks unprecedented scales of data; Miech et al. [37] introduces a dataset of over 100 million video clips and their narration transcripts, which is later used to learn strong models of cross-modal correspondence [35]. We are inspired by their success in training vision-and-language models on large collections of narrated video, and build on their data and approach to learn temporal dynamics. + +Learning with self-supervised cycles. Cycle consistency was recently proposed [66] as a natural cue for learning from unlabeled data or when ground truth is unavailable. In Zhu et al. [67], cycles are used for unpaired imaged-to-image translation; Recycle-GAN [4] builds on this in follow-up work that incorporates simple temporal predic + +tion (one timestep into the future) into these cycles. Kulkarni et al. [26] uses cycles to learn mappings between canonical 3D surfaces and 2D images. Dwibedi et al. [9] uses cycles to enforce that moments from two different videos should be mutual nearest neighbors, aligning action sequences and learning features useful for downstream tasks. Another line of work uses cycles to track objects through time [20, 58], tracking a pixel forward and then backward in time and requiring that the final pixel be the same as the start pixel. We are inspired by all these applications and introduce a new type of temporal cycle, one which not only incorporates multi-modal information into its learning, but also predicts dynamically into the future, instead of at a fixed offset. In particular, we draw inspiration from Jabri et al. [20], which casts temporal edges as contrastive comparisons (i.e., attention) among candidate nodes. + +# 3. Learning to Cycle through Narrated Video + +Our model learns long-term temporal dynamics by cycling through narrated video. We formulate the cycle consistency problem as follows: Given a moment $M_{i}$ in a start modality $M$ (either video $V$ or text $T$ ), retrieve a corresponding moment in the other modality $M'$ , then use both modalities to select a future moment in $M$ . From this future moment, find a correspondence in $M'$ , then select a past moment in $M$ . For the cycle to be complete, this final moment must be the same as the initial moment $M_{i}$ . We illustrate the cycle in Figure 2. Solving this problem requires learning forward- and backward-in-time predictive functions that invert each other, as well as image and sentence embeddings that capture inter-modal correspondences and temporally relevant information. + +# 3.1. Cycles as repeated soft attention + +Let $V_{t_0:t_1}$ and $T_{t_0:t_1}$ be sequences of video and text, respectively, drawn from some temporal interval $[t_0,t_1]$ . These sequences can be discretized into frames $\{V_i\}_{i = 1}^{N_V}$ and utterances $\{T_i\}_{i = 1}^{N_T}$ , where $N_V, N_T$ are the number of instances the sequence is split into. We refer to each instance as a node, which allows viewing the training goal as learning a cyclic path through a graph, as depicted in Figure 2. + +In order to differentiate through the cycle generation process, let $uv$ be an edge in the graph shown in Figure 2. We implement edges as soft retrievals of $v$ given $u$ , as shown in Figure 3. This soft retrieval operation can be viewed as an application of the well-known attention mechanism [50]. + +We start by running all visual and textual nodes through embedding networks $\Phi_T$ and $\Phi_V$ initialized with random weights. We use the architecture from [35] for embedding text nodes and a ResNet-18 [17] for visual nodes. This operation yields series of embeddings $\{z_{V_i}\}_{i = 1}^{N_V}$ and $\{z_{T_i}\}_{i = 1}^{N_T}$ . + +We then compute the cycle edges, where each edge is an instance of soft attention as described above. The atten + +![](images/57d022a74df646fdea9d80fcf97ce65c844ed5d692a55634c057b0151c3828f8.jpg) +Figure 3. Structure of a cycle edge: We learn to embed all visual and textual nodes with $\Phi_V$ and $\Phi_T$ . We then compute the cross-modal node corresponding to the start node with attention across the other modality. Both node representations are passed into an MLP $g_{\mathrm{fwd}} \circ f$ , which predicts the future using attention across the start modality. The process is then repeated to go backward in time, replacing $g_{\mathrm{fwd}}$ with $g_{\mathrm{back}}$ . Our loss trains the model's final output to close the cycle by predicting the start node. + +tion operation $\mathbf{Attn}(Q,K,V)$ accepts sets of query, key, and value vectors $Q\in \mathbb{R}^{N_Q\times d},K,V\in \mathbb{R}^{N_K\times d}$ and returns a set of new values $Z\in \mathbb{R}^{N_Q\times d}$ , computed (with $\tau$ -temperature softmax along the second dimension) as + +$$ +Z = \operatorname {A t t n} (Q, K, V) = \operatorname {S o f t m a x} \left(\frac {Q K ^ {T}}{\tau}\right) V. \tag {1} +$$ + +To cycle through narrated video, we first select a modality $M \in \{T, V\}$ and a start node $M_{\alpha} \in M_{t_0:t_1}$ (we describe the process for selecting $M_{\alpha}$ in Section 3.3). We find the representation of the corresponding node in the other modality $M'$ with a cross-modal attention edge: + +$$ +z _ {M _ {\alpha} ^ {\prime}} = \mathbf {A t t n} \left(\pi_ {M _ {\alpha}}, \left\{\pi_ {M _ {i} ^ {\prime}} \right\} _ {i = 1} ^ {N _ {M ^ {\prime}}}, \left\{z _ {M _ {i} ^ {\prime}} \right\} _ {i = 1} ^ {N _ {M ^ {\prime}}}\right). \tag {2a} +$$ + +We learn to project representations $z$ into a shared semantic space, using a modality-specific projector $\Pi_M: \mathbb{R}^d \to \mathbb{R}^d$ that outputs vectors $\pi$ . For notational convenience, we denote by $\mathbf{Atttn}_{n_0:n_1}$ the same attention operation which considers keys (and values) at indices $\{n_0,\dots,n_1\}$ . In this notation we can rewrite the above as: + +$$ +z _ {M _ {\alpha} ^ {\prime}} = \mathbf {A t t n} _ {1: N _ {M ^ {\prime}}} \left(\pi_ {M _ {\alpha}}, \left\{\pi_ {M _ {i} ^ {\prime}} \right\}, \left\{z _ {M _ {i} ^ {\prime}} \right\}\right). \tag {2b} +$$ + +The representations from both modalities are concatenated and run through a multi-layer perceptron $f: \mathbb{R}^{2d} \to \mathbb{R}^d$ . This operation yields $z_{\alpha} = f(z_{M_{\alpha}}, z_{M_{\alpha}'}')$ , embedding the joint information back into the shared semantic space. This choice also allows us to train our temporal edges without cross-modal information and accept input from only one + +modality with some probability $p_{\mathrm{unimodal}}$ , since $\Phi_V$ and $\Phi_T$ also map to $z$ -space, in $\mathbb{R}^d$ . + +Our model must now go from this multi-modal state representation $z_{\alpha}$ to a future state representation $z_{\beta}$ . First, we predict an estimated representation of the future in projection $(\pi)$ space, with an MLP $g_{\mathrm{fwd}}$ . We then retrieve the node in modality $M$ corresponding to this future state with a forward-in-time attention edge: + +$$ +z _ {M _ {\beta}} = \mathbf {A t t n} _ {1: N _ {M}} \left(g _ {\mathrm {f w d}} \left(z _ {\alpha}\right), \left\{\pi_ {M _ {i}} \right\}, \left\{z _ {M _ {i}} \right\}\right). \tag {3} +$$ + +It is important to note that attention is order-invariant in $K$ and $V$ , i.e. shuffling rows of $K$ and $V$ yields the same output $Z$ , since the individual matrix-row multiplications are agnostic to row index. This means that, importantly, the model is not given temporal information about input nodes, which could be used as a shortcut in learning2. We then retrieve the corresponding node in $M'$ , $z_{M'_\beta}$ , with another cross-modal edge, projecting queries and keys into $\pi$ -space: + +$$ +z _ {M _ {\beta} ^ {\prime}} = \mathbf {A t t n} _ {1: N _ {M ^ {\prime}}} \left(\pi_ {M _ {\beta}}, \left\{\pi_ {M _ {i} ^ {\prime}} \right\}, \left\{z _ {M _ {i} ^ {\prime}} \right\}\right). \tag {4} +$$ + +As before, these vectors are combined to yield a future state representation $z_{\beta} = f(z_{M_{\beta}},z_{M_{\beta}^{\prime}})$ . + +This process is repeated to predict backward in time. We compute $g_{\mathrm{back}}(z_{\beta})$ , where $g_{\mathrm{back}}$ shares its first few layers with $g_{\mathrm{fwd}}$ to allow learning features useful for dynamics in either direction (see Section 3.5 for more details). To close the cycle, we compute the normalized similarity scores between $g_{\mathrm{back}}(z_{\beta})$ and the $\pi$ -space nodes in $M$ : + +$$ +\mathbf {p} = \mathbf {A t t n} _ {1: N _ {M}} \left(g _ {\text {b a c k}} \left(z _ {\beta}\right), \left\{\pi_ {M _ {i}} \right\}, \{1 \}\right). \tag {5} +$$ + +We train our system with the negative log likelihood loss on the score vector cycling back to the location of $M_{\alpha}$ , which we denote $i_{\alpha}$ : + +$$ +\mathcal {L} _ {\text {c y c l e}} = - \log \mathbf {p} ^ {(i _ {\alpha})}. \tag {6} +$$ + +# 3.2. Cross-modal correspondence + +A key component of our cycle model is the ability to find correspondences between vision and language. Eqs. 2b and 4 crucially rely on this ability in order to incorporate multimodal information into temporal edges. Recent work has demonstrated remarkable progress in training models on massive datasets for this cross-modal retrieval task: given a moment at time $t$ in one modality of a video - $M_t$ - find the matching moment in the other modality $M'$ . + +We build on the approach presented in [35] which uses a contrastive loss to train representations of vision and language, where temporally co-occurring information is considered ground truth ( $M_t$ should retrieve $M_t'$ ), and other vision-language pairs are used as negatives. To handle the + +common misalignment intrinsic to real-world video, [35] allows for representations within $k$ nodes of the ground truth node $M_t'$ to be considered as positives. We adopt this approach to learn cross-modal correspondence, training it for finer-grained discrimination among a set of candidate moments drawn from the same video as opposed to randomly across the entire dataset. We denote the loss used to train cross-modal correspondence $\mathcal{L}_{\mathrm{cross - modal}}$ . For the full cross-modal formulation, please see Supplementary Material. + +# 3.3. Starting the cycle + +Our model will be unable to learn semantic transitions between states if the initial input node depicts noisy or unclear data. This is especially probable when training on unconstrained, real-world video datasets. Therefore, instead of randomly sampling start nodes, we sample from a distribution defined by a "concreteness" score $s_i$ . We calculate this score for each node $M_i \in M$ as the highest cross-modal similarity between $M_i$ and some node $M_j'$ in the other modality. Intuitively, this score captures concreteness since frames and utterances that align strongly tend to contain objects or actions which are salient in both modalities: + +$$ +s _ {i} = \max _ {j} \left(\pi_ {M _ {i}} \cdot \pi_ {M _ {j} ^ {\prime}}\right) \tag {7} +$$ + +We run the above scores through a softmax with $\tau = 0.1$ , yielding a distribution from which we sample $M_{\alpha}$ . + +# 3.4. Avoiding collapse + +Training on the above formulation of $\mathcal{L}_{\mathrm{cycle}}$ in practice may lead to fast collapse to a simple "looping in place" solution, where temporal edges always point to the current node. We propose two strategies to prevent this collapse: + +Constraining candidate nodes. We can limit the range of temporal edges during training by removing nodes from $K$ and $V$ in Eqs. 3 and 5. We rewrite Eq. 3 with $\mathbf{Attn}_{i_{\alpha} + 1:N_M}$ , i.e., since we know the index the cycle starts from, we can consider only those nodes after the start point in the forward edge. We similarly rewrite Eq. 5 with $\mathbf{Attn}_{1:\mathrm{index}(z_{M_\beta}) - 1}$ where $\mathrm{index}(z_{M_\beta}) = \arg \max_i(g_{\mathrm{fwd}}(z_\alpha)\cdot \pi_{M_i})$ , i.e., the index of the node with highest similarity to the latent predicted future. This constrains the backward edge to only consider nodes that precede the estimated current index. This can also be seen as resolving the sign ambiguity inherent to the unconstrained formulation which allows the model to go back-then-forward or vice versa. Importantly, we run the model without this constraint at test time. + +Penalizing visual similarity. Alternatively, we can encourage our model to select visually diverse nodes in its temporal edges: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {s i m}} = \max \left(\cos \left(z _ {V _ {\alpha}}, z _ {V _ {\beta}}\right) - m, 0\right) \tag {8} \\ + \max \left(\cos \left(z _ {V _ {\beta}}, z _ {V _ {\alpha , \text {b a c k}}}\right) - m, 0\right), \\ \end{array} +$$ + +where $z_{V_{\alpha, \mathrm{back}}}$ is the visual representation given by Eq. 5, replacing the values with $\{z_{M_i}\}$ , and $m = 0.5$ is a margin. + +In practice, we combine both the above strategies for the strongest results. + +# 3.5. Implementation + +We combine $\mathcal{L}_{\mathrm{cycle}}$ , $\mathcal{L}_{\mathrm{cross - modal}}$ , and $\mathcal{L}_{\mathrm{sim}}$ in our final loss: + +$$ +\mathcal {L} = \lambda_ {1} \mathcal {L} _ {\text {c y c l e}} + \lambda_ {2} \mathcal {L} _ {\text {c r o s s - m o d a l}} + \lambda_ {3} \mathcal {L} _ {\text {s i m}}. \tag {9} +$$ + +We embed images into $\mathbb{R}^d$ ( $d = 512$ ) using a ResNet-18 [17], and embed text using a word embedding matrix followed an MLP and global pooling, as in [35]. + +We implement all modules $(\Pi_M, f, g_{\mathrm{fwd}}, g_{\mathrm{back}})$ as MLPs, where each layer is followed by ReLU and a LayerNorm except for the final layer, which is followed by $l_2$ normalization if its output is in $\pi$ -space. $\Pi_M$ and $f$ are one-layer MLPs, and $g_{\mathrm{fwd}}, g_{\mathrm{back}}$ are four-layer MLPs, with weights of the first two layers shared. We randomly sample batches of video segments of maximum duration $t_1 - t_0 = 64\mathrm{sec}$ . The sparsity at which data is sampled affects the time elapsed by input videos in a batch as well as the granularity of visual information provided to the model. Denser data is less likely to miss key moments, but more likely to contain redundant information. We therefore train models on various image sampling frame rates $r \in \{0.25\mathrm{fps}, 0.5\mathrm{fps}, 1\mathrm{fps}\}$ . + +Because good cross-modal correspondence is necessary to learn strong, semantic cycles, we initialize $\lambda_{2} = 1$ and exponentially increase $\lambda_{1}$ from some small value $\epsilon$ up to 1, across 30 epochs. We peg $\lambda_{3} = 3\lambda_{1}$ when using the similarity loss. For further details on training and architecture, please see Supplementary Material. + +# 4. Experiments + +This sections examines the design choices and learned temporal dynamics of our model. Since most previous benchmarks focus on supervised action anticipation with fixed categories and time offsets [5, 25], we design a suite of qualitative and quantitative experiments to evaluate different approaches. + +# 4.1.Data + +We train our model on unconstrained real-world video data. Specifically, we use a subset of the HowTo100M dataset [37], which contains around 1.23 million videos and their automatically extracted audio transcripts. Videos in this dataset are roughly categorized by subject area, and we use only the videos categorized "Recipe", around a quarter of the dataset. We build a train-validation-test split such that of 338,033 total recipe videos, $80\%$ are in train, $15\%$ in validation, and $5\%$ in test. Recipe videos are rich in complex objects, actions, and state transitions, and the subset allows us to train models faster. + +For more controlled testing, we use the CrossTask dataset [68], which contains similar videos along with task-specific annotations. Videos are associated with tasks (e.g., "making pancakes"), where each task has a predefined sequence of high-level subtasks with rich long-term temporal inter-dependencies (e.g., ["pour flour into bowl", "crack egg into bowl", ..., "drizzle maple syrup ]). Video segments that depict one of these subtasks are annotated as such. + +# 4.2. Previous work and baselines + +Baselines: We evaluate purely cross-modal features (Section 3.2), given by frozen embedding nets $\Psi_V$ , $\Psi_T$ , and also use these features as prediction targets for RA and TAP below. We also study ImageNet supervised features [7]. + +Representation Anticipation (RA): As a representative of the self-supervised line of work in predicting a fixed offset into the future, we implement RA [53] on our data and architecture, training a model to predict frozen representations of a network trained for cross-modal correspondence. In vision, we train the network to anticipate one second into the future, while in text, we anticipate the subsequent utterance (on average, $\sim 2$ seconds into the future). We train: + +$$ +\underset {\Phi_ {V}, \Phi_ {T}, f _ {t + 1}} {\arg \min } - \cos \left(f _ {t + 1} \left(\Phi_ {M} \left(M _ {i}\right)\right), \Psi_ {M} \left(M _ {i + 1}\right)\right), \tag {10} +$$ + +Time-Agnostic Prediction (TAP): Noting the restrictive nature of the fixed offset formulation, TAP [21] introduces the minimum-across-time formulation to allow the prediction of "bottleneck" predictable moments. We implement their loss, taking the minimum across all future moments in the sampled video segment: + +$$ +\underset {\Phi_ {V}, \Phi_ {T}, f _ {t + 1}} {\arg \min } \underset {i < i ^ {\prime} \leq N _ {M}} {\min } - \cos \left(f _ {t + \Delta} \left(\Phi_ {M} \left(M _ {i}\right)\right), \Psi_ {M} \left(M _ {i ^ {\prime}}\right)\right). \tag {11} +$$ + +While the above two models do not consider the exact same setting as us, we re-implement their approaches as faithfully as possible, training them to predict SOTA features trained for cross-modal correspondence. + +MemDPC: In order to efficiently model multiple future hypotheses, MemDPC [16] casts future prediction as estimation of convex combinations of memories stored in a codebook, and achieves SOTA performance on tasks of interest. We evaluate their trained visual future prediction model, which does not take textual information as input. + +# 4.3. Evaluating cycle consistency + +Central to our formulation is the model's ability to learn dynamic predictions of the future and past that undo each other, as well as finding strong cross-modal correspondences. Thus, we begin by evaluating how well different model variants are able to solve our self-supervised objective on the Recipes test set. We ablate various design + +
ChoiceVariantPercentile rank
CycleCross-modal
Temporal constraintNone*--
Similarity loss93.174.4
Max-index92.674.3
Max-index + sim. loss93.675.7
Multi-modal info.punimodal = 189.874.3
Punimodal = 0.593.675.7
Punimodal = 096.575.9
Start point selectionCross-modal similarity93.675.7
Random88.774.5
Input embeddingFine-tuned93.675.7
Frozen cross-modal [35]67.576.8
Cycle pathWithin modalities93.675.7
Across modalities85.073.2
Chance50.050.0
+ +Table 1. Cycle-back and cross-model accuracy: We evaluate models on the percentile rank assigned to ground truth in the cycle and cross-modal tasks on the Recipes test set ( $100 =$ ground truth ranked first, $0 =$ ranked last). Used options are shown in bold. \*Without any temporal constraint, training collapses. + +choices, including multi-modal information usage, cycle edge order, and temporal constraints on edges. + +Multi-modal information: As an alternative to defining the state as a learned combination of visual and textual representations $z_{\alpha} = f(z_{M,\alpha},z_{M^{\prime},\alpha})$ , we can use only one modality at a time, giving $z_{\alpha} = z_{M,\alpha}$ . The frequency at which only unimodal information is used can be controlled by a hyperparameter $p_{\mathrm{unimodal}}$ . + +Cycle path: The above formulation navigates between moments in the start modality $M$ , optionally using information from $M'$ to augment representations. We denote this variant Within modalities. The order of these edges can also be permuted, such that cycles start in $M$ , retrieve a moment in $M'$ , find a future moment in $M'$ , then cycle back through $M$ . This variant is denoted Across modalities. + +Evaluating variants: To compare between different variants, we measure the average percentile rank (e.g. $100 =$ ground truth is ranked first among all candidates, $50 =$ ranked in the middle, $0 =$ ranked last) assigned by our model to ground truth cross-modal and cycle nodes. We show this ablation study in Table 1, observing significant gains using our cycle configuration. We hypothesize that across-modality cycles perform worse since switching modalities acts as a bottleneck, forcing the model to discard information that would be useful for subsequent edges. + +Visualizing cycles: We show examples of cycles discovered by the trained model in Figure 4. Our model correctly cycles back around $66\%$ of the time (chance is $4\%$ ). The model appears to traverse video according to long-term dynamics, as hypothesized. Note that these transitions occur up to one minute apart, highlighting the importance of allowing dynamic prediction offsets. + +![](images/e49ece2e257c4e9829fc7f6c0ce6ccd4b4b25979bde3c248a92daa662a2db3e1.jpg) +Figure 4. Emergent long-term temporal dynamics: We show examples of learned model cycles in the Recipes test set. Given a start node (top: text, bottom: image) sampled as described in Section 3.3, we show the retrieved cross-modal node, the predicted future node and its cross-modal retrieval, and the model's final backward prediction. In the bottom row, we show a failure case, where the forward edge skips too far ahead and breaks the cycle. + +# 4.4. Zero-shot prediction + +Ranking transitions by likelihood: To directly evaluate the learned representations $\pi$ and functions $g_{\mathrm{fwd}}$ and $g_{\mathrm{back}}$ , we can visualize the pairs of frames $(u, v)$ for which the probability of $v$ being the future of $u$ is highest. We model this probability as the product of the likelihood of states $u$ and $v$ and the forward and backward likelihood of $u \to v$ : + +$$ +P _ {\mathrm {f w d}} (v | u) = \frac {e ^ {\pi_ {\mathrm {f w d}} \cdot \pi_ {v}}}{\sum_ {m \in M} e ^ {\pi_ {\mathrm {f w d}} \cdot \pi_ {m}}}, \tag {12} +$$ + +$$ +P _ {\text {b a c k}} (u | v) = \frac {e ^ {\pi_ {\text {b a c k}} \cdot \pi_ {u}}}{\sum_ {m \in M} e ^ {\pi_ {\text {b a c k}} \cdot \pi_ {m}}}, +$$ + +$$ +P (u \rightarrow v) = P _ {\mathrm {f w d}} (v | u) \cdot P _ {\mathrm {b a c k}} (u | v) \cdot P (u) \cdot P (v), +$$ + +where $\pi_{\mathrm{fwd}}, \pi_{\mathrm{back}}$ are the result of running $u$ and $v$ (optionally with cross-modal information) through $g_{\mathrm{fwd}}, g_{\mathrm{back}}$ and $P(x)$ is the concreteness score defined in Equation 7. + +We compute this probability efficiently for all $n^2$ pairs in long clips of continuously sampled video ( $n \approx 600$ ). We then look at the top temporal transitions discovered by the model in each video. We show results on the Recipes test set in Figure 5. The top transitions show clear state transi + +![](images/5a241dd3ab279b2275242b692db97e4fdf0d37f15a1b47aa56814504745cc19b.jpg) +Figure 5. Discovering transitions in video: Once trained, the learned model of temporal dynamics can be applied to long (5-10 min.) video sequences to discover the most salient pairwise transitions $u \rightarrow v$ . We compute the probability of a transition as defined in Eq. 12 and show the highest-score transitions in 10 different Recipes test set videos. + +tions such as adding chocolate chips to dough, segmenting an orange, and baking a loaf. These predictions could not be made by a model trained to predict a fixed future, since they occur at varied temporal offsets. + +Predicting future actions: Existing benchmarks e.g. [5, 25] focus on predicting action from a few frames in the immediate past or present. Instead, given a few frames, we wish to predict long-term temporal dynamics, which may unfold arbitrarily far into the future. While the former task is more well-defined, the latter is more interesting and relevant. However, ground truth for this task – i.e., per-frame annotation of related future action – is not widely available. We propose using CrossTask task steps as a proxy, since they capture long-term temporal relationships in video. + +For a video $V$ belonging to task $\tau$ (with $N_{\tau}$ predefined subtasks), let $v \in V$ be a clip with subtask label $T_{\tau, i}$ ( $i^{\text{th}}$ in the predefined sequence). We would like to predict future actions $T_{\text{future}} = \{T_{\tau, j}\}_{j=i+1}^{N_{\tau}}$ from $v$ . For example, given a short clip of eggs being added to a bowl with flour, the model should assign high likelihoods to subtasks such as "mix batter" and low likelihoods to "crack eggs" or "season steak". Formally, we define a future likelihood score given a video segment $v$ and candidate future subtask $T_j$ . We first sample frames from the video segment and compute their average embedding $\bar{z}_v$ . The likelihood score uses our learned representations and predictive model to define a + +
ModelRecallPercentile rank
@ 1@ 5@ 10WorstMeanBest
MemDPC* [16]2.915.827.425.648.471.4
Cross-modal [35]2.914.224.328.247.968.2
Repr. Ant. [53]3.013.326.025.747.771.4
TAP [21]4.517.127.928.350.171.6
MMCC (ours)5.419.933.833.055.076.9
+ +Table 2. Predicting future actions: We evaluate models' ability to anticipate action at a high level, potentially minutes into the future, without any fine-tuning. On the CrossTask dataset [68], our model outperforms the previous self-supervised state of the art in inferring possible future actions. *We evaluate MemDPC by clip retrieval since it does not have a textual representation. + +score $s_{v \to j} = g_{\mathrm{fwd}}(\bar{z}_v) \cdot \pi_{T_j}$ . We compute likelihood scores for all subtask descriptions in the CrossTask validation set, and consider the model's prediction correct if any of the future actions in $T_{\mathrm{future}}$ are predicted, since not all future subtasks are necessarily related to the given visual state. + +Table 2 shows recall and percentile rank statistics for this task. We compare our model to [16, 21, 53], replacing $g_{\mathrm{fwd}}$ with each method's predictive model. Since [16] is vision-only, we set $\pi_{T_j}$ to the average visual representation of all video segments with a given subtask label $T_j$ . We also define a cross-modal similarity score $s_{v \to j} = \bar{\pi}_v \cdot \pi_{T_j}$ as a strong baseline, taking advantage of contextual similarities in video and text. Our model outperforms all baselines and self-supervised state of the art on detecting the temporal relationships between visual states and future actions. + +# 4.5. Further analysis + +Unshuffling bags of frames: The ability to order a shuffled set of states is used to evaluate human language and common-sense reasoning skills, and has been explored as a learning signal in NLP [14, 30, 31]. This same ability can also be used to discover temporal structure and summaries of events from large image datasets, as in [23]. We solve this problem by finding the optimal explanation of shuffled video given by iterative application of our temporal dynamics model. Out of all $n!$ possible orderings $\{i_1, i_2, \ldots, i_n\}$ , we select the one for which $\prod_j P(x_{i_j} \to x_{i_j + 1})$ is highest. + +Given $P(u \to v)$ scores computed by Eq. 12, we induce a fully-connected directed graph with sampled frames as nodes and edge weights given by weight $(u\vec{v}) \equiv -\log P(u \to v)$ . Adding a special null node connected to all other nodes with edge weight 0 allows running this graph through an off-the-shelf traveling salesperson problem (TSP) solver3. The optimal TSP solution then represents the lowest-cost (ordered) path through all video clips, effectively unshuffling the input. + +We run this experiment on CrossTask, where videos are annotated with ordered steps and their associated temporal + +![](images/904405a9015218626c5442385bd2f97ddd73ed70fc9a290b3cd6f987507efe01.jpg) + +![](images/7071e22c8cf1402285a5d2952b6b61e5db3825ffd14ea0ea94175689908aa83c.jpg) + +![](images/7fd5335b30ef1adb0fda636e183bfd6ad2406320683571ae473c03e80f61daea.jpg) + +![](images/91a4de481cf45b8c7472cda1268416cefc9bf77a3c6f14c72c75f4acaffa8817.jpg) + +![](images/14d58c7328e5c9127e523f9e309e1d6435be0c00a65c1f5b50f943b5bf448a7e.jpg) + +![](images/80d57950cc8c784ffbb1d8b32039a5722b8b777af7c8bc6dafff70534009ef89.jpg) + +![](images/ae86dac179db3224b552072a651824dfd1b4095885a7145d99148bb3e473846f.jpg) + +![](images/b0ac483fc176ccf1e21a31f0492737a5c9b134055a20e72bc0c82d343bcfd517.jpg) + +![](images/76541b929ba98852b7bf16fb407e1fae7aa4e924d5e39d35c66e110c468dacf4.jpg) + +![](images/1a387491c47aa93fd61186722212c733328b39d25448c71e477c2b00846366fb.jpg) + +![](images/644736bf3eb1369f38bf885aeb4b4064915b7811aea05c9ed69df0ff3322af91.jpg) + +![](images/95d619b690a5bed27cc61caa531d2d8b934d41c9a4f37b769f2e0531f24312ec.jpg) + +![](images/8957bb97360f76bc9b33261692f9915a617c13d62aff319378b545782ed30539.jpg) + +![](images/2bb0ed8a8b1a2efe9e6d124cfab30b3e3f4ba7a8a81f2d6ad0227d872aafbf0f.jpg) + +![](images/5476d7da173fa825fe993ff350273b70669471f89b909be0da899bc54514fd58.jpg) +Figure 6. Unshuffling image collections: We show example video sequences in the ordering given by treating the induced graph of log-likelihoods as an instance of the traveling salesperson problem. We list the ground truth index in the sequence under each clip. Even accepting only sparse video frames as input, our model makes reasonable predictions on this challenging task. + +![](images/cb78440371c3b7e0341e043eb6b0871935bab0350479803c2305ff533da245ac.jpg) + +![](images/b8a1b1e2353d9072a75ba268a854ac0b4f9a592e5f2e665ebc82382b43b746ba.jpg) + +![](images/176168caf4ae4dd90ffead3429193de75ea31b010d96ca4ea51bb2ec4d237cb8.jpg) + +![](images/81bec38b403276535731de8367b72df2984076e93ef6dc7df22485a77eb011a7.jpg) + +
ModelKendall's τ (↑)Spearman's ρ (↑)Edit dist. (↓)
Chance0.00000.00006.5822
Repr. Ant. [54]0.33830.41325.4596
MemDPC [16]0.34920.42065.3398
TAP [21]0.33440.41075.4178
MMCC (ours)0.36320.44205.3343
MMCC (vision only)0.35300.43285.3370
+ +segments. We treat each segment as a node by computing its average visual representation, as before. We then use these representations to find $P(u \to v)$ scores between labeled segments and solve an optimal path. We run this experiment both in vision only (by passing projected visual representations directly into $g$ in Eq. 12) as well as with ground truth vision-text pairings, and show results in Table 3. We show example predicted orderings in Figure 6. Again, we can replace $g_{\mathrm{fwd}}$ with the future prediction model in other methods and run the same algorithm. Our model outperforms previous work on all evaluation metrics. + +Discovering the arrow of time: To further examine whether our model has learned to discover meaningful transitions between states, we explore the arrow of time classification task, introduced in [38, 40, 59]. In [59], a network is + +Table 3. Unshuffling image collections: As defined in Eq. 12, $\log P(u\to v)$ gives a log-likelihood score of $v$ being the future state of $u$ . These scores induce a graph which is optimally traversed using a TSP solver. Each model above defines a different $P$ and is applied to shuffled videos from the Recipes test set. Our model outperforms previous state of the art on all metrics. + +
Sampling strategyAvg
RandCos simTAPRAModel
FeaturesRandom50.450.751.351.451.251.0
ImageNet51.552.150.850.953.451.7
Cross-modal52.653.350.950.655.852.6
Repr. Ant. [53]50.751.451.251.251.751.2
TAP [21]50.851.451.451.351.851.3
MMCC (ours)52.353.450.550.769.255.2
Average51.452.051.051.055.552.2
Chance50.050.050.050.050.050.0
From scratch51.152.151.851.462.553.8
+ +Table 4. Learning the arrow of time: We train a linear layer on frozen features as well as a full model from scratch (last row) to detect which of two input frames comes first. This task is near-impossible when sampling random frames. Using our temporal model to sample frames leads to a significant improvement in performance, indicating that our model can identify salient transitions in video. Our visual embedding also outperforms other models, highlighting the importance of temporally-attuned representations. + +trained on short videos (on the order of seconds) to predict whether input is being played forward or backward. + +We consider the more challenging task of predicting the temporal relationship between two far-apart input frames - which one comes first? For frames which depict unrelated moments, this task is perhaps near-impossible, even for humans. But if frames show semantically related states, the direction of likely transition provides a useful signal for solving the arrow-of-time task. + +We train linear classifiers on top of frozen features as well as a full network from scratch to solve the arrow of time task on randomly shuffled pairs of frames. We sample pairs of frames using our learned predictive model by selecting the highest-probability futures of start frames selected with the concreteness prior (Eq. 7). We demonstrate in Table 4 that the temporal ordering of frames mined by our model is much more classifiable than that of frames sampled using predictive models in previous work. Further, our learned features are much more able to classify a given pair of frames, since they must capture temporal information in training. This confirms that a strong understanding of dynamics that emerges from the cycle consistency task. + +# 5. Conclusion + +We introduce a self-supervised method to learn temporal dynamics by cycling through narrated video. Despite the simplicity of our architecture, our model is able to discover long-term state transitions in vision and language. We show that this model can be applied without further training to challenging downstream tasks such as anticipating far-away action and ordering collections of image data. + +# References + +[1] Jean-Baptiste Alayrac, Piotr Bojanowski, Nishant Agrawal, Josef Sivic, Ivan Laptev, and Simon Lacoste-Julien. Unsupervised learning from narrated instruction videos. In CVPR, 2016. 2 +[2] Lisa Anne Hendricks, Oliver Wang, Eli Shechtman, Josef Sivic, Trevor Darrell, and Bryan Russell. Localizing moments in video with natural language. In ICCV, 2017. 2 +[3] Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv:1710.11252, 2017. 2 +[4] Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-GAN: Unsupervised video retargeting. In ECCV, 2018. 2 +[5] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling egocentric vision: The EPIC-Kitchens dataset. In ECCV, 2018. 2, 5, 7 +[6] Virginia R de Sa. Learning classification with unlabeled data. In NeurIPS, 1994. 2 +[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. 5 +[8] Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. arXiv:1802.07687, 2018. 2 +[9] Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet, and Andrew Zisserman. Temporal cycle-consistency learning. In CVPR, 2019. 3 +[10] Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. arXiv:1710.05268, 2017. 1 +[11] Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. arXiv:1605.07157, 2016. 2 +[12] Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In ICRA, 2017. 1 +[13] Antonino Furnari and Giovanni Maria Farinella. What would you expect? anticipating egocentric actions with rolling-unrolling lstms and modality attention. In CVPR, 2019. 2 +[14] Jingjing Gong, Xinchi Chen, Xipeng Qiu, and Xuanjing Huang. End-to-end neural sentence ordering using pointer network. arXiv:1611.04953, 2016. 7 +[15] Tengda Han, Weidi Xie, and Andrew Zisserman. Video representation learning by dense predictive coding. In ICCV Workshops, 2019. 1, 2 +[16] Tengda Han, Weidi Xie, and Andrew Zisserman. Memory-augmented dense predictive coding for video representation learning. arXiv:2008.01065, 2020. 1, 2, 5, 7, 8 +[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 3, 5 +[18] Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In NeurIPS, 2018. 2 + +[19] De-An Huang and Kris M Kitani. Action-reaction: Forecasting the dynamics of human interaction. In ECCV, 2014. 2 +[20] Allan Jabri, Andrew Owens, and Alexei A Efros. Space-time correspondence as a contrastive random walk. In NeurIPS, 2020. 3 +[21] Dinesh Jayaraman, Frederik Ebert, Alexei A Efros, and Sergey Levine. Time-agnostic prediction: Predicting predictable video frames. In ICLR, 2019. 2, 5, 7, 8 +[22] Dinesh Jayaraman and Kristen Grauman. Learning image representations tied to ego-motion. In ICCV, 2015. 1 +[23] Gunhee Kim, Leonid Sigal, and Eric P Xing. Joint summarization of large-scale collections of web images and videos for storyline reconstruction. In CVPR, 2014. 7 +[24] Kris M Kitani, Brian D Ziebart, James Andrew Bagnell, and Martial Hebert. Activity forecasting. In ECCV, 2012. 2 +[25] Hilde Kuehne, Ali Arslan, and Thomas Serre. The language of actions: Recovering the syntax and semantics of goal-directed human activities. In CVPR, 2014. 5, 7 +[26] Nilesh Kulkarni, Abhinav Gupta, and Shubham Tulsiani. Canonical surface mapping via geometric cycle consistency. In ICCV, 2019. 3 +[27] Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A conditional flow-based model for stochastic video generation. arXiv:1903.01434, 2019. 2 +[28] Tian Lan, Tsung-Chuan Chen, and Silvio Savarese. A hierarchical representation for future action prediction. In ECCV, 2014. 2 +[29] Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv:1804.01523, 2018. 1, 2 +[30] Haejun Lee, Drew A Hudson, Kangwook Lee, and Christopher D Manning. SLM: Learning a discourse language representation with sentence unshuffling. arXiv:2010.16249, 2020.7 +[31] Lajanugen Logeswaran, Honglak Lee, and Dragomir Radev. Sentence ordering and coherence modeling using recurrent neural networks. arXiv:1611.02654, 2016. 7 +[32] William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. arXiv:1605.08104, 2016. 2 +[33] Jonathan Malmaud, Jonathan Huang, Vivek Rathod, Nick Johnston, Andrew Rabinovich, and Kevin Murphy. What's cookin'? interpreting cooking videos using text, speech and vision. arXiv:1503.01558, 2015. 2 +[34] Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv:1511.05440, 2015. 1 +[35] Antoine Miech, Jean-Baptiste Alayrac, Lucas Smaira, Ivan Laptev, Josef Sivic, and Andrew Zisserman. End-to-end learning of visual representations from uncurated instructional videos. In CVPR, 2020. 2, 3, 4, 5, 6, 7 +[36] Antoine Miech, Ivan Laptev, Josef Sivic, Heng Wang, Lorenzo Torresani, and Du Tran. Leveraging the present to anticipate the future in videos. In CVPR Workshops, 2019. 2 + +[37] Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. Howto100m: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV, 2019. 2, 5 +[38] Ishan Misra, C Lawrence Zitnick, and Martial Hebert. Shuffle and learn: unsupervised learning using temporal order verification. In ECCV, 2016. 8 +[39] Nemanja Petrovic, Aleksandar Ivanovic, and Nebojsa Jojic. Recursive estimation of generative models of video. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06), volume 1, pages 79-86. IEEE, 2006. 1 +[40] Lyndsey C Pickup, Zheng Pan, Donglai Wei, YiChang Shih, Changshui Zhang, Andrew Zisserman, Bernhard Scholkopf, and William T Freeman. Seeing the arrow of time. In CVPR, 2014. 8 +[41] Silvia L Pintea, Jan C van Gemert, and Arnold WM Smeulders. Déja vu. In ECCV, 2014. 2 +[42] MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv:1412.6604, 2014. 2 +[43] Anna Rohrbach, Marcus Rohrbach, Niket Tandon, and Bernt Schiele. A dataset for movie description. In CVPR, 2015. 2 +[44] Anna Rohrbach, Atousa Torabi, Marcus Rohrbach, Niket Tandon, Chris Pal, Hugo Larochelle, Aaron Courville, and Bernt Schiele. Movie description. *IJCV*, 2017. 2 +[45] Mohammad Sadegh Aliakbarian, Fatemeh Sadat Saleh, Mathieu Salzmann, Basura Fernando, Lars Petersson, and Lars Andersson. Encouraging LSTMs to anticipate actions very early. In ICCV, 2017. 2 +[46] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015. 2 +[47] Chen Sun, Fabien Baradel, Kevin Murphy, and Cordelia Schmid. Learning video representations using contrastive bidirectional transformer. arXiv:1906.05743, 2019. 1, 2 +[48] Chen Sun, Per Karlsson, Jiajun Wu, Joshua B Tenenbaum, and Kevin Murphy. Stochastic prediction of multi-agent interactions from partial observations. arXiv:1902.09641, 2019. 2 +[49] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. Videobert: A joint model for video and language representation learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7464-7473, 2019. 2 +[50] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 3 +[51] Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv:1706.08033, 2017. 2 +[52] Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. arXiv:1704.05831, 2017. 2 + +[53] Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Anticipating visual representations from unlabeled video. In CVPR, 2016. 1, 2, 5, 7, 8 +[54] Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In NeurIPS, 2016. 1, 2, 8 +[55] Carl Vondrick and Antonio Torralba. Generating the future with adversarial transformers. In CVPR, 2017. 2 +[56] Jacob Walker, Abhinav Gupta, and Martial Hebert. Patch to the future: Unsupervised visual prediction. In CVPR, 2014. 2 +[57] Jacob Walker, Abhinav Gupta, and Martial Hebert. Dense optical flow prediction from a static image. In ICCV, 2015. 2 +[58] Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycle-consistency of time. In CVPR, 2019. 3 +[59] Donglai Wei, Joseph J Lim, Andrew Zisserman, and William T Freeman. Learning and using the arrow of time. In CVPR, 2018. 8 +[60] Yu Wu, Linchao Zhu, Xiaohan Wang, Yi Yang, and Fei Wu. Learning to anticipate egocentric actions by imagination. IEEE Transactions on Image Processing, 30:1143-1152, 2020. 2 +[61] Jun Xu, Tao Mei, Ting Yao, and Yong Rui. MSR-VTT: A large video description dataset for bridging video and language. In CVPR, 2016. 2 +[62] Tianfan Xue, Jiajun Wu, Katherine Bouman, and Bill Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In NeurIPS, 2016. 2 +[63] Shouu-I Yu, Lu Jiang, and Alexander Hauptmann. Instructional videos for unsupervised harvesting and learning of action examples. In ACM MM, 2014. 2 +[64] Jenny Yuen and Antonio Torralba. A data-driven approach for event prediction. In ECCV, 2010. 2 +[65] Luowei Zhou, Chenliang Xu, and Jason J Corso. Towards automatic learning of procedures from web instructional videos. In AAAI, 2018. 2 +[66] Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A. Efros. Learning dense correspondence via 3D-guided cycle consistency. In CVPR, 2016. 2 +[67] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 2 +[68] Dimitri Zhukov, Jean-Baptiste Alayrac, Ramadan Gokberk Cinbis, David Fouhey, Ivan Laptev, and Josef Sivic. Cross-task weakly supervised learning from instructional videos. In CVPR, 2019. 5, 7 \ No newline at end of file diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/images.zip b/learningtemporaldynamicsfromcyclesinnarratedvideo/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6737d555b243a66995689dfc4ff5c48d89053613 --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dc96938586dba65306d615519e39b682ebc33925d07169af8eae5305a6c1613 +size 507864 diff --git a/learningtemporaldynamicsfromcyclesinnarratedvideo/layout.json b/learningtemporaldynamicsfromcyclesinnarratedvideo/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eaeb27804b8401907e18d0079e09d5397ecd9b04 --- /dev/null +++ b/learningtemporaldynamicsfromcyclesinnarratedvideo/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb0a6004e61347994f2b4b59b89a001b9a2f085846dfaad61420b83d1dae6fe5 +size 534573 diff --git a/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_content_list.json b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..441ca40f6635776fe453c4aa276bfbc4b8e391e7 --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87f81bad5f588dc3c150c1c75698ac33114be63632b3bed9684fb4499892b25e +size 83052 diff --git a/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_model.json b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0f6df07af49fb2e9dac2a02665cec1ac11b2cb2d --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3e334ff8f73c9578865d1e767cf4ae8a5a51c387aa2c0976a321e2ceae157f0 +size 101220 diff --git a/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_origin.pdf b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7e08d3fdab7583a6052034f1db20dc66d8e84c81 --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/a26f5d23-9be8-453f-8be3-596eeb4302a6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfd156e2d01967675683175306f6770078bad0535b837f494397f98674500674 +size 2537223 diff --git a/learningtoadversariallyblurvisualobjecttracking/full.md b/learningtoadversariallyblurvisualobjecttracking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..90380005f0f7a3e60efd4260902a2eeaa4f2b8a2 --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/full.md @@ -0,0 +1,311 @@ +# Learning to Adversarily Blur Visual Object Tracking + +Qing Guo $^{1,5*}$ , Ziyi Cheng $^{2*}$ , Felix Juefei-Xu $^{3}$ , Lei Ma $^{4\dagger}$ , Xiaofei Xie $^{5\dagger}$ , Yang Liu $^{5,6}$ , Jianjun Zhao $^{2}$ + +1 College of Intelligence and Computing, Tianjin University, China, + +$^{2}$ Kyushu University, Japan, $^{3}$ Alibaba Group, USA, $^{4}$ University of Alberta, Canada, +$^{5}$ Nanyang Technological University, Singapore, $^{6}$ Zhejiang Sci-Tech University, China + +# Abstract + +Motion blur caused by the moving of the object or camera during the exposure can be a key challenge for visual object tracking, affecting tracking accuracy significantly. In this work, we explore the robustness of visual object trackers against motion blur from a new angle, i.e., adversarial blur attack (ABA). Our main objective is to online transfer input frames to their natural motion-blurred counterparts while misleading the state-of-the-art trackers during the tracking process. To this end, we first design the motion blur synthesizing method for visual tracking based on the generation principle of motion blur, considering the motion information and the light accumulation process. With this synthetic method, we propose optimization-based ABA (OP-ABA) by iteratively optimizing an adversarial objective function against the tracking w.r.t. the motion and light accumulation parameters. The OP-ABA is able to produce natural adversarial examples but the iteration can cause heavy time cost, making it unsuitable for attacking real-time trackers. To alleviate this issue, we further propose one-step ABA (OS-ABA) where we design and train a joint adversarial motion and accumulation predictive network (JAMANet) with the guidance of OP-ABA, which is able to efficiently estimate the adversarial motion and accumulation parameters in a one-step way. The experiments on four popular datasets (e.g., OTB100, VOT2018, UAV123, and LaSOT) demonstrate that our methods are able to cause significant accuracy drops on four state-of-the-art trackers with high transferability. Please find the source code at https://github.com/tsingqguo/ABA + +# 1. Introduction + +Visual object tracking (VOT) has played an integral part in multifarious computer vision applications nowadays rang- + +![](images/56141d34d7fecefb5d5ff0999e2626674f8e6c1bfd5b7f138487c5c1a1e630cd.jpg) +Figure 1: An example of our adversarial blur attack against a deployed tracker, e.g., SiamRPN++ [30]. Two adjacent frames are fed to our attack and it generates an adversially blurred frame that misleads the tracker to output an inaccurate response map. + +ing from augmented reality [1, 46] to video surveillance [47], from human-computer interaction [36, 32] to traffic control [49], etc. Since the infusion of deep learning, VOT has become more powerful in terms of both algorithmic performance and efficiency [20], leading to the more pervasive deployment of VOT-enabled on-device applications. However, the VOT can still exhibit robustness brittleness when faced with less ideal video feed. Among many known degrading factors such as illumination variations, noise variations, etc., motion blur is perhaps one of the most important adverse factors for visual object tracking, which is caused by the moving of the object or camera during the exposure, and can severely jeopardize tracking accuracy [18]. Most of the existing benchmarks [28, 50, 35] only indicate whether a video or a frame contains motion blur or not and this piece of information is still insufficient to analyze the influence from motion blur by means of controlling all the variables, e.g., eliminating other possible interference from other degradation modes, which may lead to incomplete conclusions regarding the effects of motion blur in these benchmarks. + +Moreover, the currently limited datasets, albeit being large-scale, cannot well cover the diversity of motion blur in the real world because motion blur is caused by camera and object moving in the scene which is both dynamic and unknown. Existing motion blur generation methods cannot + +thoroughly reveal the malicious or unintentional threat to visual object tracking, i.e., they can only produce natural motion blur which falls short of exposing the adversarial brittleness of the visual object tracker. As a result, it is necessary to explore a novel motion blur synthetic method for analyzing the robustness of the visual object trackers, which should not only generate natural motion-blurred frames but also embed maliciously adversarial or unintentional threats. + +In this work, we investigate the robustness of visual trackers against motion blur from a new angle, that is, adversarial blur attack (ABA). Our main objective is to online transfer input frames to their natural motion-blurred counterparts while misleading the state-of-the-art trackers during the tracking process. We show an intuitive example in Fig. 1. To this end, we first design the motion blur synthesizing method for visual tracking based on the generation principle of motion blur, considering the motion information and the light accumulation process. With this synthetic method, we further propose optimization-based ABA (OP-ABA) by iteratively optimizing an adversarial objective function against the tracking w.r.t. the motion and light accumulation parameters. + +The OP-ABA is able to produce natural adversarial examples but the iteration can lead to a heavy time-consuming process that is not suitable for attacking the real-time tracker. To alleviate this issue, we further propose one-step ABA (OS-ABA) where we design and train a joint adversarial motion and accumulation predictive network (JAMANet) with the guidance of OP-ABA, which is able to efficiently estimate the adversarial motion and accumulation parameters in a one-step way. The experiments on four popular datasets (e.g., OTB100, VOT2018, UAV123, and LaSOT) demonstrate that our methods are able to cause significant accuracy drops on four state-of-the-art trackers while keeping the high transferability. To the best of our knowledge, this is the very first attempt to study the adversarial robustness of VOT and the findings will facilitate future-generation visual object trackers to perform more robustly in the wild. + +# 2. Related Work + +Visual object tracking (VOT). VOT is an important task in computer vision. Recently, a great number of trackers, which extract features with convolutional neural networks (CNNs), are proposed and achieve amazing performance. + +Among these works, Siamese network-based methods [2, 14, 31, 19, 55, 45, 54, 44] offline train Siamese networks and conduct online matching between search regions and the object template, which are significantly fast with high tracking performance. In particular, SiamRPN [31, 30] embed the regional proposal network [40] in the naive Siamese tracker [2], allowing high-efficient estimation of the object's aspect ratio variation and achieving state-of-the-art tracking accuracy. After that, some works use historical frames to online update tracking models. For example, DiMP [3] collects + +past frames' features and online predict convolution kernels that can estimate object's position. Furthermore, PrDiMP [9] improves the loss function with KL divergence and information entropy from the perspective of probability distribution. KYS [4] considers the correlation between previous frames and the current frame. These trackers run beyond real time and get top accuracy on several benchmarks. Although great progress has been achieved, there are few works studying their robustness to motion blur. In this work, we identify a new way to achieve this goal by actively synthesizing adversarially motion blur to fool the state-of-the-art trackers. + +Motion blur synthesis. In VOT task, motion blur is a very common scene due to the high-speed movement of the target. It is usually used to evaluate the quality of the trackers [50, 13, 18]. In recent years, motion blur synthesis has been extensively studied in the rendering community [38, 18]. However, these methods usually require a complete understanding of the speed and depth of the scene as input. In order to get more realistic and high-quality images with motion blur, Brooks et al. [5] identify a simple solution that warps two instant images by optical flow [42, 26] and fuses these intermediate frames with specific weights, to synthesize a blur picture. This method is to synthesize realistic motion blur for the deblurring task while our work is used for adversarily blurring the frames for tracking. Another related work, i.e., ABBA [21], takes a single image as its input and generates visually natural motion-blurred adversarial example to fool the deep neural network-based classification. Specifically, ABBA simulates the motion by adversarily shifting the object and background, respectively, neglecting the real motion in the scene. Different from ABBA, our approach focuses on visual object tracking with real object movement indicated by two adjacent frames. Recently, some techniques [4, 9, 44] have been proposed to counter the interference of the environment. To this end, our method is proposed to better evaluate the robustness of these VOTs. + +Adversarial attack. Extensive works have proved that state-of-the-art deep neural networks are still vulnerable to adversarial attacks by adding visually imperceptible noises or natural degradation to original images [16, 43, 8, 15, 21]. FGSM [16] perturbs normal examples along the gradient direction via the fast gradient sign method. MI-FGSM [11] integrates momentum term into the iterative process that can help stabilize the update directions. C&W [6] introduces three new attacks for different norms $(L_0, L_2, L_\infty)$ through iterative optimization. However, the above methods are unable to meet the real-time requirements due to the limited speed [22]. To realize the efficient attacking, [52, 51] propose one-step attacks by offline training on the targeted model. However, these methods are designed for the classification task and could not attack trackers directly. + +More recently, some works have been proposed to attack visual object tracking. PAT [48] generates physical adversaries + +![](images/d5b65d332dde4a0f569f0ecc35272e45eb757f83df3aa8419178764b39f14d56.jpg) +Figure 2: (a) shows the motion blur synthesizing process with two frames, i.e., $\mathbf{I}_t$ and $\mathbf{I}_{t - 1}$ , and two sets of variables, i.e., $\{\mathcal{A}_t^i\}$ and $\{\mathcal{W}_t^i\}$ , should be determined for attacking. (b) shows three cases of the normal blur under uniform motion, the OP-ABA blurring results, and OS-ABA blurring results. + +![](images/a07584ef40f7578a45d9777aecc01ce9308ee1cc311dfd9ea8d93ee7c3833354.jpg) + +ial textures via a white-box attack. SPARK [22] studies how to adapt existing adversarial attacks on tracking. Chen et al. [7] propose to add adversarial perturbations on the template at the initial frame. CSA [52] raises a one-step method and makes objects invisible to trackers by forcing the predicted bounding box to shrink. Different from above works, we employ motion blur to perform adversarial attack. Our work is designed to address three challenges: how to synthesize natural motion blur that meets the motion of object and background in the video; how to make the blurred frame fool state-of-the-art trackers easily; how to perform the adversarial blur attack efficiently. To best of our knowledge, this is the very first attempt in the community of adversarial attack. + +# 3. Adversarial Blur Attack against Tracking + +In this section, we first study how to synthesize natural motion blur under the visual tracking task in Sec. 3.1 and summarize the variables that should be solved to perform attacks. Then, we propose the optimization-based ABA (OP-ABA) in Sec. 3.2 with a novel objective function to guide the motion blur generation via the iterative optimization process. To allow high-efficient attack for real-time trackers, we further propose one-step ABA (OS-ABA) in Sec. 3.3 by training a new designed joint motion and kernel predictive network under the supervision of the objective function of OP-ABA. Finally, we summarize the attacking details with OP-ABA and OS-ABA in Sec. 3.4. + +# 3.1. Motion Blur Synthesizing for Visual Tracking + +In a typical tracking process, given the $t$ -th frame $\mathbf{I}_t$ of a live video and an object template specified at the first frame, a tracker uses a pre-trained deep model $\phi_{\theta_t}(\mathbf{I}_t)$ to predict the location and size of the object (i.e., the bounding box tightly warping the object) in this frame where $\theta_t$ denotes the template-related parameter and can be updated during the tracking process. For the adversarial blur attack, we aim + +to generate a motion-blurred counterpart of $\mathbf{I}_t$ , which is able to fool the tracker to estimate the incorrect bounding box of the object while having the natural motion-blur pattern. + +To this end, we review the generation principle of realistic motion blur [37, 39, 5, 21, 18]: the camera sensor captures an image by receiving and accumulating light during the shutter procedure. The light at each time can be represented as an instant image, and there are a series of instant images for the shutter process. When the objects or background move, the light accumulation will cause blurry effects, which can be approximated by averaging the instant images. + +Under the above principle, when we want to adversarially blur $\mathbf{I}_t$ , we need to do two things: First, synthesizing the instant images during the shutter process and letting them follow the motion of object and background in the video; Second, accumulating all instant images to get the motion-blurred $\mathbf{I}_t$ . The main challenge is how to make the two steps adversarially tunable to fool the tracker easily while preserving the natural motion blur pattern. + +For the first step, we propose to generate the instant images under the guidance of the optical flow $\mathbf{U}_t$ that describes the pixel-wise moving distance and direction between $\mathbf{I}_t$ and its neighbor $\mathbf{I}_{t - 1}$ . Specifically, given two neighboring frames in a video, e.g., $\mathbf{I}_{t - 1}$ and $\mathbf{I}_t$ , we regard them as the start and end time stamps for camera shutter process, respectively. Assuming there are $N$ instant images, we denote them as $\{\mathbf{I}_t^i\}_{i = 1}^N$ where $\mathbf{I}_t^1 = \mathbf{I}_{t - 1}$ and $\mathbf{I}_t^N = \mathbf{I}_t$ . Then, we calculate the optical flow $\mathbf{U}_t$ between $\mathbf{I}_{t - 1}$ and $\mathbf{I}_t$ and split it into $N - 1$ sub-motions, i.e., $\{\mathbf{U}_t^i\}_{i = 1}^{N - 1}$ where $\mathbf{U}_t^i$ represents the optical flow between $\mathbf{I}_t^i$ and $\mathbf{I}_t^{i + 1}$ . We define $\mathbf{U}_t^i$ as a scaled $\mathbf{U}_t$ with pixel-wise ratios (i.e., $\mathbf{W}_t^i$ ) + +$$ +\mathbf {U} _ {t} ^ {i} = \mathbf {W} _ {t} ^ {i} \odot \mathbf {U} _ {t}, \tag {1} +$$ + +where $\mathbf{W}_t^i$ has the same size with $\mathbf{U}_t$ and $\odot$ denotes the pixel-wise multiplication. All elements in $\mathbf{W}_t^i$ range from zero to one and we constraint the summation of $\{\mathbf{W}_t^i\}_{i=1}^N$ at the same position to be one, i.e., $\forall \mathbf{p}, \sum_{i}^{N-1} \mathbf{W}_t^i[\mathbf{p}] = 1$ + +where $\mathbf{W}_t^i[\mathbf{p}]$ denotes the $\mathbf{p}$ -th element in $\mathbf{W}_t^i$ . Note that, the ratio matrices, i.e., $\{\mathbf{W}_t^i\}_{i=1}^N$ , determine the motion pattern. For example, if we have $\forall \mathbf{p}$ , $\{\mathbf{W}_t^i[\mathbf{p}] = \frac{1}{N-1}\}_{i=1}^{N-1}$ and can calculate the sub-motions by $\{\mathbf{U}_t^i = \frac{1}{N-1}\mathbf{U}_t\}_{i=1}^{N-1}$ , all pixels follow the uniform motion. + +With Eq. (1), we get all sub-motions (i.e., $\{\mathbf{U}_t^i\}_{i=1}^{N-1}$ ) and produce the instant images by warping $\mathbf{I}_t$ w.r.t. different optical flows. For example, we synthesize $\mathbf{I}_t^i$ by + +$$ +\mathbf {I} _ {t} ^ {i} = \frac {1}{2} \operatorname {w a r p} \left(\mathbf {I} _ {t - 1}, \sum_ {j = 1} ^ {i - 1} \mathbf {W} _ {t} ^ {j} \odot \mathbf {U} _ {t} ^ {j}\right) + \frac {1}{2} \operatorname {w a r p} \left(\mathbf {I} _ {t}, \sum_ {j = i} ^ {N - 1} \mathbf {W} _ {t} ^ {j} \odot \mathbf {U} _ {t} ^ {j}\right), \tag {2} +$$ + +where $\sum_{j=1}^{i-1} \mathbf{W}_t^j \odot \mathbf{U}_t^j$ represents the optical flow between $\mathbf{I}_{t-1}$ and $\mathbf{I}_t^i$ while $\sum_{j=i}^{N-1} \mathbf{W}_t^j \odot \mathbf{U}_t^j$ denotes the optical flow between $\mathbf{I}_t^i$ and $\mathbf{I}_t$ The function $\operatorname{warp}(\cdot)$ is to wrap the $\mathbf{I}_{t-1}$ or $\mathbf{I}_t$ according to the corresponding optical flow, and uses the implementation in [21] for spatial transformer network. + +For the second step, after getting $\{\mathbf{I}_t^i\}_{i = 1}^N$ , we can synthesize the motion-blurred $\mathbf{I}_t$ by summing up the $N$ instant images with pixel-wise accumulation weights $\{\mathbf{A}_i\}_{i = 1}^N$ + +$$ +\hat {\mathbf {I}} _ {t} = \sum_ {i = 1} ^ {N} \mathbf {A} _ {t} ^ {i} \odot \mathbf {I} _ {t} ^ {i}. \tag {3} +$$ + +where $\mathbf{A}_t^i$ has the same size with $\mathbf{I}_t^i$ and all elements range from zero to one. For simulating realistic motion blur, all elements of $\mathbf{A}_t^i$ are usually fixed as $\frac{1}{N}$ , which denotes the accumulation of all instant images. + +Overall, we represent the whole blurring process via Eqs. (3) and (2) as $\hat{\mathbf{I}}_t = \mathrm{Blur}(\mathbf{I}_t,\mathbf{I}_{t - 1},\mathcal{W}_t,\mathcal{A}_t)$ . To perform adversarial blur attack for the frame $\mathbf{I}_t$ , we need to solve two sets of variables, i.e., $\mathcal{W}_t = \{\mathbf{W}_t^i\}_{i = 1}^{N - 1}$ determining the motion pattern and $\mathcal{A}_t = \{\mathbf{A}_t^i\}_{i = 1}^N$ deciding the accumulation strategy. In Sec. 3.2, we follow the existing adversarial attack pipeline and propose the optimization-based ABA by defining and optimizing a tracking-related objective function to get $\mathcal{W}_t$ and $\mathcal{A}_t$ . In Sec. 3.3, we design a network to predict $\mathcal{W}_t$ and $\mathcal{A}_t$ in a one-step way. + +# 3.2. Optimization-based Adversarial Blur Attack + +In this section, we propose to solve $\mathcal{W}_t$ and $\mathcal{A}_t$ by optimizing the tracking-related objective function. Specifically, given the original frame $\mathbf{I}_t$ , a tracker can estimate a response or classification map by $\mathbf{Y}_t = \phi_{\theta_t}(\mathbf{I}_t)$ whose maximum indicating the object's position in the $\mathbf{I}_t$ . Our attack aims to generate a blurred $\mathbf{I}_t$ (i.e., $\hat{\mathbf{I}}_t = \mathrm{Blur}(\mathbf{I}_t,\mathbf{I}_{t - 1},\mathcal{W}_t,\mathcal{A}_t)$ ) to let the predicted object position indicated by $\hat{\mathbf{Y}}_t = \phi_{\theta_t}(\hat{\mathbf{I}}_t)$ be far away from the original one indicated by $\mathbf{Y}_t$ . + +To this end, we optimize $\mathcal{W}_t$ and $\mathcal{A}_t$ by minimizing + +$$ +\operatorname * {a r g m i n} _ {\mathcal {W} _ {t}, \mathcal {A} _ {t}} J (\phi_ {\theta_ {t}} (\operatorname {B l u r} (\mathbf {I} _ {t}, \mathbf {I} _ {t - 1}, \mathcal {W} _ {t}, \mathcal {A} _ {t})), \mathbf {Y} _ {t} ^ {*}) +$$ + +$$ +\text {s u b j e c t} \forall \mathbf {p}, \forall i, \sum_ {i} ^ {N - 1} \mathbf {W} _ {t} ^ {i} [ \mathbf {p} ] = 1, \sum_ {i} ^ {N} \mathbf {A} _ {t} ^ {i} [ \mathbf {p} ] = 1, \tag {4} +$$ + +where the two constraints on $\mathbf{W}_t^i$ and $\mathbf{A}_t^i$ make sure the synthetic motion blur does not have obvious distortions. The function $J(\cdot)$ is a distance function and is set as $L_{2}$ . The regression target $\mathbf{Y}_t^*$ denotes the desired response map and is obtained under the guidance of the original $\mathbf{Y}_t$ . Specifically, with the original response map $\mathbf{Y}_t$ , we know the object's position and split $\mathbf{Y}_t$ into two regions the object region and background region according to the object size. Then, we can find the position (e.g., $\mathbf{q}$ ) having the highest response score at the background region of $\mathbf{Y}_t$ and then we set $\mathbf{Y}^{*}[\mathbf{q}] = 1$ and other elements of $\mathbf{Y}^{*}$ to be zero. Note that, above setup is suitable for regression-based trackers, e.g., DiMP and KYS, and can be further adapted to attack classification-based trackers, e.g., SiamRPN++, by setting $J(\cdot)$ as the cross-entropy loss function and $\mathbf{Y}^{*}[\mathbf{q}] = 1$ with its other elements to be $-1$ . + +Following the common adversarial attacks [17, 12, 22, 21], we can solve Eq. (4) via the signed gradient descent and update the $\mathcal{W}_t$ and $\mathcal{A}_t$ iteratively with specified step size and iterative number. We show the synthesized motion blur of OP-ABA in Fig. 2. Clearly, OP-ABA is able to synthesize natural motion-blurred frames that have a similar appearance to the normal motion blur. + +# 3.3. One-Step Adversarial Blur Attack + +To allow efficient adversarial blur attack, we propose to predict the motion and accumulation weights (i.e., $\mathcal{W}_t$ and $\mathcal{A}_t$ ) with a newly designed network denoted as joint adversarial motion and accumulation predictive network (JAMANet) in a one-step way, which is pre-trained through the objective function Eq. (4) and a naturalness-aware loss function. Specifically, we use JAMANet to process the neighboring frames (i.e., $\mathbf{I}_t$ and $\mathbf{I}_{t - 1}$ ) and predict the $\mathcal{W}_t$ and $\mathcal{A}_t$ , respectively. Meanwhile, we also employ a pre-trained network to estimate the optical flow $\mathbf{U}_t$ between $\mathbf{I}_t$ and $\mathbf{I}_{t - 1}$ . Here, we use the PwCNet [42] since it achieves good results on diverse scenes. Then, with Eq. (2)-(3), we can obtain the motion-blurred frame $\hat{\mathbf{I}}_t$ . After that, we feed $\hat{\mathbf{I}}_t$ into the loss functions and calculate gradients of parameters of JAMANet to perform optimization. We show the framework in Fig. 3. + +Architecture of JAMANet. We first build two parameter sets with constant values, which are denoted as $\mathcal{A}_{\mathrm{norm}} = \{\mathbf{A}_{\mathrm{norm}}^i\}$ and $\mathcal{W}_{\mathrm{norm}} = \{\mathbf{W}_{\mathrm{norm}}^i\}$ . All elements in $\mathcal{A}_{\mathrm{norm}}$ and $\mathcal{W}_{\mathrm{norm}}$ are fixed as $\frac{1}{N}$ and $\frac{1}{N - 1}$ , respectively. We then use $\mathcal{W}_{\mathrm{norm}}$ , $\mathbf{I}_{t - 1}$ , and $\mathbf{I}_t$ to generate $N$ instant images through Eq. (2). JAMANet is built based on the U-Net architecture [41] but contains two decoder branches, which + +![](images/02a62b84d547334d5de5ac5704a1f3a852894e15e4bf28be7d02e3a0e5b065ec.jpg) +Figure 3: Architecture of JAMANet. + +is fed the $N$ instant images $\{\mathbf{I}_t^i\}_{i = 1}^N$ and outputs the offsets w.r.t. $\mathcal{W}_{\mathrm{norm}}$ and $\mathcal{A}_{\mathrm{norm}}$ . We name them as $\mathcal{W}_{\mathrm{off}}$ and $\mathcal{A}_{\mathrm{off}}$ . The input $\{\mathbf{I}_t^i\}_{i = 1}^N$ is size of $(N,3,H,W)$ . We resize it to $(1,3N,H,W)$ and normalize the values to the range of -1 to 1. The architecture is a full convolutional encoder/decoder model with skip connections. In encoder stage, we use six convolutions with the kernel size 4x4 and the LeakyReLU [33] activation function. Unlike the standard U-Net, JAMANet has two decoders. Specifically, one branch is set to estimate the $\mathcal{A}_{\mathrm{off}}$ , containing six transposed convolutions [53] with the latest activation function as Tanh. We can calculate the final $\mathcal{A}_t$ through $\mathcal{A}_t = \mathcal{A}_{\mathrm{norm}} + \mathcal{A}_{\mathrm{off}}$ . Another branch is to predict $\mathcal{W}_{\mathrm{off}}$ and get $\mathcal{W}_t = \mathcal{W}_{\mathrm{norm}} + \mathcal{W}_{\mathrm{off}}$ . This architecture is the same with the previous one but following an Softmax for catering to constraints of Eq. (4)1. + +Loss functions. We train the JAMANet with two loss functions: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {a d v}} + \lambda \mathcal {L} _ {\text {n a t u r a l}}, \tag {5} +$$ + +where the first loss function, i.e., $\mathcal{L}_{\mathrm{adv1}}$ , is set to the objective function in Eq. (4) to make sure the background content instead of the object be highlighted. Note that, this loss function means to enhance the capability of adversarial attack, that is, misleading the raw trackers. It, however, neglects the naturalness of adversarial blur. To this end, we set the loss function $\mathcal{L}_{\mathrm{natural}}$ as + +$$ +\mathcal {L} _ {\text {n a t u r a l}} = \sum_ {i} ^ {N} \| \mathbf {A} _ {t} ^ {i} - \mathbf {A} _ {\text {n o r m}} ^ {i} \| _ {2}. \tag {6} +$$ + +This loss function encourages the estimated accumulation parameters to be similar to normal ones, leading to natural motion blur. + +Training details. We use GOT-10K [25] as our training dataset, which includes $10,000+$ sequences and $500+$ object classes. For each video in GOT-10K [25], we set the first frame as template and take two adjacent frames as an image pair, i.e., $(\mathbf{I}_{t-1}, \mathbf{I}_t)$ . We select eight image pairs from each video. The template and two adjacent frames make up a training sample. Here, we implement the OS-ABA for attacking two trackers, i.e., SiamRPN++ [30] with ResNet50 and MobileNetv2, respectively. In the experiment, we show that OS-ABA has strong transferability against other state-of-the-art trackers. During the training iteration, we first calculate the template's embedding to construct tracking model $\phi_{\theta_t}$ and the original response map $\mathbf{Y}_t$ (i.e., the positive activation map of SiamRPN++) Then, we get $\mathbf{Y}_t^*$ and initialize the blurred frame via Blur( $\mathbf{I}_t$ , $\hat{\mathbf{I}}_{t-1}$ ). We can calculate the loss via Eq. (5) and obtain the gradients of the JAMANet via backpropagation for parameter updating. We train the JAMANet for 10 epochs, requiring a total of about 9 hours on a single Nvidia RTX 2080Ti GPU. We use the Adam [27] with the learning rate of 0.0002 to optimize network parameters, and the loss weight $\lambda$ equals 0.001. + +# 3.4. Attacking Details + +Intuitively, given a targeted track, we can attack it by blurring each frame through OP-ABA and OS-ABA during the online tracking process, as shown in Fig. 1. The attack could be white-box, that is, the tracking model in Eq. (4) is the same as the targeted track, leading to high accuracy drop. It also could be black-box also known as the transferability, that is, the tracking model Eq. (4) is different from the targeted one. Note that, OP-ABA is based on iterative optimization and is time-consuming, thus we conduct OP-ABA every five frames while performing OS-ABA for all frames. In practice, we perform the blurring on the search regions + +Table 1: Attacking results of OP-ABA and OS-ABA against SiamRPN++ with ResNet50 and MobileNetv2 on OTB100 and VOT2018. The best results are highlighted by red color. + +
SiamRPN++AttacksOTB100VOT2018
Org. Prec.Prec. Drop ↑Org. Succ.Succ. Drop ↑Org. EAOEAO Drop ↑
ResNet50OP-ABA87.841.766.531.20.4150.375
OS-ABA87.832.566.528.10.4150.350
MobNetv2OP-ABA86.449.665.837.60.4100.384
OS-ABA86.437.365.830.10.4100.338
+ +Table 2: Attacking results of OP-ABA and OS-ABA against SiamRPN++ with ResNet50 and MobileNetv2 on UAV123 and LaSOT. The best results are highlighted by red color. + +
SiamRPN++AttacksUAV123LaSOT
Org. Prec.Prec. Drop ↑Org. Succ.Succ. Drop ↑Org. Prec.Prec. Drop ↑Org. Succ.Succ. Drop ↑
ResNet50OP-ABA80.430.461.123.149.028.749.725.2
OS-ABA80.429.661.119.949.026.849.726.4
MobNetv2OP-ABA80.234.760.226.944.629.744.728.1
OS-ABA80.231.960.224.044.622.544.718.7
+ +between two frames to accelerate the attacking speed. Specifically, at the frame $t$ , we crop a search region centered at the detected object as the $\mathbf{I}_t$ . At the same time, we crop a region from the previous frame at the same position as the $\mathbf{I}_{t-1}$ . Then, we use the PWCNet [42] to calculate optical flow. We get the original response map with the targeted tracker and $\mathbf{I}_t$ if we employ the OP-ABA as the attack method. After that, we can conduct the OP-ABA or OS-ABA to generate the adversarial blurred frame. In terms of the OP-ABA, we set the iteration number to be 10 and the step sizes for updating $\mathcal{W}_t$ and $\mathcal{A}_t$ are set as 0.002 and 0.0002, respectively. The number of intermediate frames $N$ is fixed as 17 for both OP-ABA and OS-ABA. + +# 4. Experimental Results + +We design experiments to investigate three aspects: First, we validate the effectiveness of our two methods against state-of-the-art trackers on four public tracking benchmarks in Sec. 4.2. Second, we design ablation experiments to validate the influences of $\mathcal{A}_t$ and $\mathcal{W}_t$ in Sec. 4.3. Third, we compare our method with state-of-the-art tracking attacks about their transferability and frame quality in Sec. 4.4. + +# 4.1. Setups + +Datasets. We evaluated adversarial blur attack on four popular datasets, i.e., VOT2018 [28], OTB100 [50], UAV123 [35], and LaSOT [13]. VOT2018 and OTB100 are widely used datasets containing 100 videos and 60 videos, respectively. LaSOT is a recent large-scale tracking benchmark, which contains 280 videos. UAV123 [35] focuses on tracking the object captured by unmanned aerial vehicle's camera, including 123 videos. + +Tracking models. We conduct attack against state-of-the-art trackers including SiamRPN++ [30] with ResNet50 [23] and MobileNetv2 [24], DiMP [3] with ResNet50 and ResNet18, and KYS [4]. Specifically, we validate the white + +box attack with OP-ABA and OS-ABA against SiamRPN++ [30] with ResNet50 [23] and MobileNetv2 in Sec. 4.2 where the motion-blurred frames are guided by the targeted tracker's model itself. We choose SiamRPN++ [30] since it is a classic tracker for Siamese network-based methods [44, 31, 10, 2, 19] which achieves excellent tracking accuracy and real-time tracking speed. We also conduct transferability experiments by using the motion blur crafted from SiamRPN++ with ResNet50 to attack other trackers. + +Metrics. In terms of the OTB100, UAV123 and LaSOT datasets, we follow their common setups and use one pass evaluation (OPE) that contains two metrics success rate and precision. The former one is based on the intersection over union (IoU) between the ground truth bounding box and predicted one for all frames while the latter is based on the center location error (CLE) between the ground truth and prediction. Please refer to [50] for details. To evaluate the capability of attacking, we use the drop of success rate and precision for different attacks, which are denoted as Succ. Drop and Prec. Drop. The higher drops mean more effective attacking. In terms of VOT2018, it restarts trackers when the object is lost. Expected average overlap (EAO) [29] is the main criterion, evaluating both accuracy and robustness. Similar to Succ. Drop, we use the drop of EAO (i.e., EAO Drop) for evaluating attacks. When comparing with other additive noise-based attacks, we use the BRISQUE [34] as the image quality assessment. An attack is desired to produce adversarial examples that are not only natural but also able to fool trackers. BRISQUE is a common metric to evaluate the naturalness of images and a smaller BRISQUE means a more natural image. + +Baselines. There are several tracking attacks including cooling-shrinking attack (CSA) [52], SPARK [22], One-shot-based attack [7], and PAT [48]. Among them, CSA and SPARK have released their code. We select CSA and SPARK as the baselines. + +Table 3: Speed and time cost of three attacks and SiamRPN++ with the ResNet50 and MobileNetv2. + +
SiamRPN++AttackersOrg. FPSAttack time (ms) ↓Attack FPS ↑
ResNet50OP-ABA70.25661.906.79
OS-ABA70.2542.9717.62
MobNetv2OP-ABA107.62508.308.79
OS-ABA107.6240.8819.96
+ +# 4.2. Validation Results + +Attacking results. We attack two SiamRPN++ trackers that uses ResNet50 and MobileNetv2 as the backbone, respectively. The attacks results on the four public datasets are presented in Table 1 and 2, respectively. We observe that: ① Both OP-ABA and OS-ABA reduce the success rate and precision of the two targeted trackers significantly on all benchmarks. Specifically, on the OTB100 dataset, OP-ABA makes the precision and success rate of SiamRPN++ with ResNet50 reduce 41.7 and 31.2, respectively, almost fifty percent of the original scores. These results demonstrate that the proposed attacks are able to fool the state-of-the-art trackers effectively. ② Compared with OS-ABA, OP-ABA achieves higher precision drop since it targeted attack to a certain position during each optimization while OS-ABA generates a general blurred image to make objects invisible for trackers. In general, all the results indicate the effectiveness of OP-ABA and OS-ABA in misleading the tracking models by adversarial blur attack. ③ Comparing the performance drop of SiamRPN++(ResNet50) with SiamRPN++(MobileNetv2), we observe that the former usually has relatively smaller precision or success rate drop under the same attack, hinting that the lighter model is fooled more easily. ④ According to the visualization results shown in Fig. 4, we see that both methods are able to generate visually nature blurred frames that mislead the SiamRPN++. In general, OP-ABA contains some artifacts but is able to mislead the tracker more effectively than OS-ABA. In contrast, OS-ABA always generates more realistic motion blur than OP-ABA in all three cases. + +Speed analysis. We test the time cost of OP-ABA and OS-ABA on the OTB100 and report the FPS of the SiamRPN++ trackers before and after attacking. As presented in Table 3, we observe that OP-ABA would slow down the tracking speed significantly. For example, OP-ABA reduces the speed of SiamRPN++ with ResNet-50 from 63 FPS to 6.79 PFS due to the online optimization. Thanks to the one-step optimization via JAMANet in Sec. 3.3, OS-ABA is almost ten times faster than OP-ABA according to the average attack time per frame. In consequence, OS-ABA achieved near real-time speed, e.g., 17.62 FPS and 20.00 FPS, in attacking SiamRPN++ (ResNet50) and SiamRPN++ (MobileNetv2). In terms of the FPS after attacking, OS-ABA also about 3 times faster than OP-ABA. + +Table 4: Effects of $\mathcal{W}_t$ and $\mathcal{A}_t$ to OP-ABA and OS-ABA by attacking SiamRPN++(ResNet50) on OTB100. The best results are highlighted by red color. + +
AttackersSucc. RateSucc. Drop ↑Prec.Prec. Drop ↑
Original66.50.087.80.0
Norm-Blur65.31.286.21.6
OP-ABA w/o A_t51.515.067.620.2
OP-ABA w/o W_t40.925.653.434.4
OP-ABA35.331.246.141.7
OS-ABA w/o A_t61.05.580.87.0
OS-ABA w/o W_t41.624.958.329.5
OS-ABA38.428.155.332.5
+ +# 4.3. Ablation Study + +In this section, we discuss the influence of $\mathcal{W}_t$ and $\mathcal{A}_t$ to OP-ABA and OS-ABA by constructing two variants of them to attack SiamRPN++ (ResNet50) tracker on OTB100 dataset. Specifically, for both attacks, we only tune $\mathcal{A}_t$ and fix $\mathcal{W}_t$ as $\mathcal{W}_{\mathrm{norm}}$ , thus we get two variants OP-ABA w/o $\mathcal{W}_t$ and OS-ABA w/o $\mathcal{W}_t$ . Similarly, we replace $\mathcal{A}_t$ with $\mathcal{A}_{\mathrm{norm}}$ and adversarially tune $\mathcal{W}_t$ , thus we get OP-ABA w/o $\mathcal{A}_t$ and OS-ABA w/o $\mathcal{A}_t$ , respectively. Moreover, to demonstrate that it is the adversarial blur that reduces the performance, we build the 'Norm-Blur' attack. It synthesizes the motion blur with $\mathcal{A}_{\mathrm{norm}}$ and $\mathcal{W}_{\mathrm{norm}}$ , representing the norm blur that may appear in the real world. + +We summarize the results in Table 4 and Fig. 4 and have the following observes: ① When we fix the $\mathcal{W}_t$ or $\mathcal{A}_t$ for OP-ABA and OS-ABA, the success rate and precision drops decrease significantly, demonstrating that tuning both motion pattern (i.e., $\mathcal{W}_t$ ) and accumulation strategy ( $\mathcal{A}_t$ ) can benefit the adversarial blur attack. ② According to the variance of the performance drop, we see that tuning the accumulation strategy ( $\mathcal{A}_t$ ) contributes more for effective attacks. For example, without tuning $\mathcal{A}_t$ , the success rate drop reduces from 28.1 and 31.2 to 5.5 and 15.0 for OS-ABA and OP-ABA, respectively. ③ SiamRPN++ are robust to the Norm-Blur with slight success rate and precision drops. In contrast, the adversarial blur causes a significant performance drop, demonstrating the adversarial blur does pose threat to visual object tracking. ④ According to the visualization results in Fig. 4, we have similar conclusions with the quantitative results in Table 4: OP-ABA w/o $\mathcal{A}_t$ can generate motion-blurred frames but have little influence on the prediction accuracy. Once we tune $\mathcal{A}_t$ , the tracker can be fooled effectively but some artifacts are also introduced. + +# 4.4. Comparison with Other Attacks + +In this section, we study the transferability of proposed attacks by comparing them with baseline attacks, i.e., CSA [52] and SPARK [22]. Specifically, for all compared attacks, we use SiamRPN++(ResNet50) as the guidance to performance optimization or training. For example, we set $\phi_{\theta_t}$ in the objective function of OP-ABA (i.e., Eq. (4)) as the model + +![](images/366361a5b8b03f78c66e769936ce972d4bb48fce90824461317b615c759e0e88.jpg) + +![](images/4be469dce6e32b6d6e9934c964f834145d79266d0a5be1d5bc9c6554a8447739.jpg) + +![](images/be7f3bb486a8bd85294c22fcc8ce3f13985fe5a8c3bf25944eecae543bada48b.jpg) + +![](images/a1cce077374c110c2e416ded73c0423ec886313400ff5bbd230594bace636f13.jpg) + +![](images/9a7e06221bd517fbc294fa8c71579d12a9448cb90a514f217e54390e90f01734.jpg) + +![](images/a7dec7bc79283629ed714731823ae10e9a29c26f923ceeadef8ae517bc70eb60.jpg) + +![](images/f48bd41489d1672aeb3692071fc0604c3448941034199f05c7fd5a0ff394234e.jpg) + +![](images/41ae53954db92966efa5caab9f2abfa108e255a7089a541933f0e6aa6e505206.jpg) + +![](images/abdeccebc04b517b99ae8dcdd71807e1c99f4e396351afa6f63c5079badb5ebb.jpg) + +![](images/07933799d522188704d12451f6a1c43840aee6e26c117bf63245eac69aad27f4.jpg) + +![](images/308f2af2f14896da85eabcd2e7f612ef2b83f1736c3ee8b5e9ccb0ad09c477ed.jpg) + +![](images/e4d60f8f8d054e8607942e5aca548bad3b7f628d14150fb11fa640dee534d2c0.jpg) + +![](images/45de907fd74200753fb17235f2b8eaa2656a717d6de690fbcac29652bbdaa211.jpg) +Frame t-1 + +![](images/5a770b8add91ec5c43bc6730c922917812cca638a37bcf4a01c5625f4b65bc3c.jpg) +Frame t + +![](images/c52fed240d8c879d4783ae75a91f5001670860e9d72025160e0a843e15de713c.jpg) +OP-ABA w/o $\mathcal{A}_t$ + +![](images/2f6b4c826a53545f1f43408183deb620ad7216d8cc5d861254d442bb59bc2897.jpg) +OP-ABA w/o $\mathcal{W}_t$ +Figure 4: Three visualization results of OP-ABA w/o $\mathcal{A}_t$ , OP-ABA w/o $\mathcal{W}_t$ , OP-ABA, and OS-ABA against SiamRPN++ (ResNet50). The corresponding tracking results are showed with red bounding boxes. + +![](images/a7c7e455f448de6e1a2e8085215e21dcd1ee51cc6bcf87041ca2af284b46b8b9.jpg) +OP-ABA + +![](images/881792f6898b61a18e851f98de88f2c5eee5a77ee0f4caad01298ace0b7cd85b.jpg) +OS-ABA + +Table 5: Comparison results on transferability. Specifically, we use the adversarial examples crafted from SiamRPN++(ResNet50) to attack four state-of-the-art trackers including SiamRPN++(MobileNetv2) [30], DiMP50 [3], DiMP18 [3], and KYS [4] on OTB100. We also calculate the average BRISQUE values of all adversarial examples. + +
TrackersSiamRPN++ (MobNetv2)DiMP50DiMP18KYSBRISQUE ↓
Org. Prec.86.489.287.189.520.15
CSA0.23.42.70.833.63
SPARK0.92.01.00.924.78
OP-ABA2.56.610.37.921.39
OS-ABA0.210.711.212.322.94
+ +of SiamRPN++(ResNet50). We report the precision drop after attacking in Table 5 and the BRISQUE as the image quality assessment for generated adversarial frames. + +As shown in Table 5, we observe: Our methods, i.e., OP-ABA and OS-ABA, achieve the best and second-best transferability (i.e., higher precision drop) against DiMP50, DiMP18 [3], and KYS [4], hinting that our methods are more practical for black-box attacking. According to BRISQUE results, the adversarially blurred frames have smaller values than other adversarial examples, hinting that our methods are able to generate more natural frames since motion blur is a common degradation in the real world. + +# 5. Conclusion + +In this work, we proposed a novel adversarial attack against visual object tracking, i.e., adversarial blur attack (ABA), considering the effects of motion blur instead of the noise against the state-of-the-art trackers. We first identi- + +fied the motion blur synthesizing process during tracking based on which we proposed the optimization-based ABA (OP-ABA). This method fools the trackers by iteratively optimizing a tracking-aware objective but causes heavy time cost. We further proposed the one-step ABA by training a novel designed network to predict blur parameters in a one-step way. The attacking results on four public datasets, the visualization results, and comparison results demonstrated the effectiveness and advantages of our methods. This work not only reveals the potential threat of motion blur against trackers but also could work as a new way to evaluate the motion-blur robustness of trackers in the future. + +Acknowledgments: This work is supported in part by JSPS KAKENHI Grant No.JP20H04168, JP19K24348, JP19H04086, JP21H04877, JST-Mirai Program Grant No.JPMJMI20B8, Japan. Lei Ma is also supported by Canada CIFAR AI Program and Natural Sciences and Engineering Research Council of Canada. The work was also supported by the National Research Foundation, Singapore under its the AI Singapore Programme (AISG2-RP-2020-019), the National Research Foundation, Prime Ministers Office, Singapore under its National Cybersecurity R&D Program (No. NRF2018NCR-NCR005-0001), NRF Investigatorship NRFI06-2020-0001, the National Research Foundation through its National Satellite of Excellence in Trustworthy Software Systems (NSOE-TSS) project under the National Cybersecurity R&D (NCR) Grant (No. NRF2018NCR-NSOE003-0001). We gratefully acknowledge the support of NVIDIA AI Tech Center (NVAITC) to our research. + +# References + +[1] R. Azuma, Y. Baillot, R. Behringer, S. Feiner, S. Julier, and B. MacIntyre. Recent advances in augmented reality. IEEE Computer Graphics and Applications, 21(6):34-47, 2001. 1 +[2] Luca Bertinetto, Jack Valmadre, Joao F Henriques, Andrea Vedaldi, and Philip HS Torr. Fully-convolutional siamese networks for object tracking. In European conference on computer vision, pages 850–865. Springer, 2016. 2, 6 +[3] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning discriminative model prediction for tracking. In ICCV, pages 6181-6190, 2019. 2, 6, 8 +[4] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Know your surroundings: Exploiting scene information for object tracking. In European Conference on Computer Vision, pages 205-221. Springer, 2020. 2, 6, 8 +[5] Tim Brooks and Jonathan T. Barron. Learning to synthesize motion blur. In CVPR, 2019. 2, 3 +[6] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE symposium on security and privacy (sp), pages 39-57. IEEE, 2017. 2 +[7] Xuesong Chen, Xiyu Yan, Feng Zheng, Yong Jiang, Shu-Tao Xia, Yong Zhao, and Rongrong Ji. One-shot adversarial attacks on visual tracking with dual attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10176-10185, 2020. 3, 6 +[8] Yupeng Cheng, Qing Guo, Felix Juefei-Xu, Xiaofei Xie, Shang-Wei Lin, Weisi Lin, Wei Feng, and Yang Liu. Pasadena: Perceptually aware and stealthy adversarial denoise attack. IEEE Transactions on MultiMedia, 2021. 2 +[9] M. Danelljan, L. Van Gool, and R. Timofte. Probabilistic regression for visual tracking. In CVPR, pages 7181-7190, 2020. 2 +[10] Xingping Dong and Jianbing Shen. Triplet loss in siamese network for object tracking. In Proceedings of the European Conference on Computer Vision (ECCV), 2018. 6 +[11] Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9185-9193, 2018. 2 +[12] Y. Dong, F. Liao, T. Pang, H. Su, J. Zhu, X. Hu, and J. Li. Boosting adversarial attacks with momentum. In CVPR, pages 9185–9193, 2018. 4 +[13] H. Fan, L. Lin, F. Yang, P. Chu, G. Deng, S. Yu, H. Bai, Y. Xu, C. Liao, and H. Ling. Lasot: A high-quality benchmark for large-scale single object tracking. In CVPR, pages 5369-5378, 2019. 2, 6 +[14] H. Fan and H. Ling. Siamese cascaded region proposal networks for real-time visual tracking. In CVPR, pages 7944-7953, 2019. 2 +[15] Ruijun Gao, Qing Guo, Felix Juefei-Xu, Hongkai Yu, Xuhong Ren, Wei Feng, and Song Wang. Making images undiscoverable from co-saliency detection. arXiv preprint arXiv:2009.09258, 2020. 2 +[16] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. 2 + +[17] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In arXiv:1412.6572, 2014. 4 +[18] Q. Guo, W. Feng, R. Gao, Y. Liu, and S. Wang. Exploring the effects of blur and deblurring to visual object tracking. IEEE Transactions on Image Processing, 30:1812-1824, 2021. 1, 2, 3 +[19] Q. Guo, W. Feng, C. Zhou, R. Huang, L. Wan, and S. Wang. Learning dynamic Siamese network for visual object tracking. In ICCV, pages 1781-1789, 2017. 2, 6 +[20] Qing Guo, Ruize Han, Wei Feng, Zhihao Chen, and Liang Wan. Selective spatial regularization by reinforcement learned decision making for object tracking. IEEE Transactions on Image Processing, 29:2999-3013, 2020. 1 +[21] Qing Guo, Felix Juefei-Xu, Xiaofei Xie, Lei Ma, Jian Wang, Bing Yu, Wei Feng, and Yang Liu. Watch out! motion is blurring the vision of your deep neural networks. In Advances in Neural Information Processing Systems 34, 2020. 2, 3, 4 +[22] Qing Guo, Xiaofei Xie, Felix Juefei-Xu, Lei Ma, Zhongguo Li, Wanli Xue, Wei Feng, and Yang Liu. Spark: Spatial-aware online incremental attack against visual tracking. In ECCV, 2020. 2, 3, 4, 6, 7 +[23] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 6 +[24] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. 6 +[25] Lianghua Huang, Xin Zhao, and Kaiqi Huang. Got-10k: A large high-diversity benchmark for generic object tracking in the wild. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 5 +[26] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2462-2470, 2017. 2 +[27] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 5 +[28] Matej Kristan, Ales Leonardis, Jiri Matas, Michael Felsberg, Roman Pflugfelder, Luka Cehovin Zajc, Tomas Vojir, Goutam Bhat, Alan Lukezic, Abdelrahman Eldisokey, et al. The sixth visual object tracking vot2018 challenge results. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, pages 0–0, 2018. 1, 6 +[29] Matej Kristan, Jiri Matas, Ales Leonardis, Michael Felsberg, Luka Cehovin, Gustavo Fernandez, Tomas Vojir, Gustav Hager, Georg Nebehay, and Roman Pflugfelder. The visual object tracking vot2015 challenge results. In Proceedings of the IEEE international conference on computer vision workshops, pages 1-23, 2015. 6 +[30] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. Siamrpn++: Evolution of siamese visual tracking with very deep networks. In CVPR, pages 4277-4286, 2019. 1, 2, 5, 6, 8 + +[31] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8971-8980, 2018. 2, 6 +[32] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 909-918, 2020. 1 +[33] Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In Proc. icml, volume 30, page 3. Citeseer, 2013. 5 +[34] A. Mittal, A. K. Moorthy, and A. C. Bovik. No-reference image quality assessment in the spatial domain. IEEE Transactions on Image Processing, 21(12):4695-4708, 2012. 6 +[35] M. Mueller, N. Smith, and B. Ghanem. A benchmark and simulator for uav tracking. ECCV, pages 445-461, 2016. 1, 6 +[36] Jonathan Munro and Dima Damen. Multi-modal domain adaptation for fine-grained action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 122-132, 2020. 1 +[37] S. Nah, T. H. Kim, and K. M. Lee. Deep multi-scale convolutional neural network for dynamic scene deblurring. In CVPR, pages 257-265, 2017. 3 +[38] Fernando Navarro, Francisco J Serón, and Diego Gutierrez. Motion blur rendering: State of the art. In Computer Graphics Forum, volume 30, pages 3-26. Wiley Online Library, 2011. 2 +[39] M. Noroozi, P. Chandramouli, and P. Favaro. Motion deblurring in the wild. In Pattern Recognition, pages 65-77, 2017. 3 +[40] Shaoqing Ren, Kaiming He, Ross B Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015. 2 +[41] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234-241. Springer, 2015. 4 +[42] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8934-8943, 2018. 2, 4, 6 +[43] Binyu Tian, Qing Guo, Felix Juefei-Xu, Wen Le Chan, Yu-peng Cheng, Xiaohong Li, Xiaofei Xie, and Shengchao Qin. Bias field poses a threat to dnn-based x-ray recognition. In 2021 IEEE International Conference on Multimedia and Expo (ICME), 2021. 2 +[44] Paul Voigtaender, Jonathon Luiten, Philip HS Torr, and Bastian Leibe. Siam r-cnn: Visual tracking by re-detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6578-6588, 2020. 2, 6 +[45] Xiao Wang, Chenglong Li, Bin Luo, and Jin Tang. Sint++: robust visual tracking via adversarial positive instance generation. pages 4864-4873, 2018. 2 + +[46] Jianing Wei, Genzhi Ye, Tyler Mullen, Matthias Grundmann, Adel Ahmadyan, and Tingbo Hou. Instant motion tracking and its applications to augmented reality. arXiv preprint arXiv:1907.06796, 2019. 1 +[47] Weiming Hu, Tieniu Tan, Liang Wang, and S. Maybank. A survey on visual surveillance of object motion and behaviors. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 34(3):334-352, 2004. 1 +[48] Rey Reza Wiyatno and Anqi Xu. Physical adversarial textures that fool visual object tracking. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4822-4831, 2019. 2, 6 +[49] Christian Wojek, Stefan Walk, Stefan Roth, Konrad Schindler, and Bernt Schiele. Monocular visual scene understanding: Understanding multi-object traffic scenes. IEEE transactions on pattern analysis and machine intelligence, 35(4):882-897, 2012. 1 +[50] Y. Wu, J. Lim, and M.-H. Yang. Object tracking benchmark. IEEE TPAMI, 37(9):1834-1848, 2015. 1, 2, 6 +[51] Chaowei Xiao, Bo Li, Jun-Yan Zhu, Warren He, Mingyan Liu, and Dawn Song. Generating adversarial examples with adversarial networks. arXiv preprint arXiv:1801.02610, 2018. 2 +[52] Bin Yan, Dong Wang, Hutchuan Lu, and Xiaoyun Yang. Cooling-shrinking attack: Blinding the tracker with imperceptible noises. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 990–999, 2020. 2, 3, 6, 7 +[53] Matthew D Zeiler, Graham W Taylor, and Rob Fergus. Adaptive deconvolutional networks for mid and high level feature learning. In 2011 International Conference on Computer Vision, pages 2018-2025. IEEE, 2011. 5 +[54] Zhipeng Zhang and Houwen Peng. Deeper and wider siamese networks for real-time visual tracking. 2019. 2 +[55] Zheng Zhu, Qiang Wang, Bo Li, Wu Wei, Junjie Yan, and Weiming Hu. Distractor-aware siamese networks for visual object tracking. In ECCV, pages 103-119, 2018. 2 \ No newline at end of file diff --git a/learningtoadversariallyblurvisualobjecttracking/images.zip b/learningtoadversariallyblurvisualobjecttracking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f72d5bc44f6b36d44e1bca0e33ed4376ae54d2b3 --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b85f88dcda3bc75cf2d2b9139f1c3704d77432aa83e95b0a41388453c7a2dc2d +size 526280 diff --git a/learningtoadversariallyblurvisualobjecttracking/layout.json b/learningtoadversariallyblurvisualobjecttracking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..59ebf07c2c6c54bc311b8f135e7660bb572885c6 --- /dev/null +++ b/learningtoadversariallyblurvisualobjecttracking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3935983ccc329b31bddf0cacaab432039e3a94a5b4c208476341b8d3acd75e3 +size 493078 diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_content_list.json b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..382e969e0c531058fe3b65d4c77a73df6115a4fc --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0cc3d8937604b48b8b903aaf37f0a8290670ab13ac9310e03fb7c551ce5bf9b +size 81235 diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_model.json b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f6feace3c9edf1013d284bee8acee86665cb9947 --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeb137d5e0eb62aee4fa8ca8184466b533b75bd2b8a35e12a0ad7c9216a47bfe +size 104693 diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_origin.pdf b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5bb557e6bf938e1d4c9eb0c79164b7767ae7cafe --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/f1e8536a-79a0-4f7d-98d0-fe9629260c5e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdc2e57f0ffdf6f02908c85fdea3de60d88a0b315bbe25de9c0a460a9851e834 +size 7867064 diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/full.md b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b04a278043ad91a611d3266466c631bdc5514923 --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/full.md @@ -0,0 +1,347 @@ +# Learning to Better Segment Objects from Unseen Classes with Unlabeled Videos + +Yuming Du + +Yang Xiao + +Vincent Lepetit + +LIGM, Ecole des Ponts, Univ Gustave Eiffel, CNRS, Marne-la-vallee, France + +{yuming.du, yang.xiao, vincent.lepetit}@enpc.fr + +https://dulucas.github.io/gbopt/ + +# Abstract + +The ability to localize and segment objects from unseen classes would open the door to new applications, such as autonomous object learning in active vision. Nonetheless, improving the performance on unseen classes requires additional training data, while manually annotating the objects of the unseen classes can be labor-intensive and expensive. In this paper, we explore the use of unlabeled video sequences to automatically generate training data for objects of unseen classes. It is in principle possible to apply existing video segmentation methods to unlabeled videos and automatically obtain object masks, which can then be used as a training set even for classes with no manual labels available. However, our experiments show that these methods do not perform well enough for this purpose. We therefore introduce a Bayesian method that is specifically designed to automatically create such a training set: Our method starts from a set of object proposals and relies on (non-realistic) analysis-by-synthesis to select the correct ones by performing an efficient optimization over all the frames simultaneously. Through extensive experiments, we show that our method can generate a high-quality training set which significantly boosts the performance of segmenting objects of unseen classes. We thus believe that our method could open the door for open-world instance segmentation by exploiting abundant Internet videos. + +# 1. Introduction + +Instance segmentation models are now able to predict the masks of objects of known classes in query images [19, 50, 55], providing rich information for many downstream applications such as scene understanding [17, 47] and robot grasping [53, 59, 62]. Unfortunately, existing instance segmentation methods perform poorly on new classes [12]. This is an obstacle to the development of autonomous systems evolving in open worlds where there will always be objects that do not belong to known classes. Being able to + +![](images/a9fdbd915b1a84fea14a7b09502c87285e7df19a8dad88de6a60fc6ad8569cbc.jpg) +Figure 1. Starting from an instance segmentation model trained on some classes, we want to learn to localize and segment objects from new classes without any human label. We do this by using unlabeled videos, which are an abundant source of data. Our approach can automatically detect and select the object masks in the videos. We then use the selected masks to retrain the initial model that can then localize and segment objects from the new classes in still frames without losing performance on the old ones. + +detect and segment these objects would be the starting point of learning to grasp and manipulate them, for example. + +As Figure 1 illustrates, our goal is therefore to automatically improve the performance of instance segmentation models on static images containing objects from new classes without human intervention. This is in contrast with previous works that aiming at limiting the manual labeling burden for object segmentation by using bounding boxes only [21, 28, 65] or developing few-shot techniques [15, 60], but still require human intervention for new classes. + +More specifically, we do not aim at predicting the categories of these new objects, but focus on robustly localizing and accurately segmenting them. In this sense, our work is therefore more related to recent object discovery methods, which attempt to segment objects without manual segmentation labels by grouping pixels according to some criterion [3, 18, 33, 45, 57]. However, these approaches are still very fragile as they can be easily affected by low-level perturbations in color, lighting, or texture. + +Our strategy is therefore to rely on unlabeled video sequences, as unlabeled videos can be acquired without effort while providing rich information. The general idea of using + +![](images/24f3f76874425e814e8c208a9221a0bd9f47bbaf5d672e6b3d700daa59bf9cc1.jpg) + +![](images/c7a1d065babc26afd42612093021c1f04dc8987660c4476b4a18f7e05836eab9.jpg) +Confidence score $>0.5$ + +![](images/4d5debacc70a18bd66ec050331ed8db55c200d4bd2a8f460be86b8cafb68e5ab.jpg) +Input image +Confidence score $>0.1$ +Figure 2. The class 'tortoise' does not belong to COCO classes. By decreasing the confidence score threshold of Mask R-CNN [19] trained on COCO, we can eventually localize and segment all the tortoises at the price of introducing many false positives. We filter these false positives using unlabeled video data. + +![](images/824694e1b72d58ca666594aef1e7f90aea0c24e28230c10e6c1886e83e67f598.jpg) +Confidence score $>0.01$ + +videos for self-supervision is not new [11, 23, 30, 34, 54, 56]. Here, we consider video sequences to automatically generate masks for the objects visible in their frames. Using these masks for training an instance segmentation model should then make it perform better on new objects visible in the videos, even if no human intervention was provided in the process. In our experiments, we still provide the videos, but it is possible to imagine a system that captures videos by itself. + +Unfortunately, our early experiments showed that state-of-the-art video segmentation methods [14, 35, 42, 30, 51] were not sufficient for this purpose. We therefore developed our own method for automatically creating object masks from videos. Note that our task is subtly different from video segmentation methods, which aim at keeping track of the objects over consecutive frames. For our own goal, this is not needed and we only focus on correctly localizing and segmenting the objects in each frame. Like some video segmentation methods [35], we start from mask hypotheses for the objects visible in the videos obtained with a pre-trained class-agnostic instance segmentation. Such model generalizes to objects from unseen classes to some extent, but at the price of introducing many false positives [41]. Figure 2 shows that when the confidence threshold is lowered, both the detections of objects from unseen classes and incorrect detections get accepted. + +It is however possible to filter the incorrect masks using information provided by the videos. Some methods [8, 29, 35, 37, 44] rely on tracklets to track and filter the masks. We claim that such strategy is not optimal, especially for our goal: Image background is underexploited, while it can be very useful by indicating the absence of objects; The optical flow is not used or underexploited, while it gives strong cues about moving objects in videos. To fully + +exploit the background and motion information across unlabeled video frames, we therefore developed a (non-realistic) analysis-by-synthesis approach. Using a Bayesian framework, we derive an objective function with an additional non-overlapping constraint. The objective function, which consists of three loss terms, is designed to explore the background and motion information to remove incorrect masks and select masks that are temporally consistent over the entire video. The non-overlapping constraint comes from the fact that one pixel can at most belong to one object in the image and helps to reject some false positives. Moreover, we provide a two-stage optimization algorithm to optimize this objective function efficiently. + +To evaluate our approach, we created a novel dataset named Unseen-VIS based on the YouTube Video Instance Segmentation (YouTube-VIS) dataset [61], which contains objects that do not belong to COCO classes. Starting from the raw masks generated on the training part of Unseen-VIS using a class-agnostic Mask R-CNN pretrained on COCO dataset, we apply our method to automatically select the correct masks. We demonstrate that using these masks can boost the performance of the Mask R-CNN on the test set of Unseen-VIS without losing performance on COCO classes. To summarize our contributions: + +- We propose a Bayesian method to generate high-quality masks on unlabeled videos containing unseen classes; +- We create a benchmark to evaluate the quality of generated masks on unlabeled videos; +- We demonstrate on our benchmark that our proposed method can be used to improve the performance of an instance segmentation model on unseen classes. + +# 2. Related Work + +In this section, we first review recent works on instance segmentation from color images, especially those targeting new classes. We also review self-learning methods on unlabeled images. Finally, we review several works for video object segmentation as this topic is closely related to our approach. + +Image-level Instance Segmentation. While state-of-the-art methods for object detection and segmentation [19, 50, 55] rely on large amounts of manually labeled images, a few works aim at reducing the annotation burden for learning to detect and segment object classes. They however still require manual annotations: Weakly-supervised methods require no mask annotations but bounding boxes annotations [21, 28, 65] and few-shot methods require a (small) number of manual object masks [15, 60]. + +Self-Learning on Unlabeled Data. Recently, several methods have been proposed to explore self-supervision us + +ing unlabeled static images. They use data distillation [46], unlabeled images from the web [31], consistency across image flipping [24], or an estimate of the uncertainty of prediction [38]. While such approaches are very interesting, unlabeled videos are easily available and have the potential to make the results much more reliable. We compare our method against the most representative methods in our experiments and show we achieve much better performance. + +Another type of approach proceeds in a bottom-up fashion by grouping pixels with similar colors or image features to generate masks [3, 18, 33, 45, 57]. However, this can be easily affected by local textures or colors, and some of these methods have been demonstrated on synthetic images only. Because it starts from a pre-trained instance segmentation model, our approach is much more robust. + +Like us, some methods leverage unlabeled videos for on urban scene segmentation [6] and face and human detection[25]. However, these works only focus on how to enhance the model performance on the existing classes and do not consider novel classes. [40] makes use of stereo video data together with depth information to reconstruct a static background, then object proposals are generated from the foreground regions by subtraction. While this is an interesting approach, they require depth data and static backgrounds. + +Video Object Segmentation. Our work also relates to One-Shot, Zero-Shot video object segmentation (VOS) and saliency-based video object segmentation. One-Shot VOS aims at segmenting the objects in the video when the ground truth segmentation is given for a frame. One-Shot VOS methods typically warp the provided segmentation to other frames [4, 30, 54]. They thus require manual annotations and cannot generate new predictions if new objects appear. Some Zero-Shot methods [9, 39, 51, 52] are trained with video labels on seen classes and are able to generalize to unseen classes, but video labeling is very labor-extensive. Some methods look for salient regions in videos [7, 10, 11, 14, 22, 27, 34, 42], as salient regions tend to correspond to objects. However, saliency prediction has two major limitations for our purpose: (a) It can be fooled by non-salient camouflaged objects. (b) Two adjacent objects would be merged into a single salient region, while we want to identify them individually. + +Like us, a few methods already adopt a proposal-based approach [2, 35, 37], but rely on classical tracking algorithms to track the proposals such as tracklets. By contrast, our approach relies on analysis-by-synthesis. Analysis-by-synthesis is an old concept in computer vision, but has been recently increasingly popular. By aiming at explaining the whole image, it can exploit more information. Moreover, it is conceptually simple and requires few easy-to-fix hyperparameters. We show in our experiments that our method + +performs better than the state-of-the-art video object segmentation method UnOVOST [35] for the purpose of generating object masks. + +# 3. Method + +As discussed in Section 1, our goal is to improve the performance of a pre-trained class-agnostic instance segmentation on unseen classes. Our pipeline consists of three steps: + +- Mask Generation: We use our baseline instance segmentation network on unlabeled videos containing unseen classes for mask generation; +- Mask Selection: We apply our method to automatically select the correct masks on unlabeled videos; +- Model Refinement: We use our generated masks to fine-tune or retrain our baseline network to boost its performance on unseen classes. + +In this section, we present our baseline instance segmentation network and our approach for automatically selecting high-quality masks by exploring the video information. As we will show in the following section, compared to exhaustive search, our approach is highly efficient and requires few easy-to-fix hyper-parameters. + +# 3.1. Baseline Network for Mask Generation + +To generate masks from unlabeled videos, we use a class-agnostic Mask R-CNN [19] with a ResNet-50-FPN [32] backbone as our baseline network. Following previous work [41], we refer to this class-agnostic Mask R-CNN as 'MP R-CNN' for Mask Proposal R-CNN, as it aims only at generating mask proposals regardless of object classes. Note that in practice, Mask R-CNN could be replaced by any other trainable instance segmentation methods. As we mentioned in Section 1, the instance segmentation network may assign low confidence scores for some correct detections of unseen classes. Therefore, during the mask generation stage, we set the confidence score threshold to 0 to get as many detections as possible. + +# 3.2. Mask Selection + +Given a video of $T$ frames, we start from a set of mask candidates $\mathcal{M}_t = \{M_{t,1},\dots M_{t,N}\}$ for each frame $I_{t}$ obtained using our baseline network, with $N$ the number of masks candidates in $I_{t}$ . To select the mask candidates that actually correspond to objects, we exploit the following cues and constraint: + +- The "Background cue": Segmenting typical backgrounds such as sky or grass gives us a cue about where the objects are, whether they move or not. +- The "Flow cue": The optical flow between consecutive frames gives us a cue about the moving objects. +- The "Consistency cue": The selected masks should be consistent not only between consecutive frames, but also over long sequences. + +- The "Non-overlapping constraint": An additional constraint that is usually overlooked is that the masks should not overlap: Ideally, one pixel in the image can belong to at most one mask. + +As we will show in the following sections, each cue corresponds to a loss term in the final objective function. Each of them and the non-overlapping constraint contribute to removing the false positives, as will be demonstrated by our ablation study in Section 4.3. + +To combine these cues to select the correct masks in a given video sequence, we rely on a Bayesian framework. This selection problem can be formalized as maximizing the probability of the detected masks given the frames of the video: + +$$ +P \left(\mathbf {C} _ {1},.., \mathbf {C} _ {T} \mid I _ {1},.., I _ {T}\right), \tag {1} +$$ + +where $\mathbf{C}_t$ is a set of binary random variables, with $\mathbf{C}_{t,i} = 1$ corresponding to the event that mask $M_{t,i}$ is selected and 0 that it is not. We show in the supplementary material that maximizing this probability is equivalent to minimizing the following objective function: + +$$ +\begin{array}{l} \arg \min _ {\left\{\Delta_ {1},.., \Delta_ {T} \right\}} \sum_ {t} \left(\lambda_ {I} \mathcal {L} _ {I} (I _ {t}, \Delta_ {t}) + \right. \\ \lambda_ {F} \mathcal {L} _ {F} \left(F _ {t}, I _ {t}, I _ {t + 1}, \Delta_ {t}, \Delta_ {t + 1}\right) + \tag {2} \\ \left. \lambda_ {p} \mathcal {L} _ {p} \left(\Delta_ {t}, \Delta_ {t + 1}\right)\right), \\ \end{array} +$$ + +under the non-overlapping constraint that will be detailed below. $\lambda_I, \lambda_F,$ and $\lambda_p$ are constant weights. $F_{t}$ represents the optical flow for the pair of frames $(I_t, I_{t+1})$ . $\Delta_t = \{\delta_{t,1}, \dots, \delta_{t,N}\}$ denotes the realization of $\mathbf{C}_t$ where $\delta_{t,i}$ is the realization of the random binary variable $\mathbf{C}_{t,i}$ . $\delta_{t,i} = 1$ when $M_{t,i}$ is selected, otherwise $\delta_{t,i} = 0$ . + +We call $\mathcal{L}_I$ the Background loss and $\mathcal{L}_F$ the Flow loss, as they exploit the Background cue and the Flow cue respectively. $\mathcal{L}_p$ enforces consistent selections between consecutive frames. We detail these three losses below. + +# 3.2.1 Background Loss $\mathcal{L}_I$ + +We use $\mathcal{L}_I$ to exploit the Background cue that hints at where the objects are. As shown in Figure 3, to evaluate it, we compare a binary image generated for the selected masks and the foreground/background probability map predicted by a binary segmentation network $f$ by calculating their cross entropy, as the image background should match the background of the selected masks. By doing this comparison over all the image locations, we can exploit information from the whole image to guide the mask selection—we will rely on the same strategy for the other terms. Formally, we take + +$$ +\mathcal {L} _ {I} \left(I _ {t}, \Delta_ {t}\right) = \operatorname {C E} \left(\mathrm {B g} \left(I _ {t}\right), 1 - \overline {{\mathrm {F g}}} (\Delta_ {t})\right), \tag {3} +$$ + +where CE denotes the cross-entropy, $\mathrm{Bg}(I_t)$ is a probability map for each pixel to belong to the background as predicted + +![](images/5d13031683b2cb85fbaee733c689a5d4fb96fcd1e0dc8ab38ebd35ef72a9f398.jpg) +Figure 3. To evaluate the background loss $\mathcal{L}_I$ of Eq. (3), we compare the background predicted for the image and the background of the selected masks. + +by the network $f$ , and $\overline{\mathrm{Fg}}(\Delta_t)$ is the binary image of masks in $\mathcal{M}_t$ such that $\delta_{t,i} = 1$ . For $f$ , we use the network architecture proposed in [26] trained on the same training data as our baseline network for mask generation. The details about the segmentation network $f$ can be found in the supplementary material. + +# 3.2.2 Flow Loss $\mathcal{L}_F$ + +We use $\mathcal{L}_F$ to exploit the Flow cue: The optical flow is the result of the object motions and the camera motion, and thus also hints at where the objects are. Even if an object is static but the camera is in motion, when the distance between the camera and the background is large enough, relative motion will make the optical flow of the object regions stand out from the background optical flow. + +Figure 4 shows how we evaluate this term. We compare the flow predicted by an optical flow estimator $g$ and a "synthetic optical flow" generated using the masks selected in $\mathcal{M}_t$ and $\mathcal{M}_{t+1}$ . Similar to the $\mathcal{L}_I$ term, this comparison allows us to exploit information from all the image locations. In practice, we use the method of [49] for $g$ . To generate the synthetic optical flow, we use the colors of the pixels in the selected masks to compute their optical flow. We average the flow in $F_t$ on the pixels that do not belong to any mask to assign these pixels the resulting value. The detailed procedure can be found in the supplementary material. + +Using this procedure, the measured flow $F_{t} = g(I_{t},I_{t + 1})$ and the synthetic flow are similar when all moving objects are correctly selected in both frames, even when the camera is in motion. More formally, we take: + +$$ +\mathcal {L} _ {F} \left(F _ {t}, I _ {t}, I _ {t + 1}, \Delta_ {t}, \Delta_ {t + 1}\right) = \left\| F _ {t} - \bar {F} _ {t} \right\| _ {1}, \tag {4} +$$ + +where $\overline{F}_t = \overline{F}_t(I_t, I_{t+1}, \Delta_t, \Delta_{t+1})$ is the synthetic flow generated for the selected masks in $\mathcal{M}_t$ and $\mathcal{M}_{t+1}$ . We use the L1-norm to compare the two flows to be robust to outlier values that are very common in the predicted flow. Figure 4 shows examples for $F_t$ and $\overline{F}_t$ . + +![](images/45ccd20f2cebf8b714afef16ac71ebfd60511c3071ff06439e5de737e1c8bfdb.jpg) +Figure 4. To evaluate the flow loss $\mathcal{L}_F$ of Eq. (4), we compare the optical flow estimated between two consecutive images and the optical flow computed for the masks selected in the two images. + +![](images/845579a621bdf8bd74d7aea50d1a253a174b4368d6b86815fe01a6fa0f0af91e.jpg) +Figure 5. To evaluate the regularization loss $\mathcal{L}_p$ of Eq. (5), we compare the binary images of the selected masks in two consecutive images. + +# 3.2.3 Regularization Loss $\mathcal{L}_p$ and Constraint + +As discussed above, the optimization in Eq. (2) should be done under the constraint that no masks selected for the same frame overlap each other. + +$\mathcal{L}_p(\Delta_t, \Delta_{t+1})$ is usually interpreted in tracking problems as a motion model. We use it to enforce a consistent selection of masks between consecutive frames. Figure 5 shows how we compute it: We use a very simple motion model and assume that the objects move slowly, in other words, the areas segmented as objects do not change abruptly between two consecutive frames. Formally, we take: + +$$ +\mathcal {L} _ {p} \left(\Delta_ {t}, \Delta_ {t + 1}\right) = - \operatorname {I o U} \left(\overline {{\mathrm {F g}}} \left(\Delta_ {t}\right), \overline {{\mathrm {F g}}} \left(\Delta_ {t + 1}\right)\right), \tag {5} +$$ + +i.e. the negative Intersection-over-Union between the binary images of the masks selected for frames $I_{t}$ and $I_{t + 1}$ . It is set to 0 when no masks are selected for none of the two images. + +# 3.3. Two-Stage Optimization + +In this section, we introduce an efficient way to minimize Eq. (2). Note that minimizing this function requires to optimize on all the frames simultaneously. A naive approach is to apply exhaustive search for the solution of the problem, where the number of evaluations of the objective function would be $O(2^{NT})$ , with $N$ the number of mask candidates per frame and $T$ the number of frames (typical + +values $N = 15$ and $T = 180$ would require $\sim 10^{810}$ evaluations). This is clearly computationally prohibitive. + +We provide here an efficient two-stage algorithm, depicted in Figure 6. In the first stage, based on the background loss $\mathcal{L}_I$ and the non-overlapping constraint, we select the top- $K$ most promising combinations of masks for each frame independently. Note that the combinations violating the non-overlapping constraint are simply discarded. Then, in the second stage, we optimize the complete objective function over all frames simultaneously to find the best combinations for each frame. For both stages, we can use Dijkstra's algorithm [13] to significantly decrease the complexity of the computations. In the worst case, the number of evaluations of the objective function becomes $O(KTN^3 + K^2T^2)$ . We use $K = 10$ in practice, which reduces the required evaluations from $\sim 10^{810}$ to $\sim 10^7$ for the numerical example above. + +This optimization problem is related to many previous works on multiple object tracking [1, 36, 44, 58, 63, 64], which typically use graph-based methods to solve related problems efficiently. One of the main differences with these works is that, in our video-level optimization, each node corresponds to a combination of masks instead of a single bounding box or mask. Besides, we do not have access to the object classes, and our optimization is under the constraint that the masks do not overlap, while these works typically rely on bounding boxes that can overlap when the objects are close to each other. + +1. Image-Level Optimization. At this stage, for each frame $I_{t}$ , we look for the top- $K$ combinations of masks in the power set $\mathcal{P}(\mathcal{M}_t)$ that minimize the Eq.(3) under the non-overlapping constraint. An exhaustive search would take $2^{N}$ evaluations of the objective function. + +However, we note that this problem can be formulated as a K-shortest path search problem in a binary tree, where each pair of branches of a node corresponds to the selection or not of a mask, and each branch has an associated weight: This weight is set to infinity if the branch corresponds to the selection of a mask that overlaps with one of its ancestors, otherwise it depends on the value of $\mathcal{L}_I$ computed only on the mask. By iteratively applying Dijkstra's algorithm to find the top- $K$ combinations of masks, we reduce the number of evaluations to $O(KN^3)$ . Note that our proposed algorithm is agnostic to the order of the mask candidates in $\mathcal{M}_t$ . More details can be found in the supplementary material. + +2. Video-Level Optimization. As shown in Figure 6, we generate a graph with the remaining top- $K$ combinations of masks for each frame: Each node corresponds to one combination and each edge is labeled with the loss given in Eq.(2) for the two combinations it links. Finding the best combination for each frame becomes the problem of finding + +![](images/ebac34d22793135807d6c3d087639f02082e66ace32aa54b9db9f084b87e3fff.jpg) +Figure 6. Given a video, we first run the image-level optimisation on each frame and get the top- $K$ combinations of masks for each frame. The video-level optimisation selects the best combination for each frame efficiently by solving a shortest path problem. For this figure, $K$ is set to 3. More details are given in Section 3.3. + +the shortest path in this graph. Instead of doing $2^{KT}$ evaluations of the objective function to find the shortest path, we can use Dijkstra's algorithm [13] here as well to significantly accelerate the speed of our algorithm. The number of evaluations is reduced to $O(K^2 T^2)$ . The supplementary material explains in more detail how we build the graph. + +# 4. Experiments + +In this section, we first present our benchmark for evaluating our approach. Then we compare our method with several previous methods for the purpose of generating masks on unlabeled videos and analyze the results. We also conduct a thorough ablation study to show the influence of different components of our method. Due to space limits, implementation details were moved to the supplementary material. + +# 4.1. Experimental Setup + +Implementation Details. As described in Section 3.1, we use a class-agnostic Mask R-CNN [19] with a ResNet-50-FPN [32] backbone as our baseline for mask generation. Our baseline is pre-trained on the COCO dataset, which contains 80 classes and 115k training images. We follow the training strategy as described in [19]. We take $\lambda_{I} = \lambda_{F} = 1$ and $\lambda_{p} = 0.5$ for the weights in Eq. (2) in all our experiments. + +Evaluation. To benchmark our method, we created a dataset we call "Unseen-VIS". The training part of "Unseen-VIS" consists of videos collected from the YouTube Video Instance Segmentation (YouTube VIS) [61] and is used for mask generation. The test part of "Unseen-VIS" contains static images extracted from YouTube VIS for evaluation. + +The original YouTube VIS dataset contains 2,883 videos with 131k object instances spanning 40 classes, among + +which 24 coincide with COCO. We thus consider the remaining 16 classes ${}^{1}$ as unseen classes which results in 795 videos in total. We randomly selected 595 videos as the training set, which we refer as Unseen-VIS-train. The labeled static images in the remaining 200 videos are used for evaluation, which we refer as Unseen-VIS-test. All the videos of Unseen-VIS-train are used as unlabeled videos, and their ground truth masks are ignored. + +For quantitative evaluation, we rely on the standard COCO metrics: $AP$ , $AP_{50}$ , $AP_{75}$ , and $AR_{1}$ , $AR_{3}$ and $AR_{5}$ as the maximum number of objects per image in our testing set is 4. We do not use $AP_{S}$ , $AP_{M}$ , and $AP_{L}$ as the object scales in COCO differ largely from YouTube VIS. + +# 4.2. Results on Unseen-VIS-test + +# 4.2.1 Video-Annotation-Free Mask Generation + +We first compare our method to other approaches that can also generate masks given video sequences without using any video annotations. Each method is first applied on the Unseen-VIS-train dataset for mask generation, then we compare the performance of MP R-CNN on the Unseen-VIS-test set after fine-tuning on these masks. As only one over five frames is annotated in Unseen-VIS-train (19352 annotated frames in total), we thus use only the masks of these frames for training for fair comparison among different methods. + +Saliency/Flow-based methods. FST [42] and NLC [14] can generate masks from videos by estimating the saliency and motion of the objects in videos. IOA [10] trains a deep neural network on the output of an unsupervised soft foreground segmentation algorithm [48] to segment objects in videos. These methods can identify moving regions in the videos but can not separate adjacent objects in the images, thus a proposal generated by these methods may actually correspond to several objects. + +Tracking-based methods. TWB [2] and UnOVOST [35] rely on a frame-by-frame tracking pipeline applied to mask proposals. These methods are the closest methods to ours as we all rely on an instance segmentation model for proposal generation. However, as we mentioned before, for our final goal (training a better object detector), we do not need to keep track of the detected objects. + +Similarity Propagation. Given masks for a frame, UVC [30] warps these masks to consecutive frames based on the estimated correspondences between consecutive frames. For this experiment, we use it in a zero-shot setting ("ZS-UVC"), where the masks of the first frame are instead generated by thresholding the confidence score on the first frame prediction of MP R-CNN (we use a threshold of 0.1 in practice). + +
Method used for mask generationUnseen-VIS-test
APAP50AP75AR1AR3AR5
(bef. fine-tuning)35.861.238.133.347.350.3
NLC [14]1.23.81.02.45.36.9
IOA [10]2.48.50.96.98.79.5
FST [42]17.041.811.322.030.633.1
UnOVOST [35]31.155.632.229.944.548.2
TWB [2]31.253.432.831.546.750.0
DD [46]36.663.838.532.546.249.3
ZS-UVC [30]21.242.619.926.340.043.2
Ours39.067.941.335.248.951.4
+ +Self-training methods. We also compare our method with the self-learning Data Distillation (DD) method [46]. We follow their proposed test time augmentation to generate masks on each frame of the Unseen-VIS-train videos independently, as this method performs on single images. + +We report the results in Table 1. Compared with the Saliency/Flow-based methods and Tracking-based methods, the masks generated by our method are of high quality and can largely improve the performance of the baseline network in all metrics. Our method also outperforms the state-of-the-art self-training method (DD) [46] for two-stage object detection by a large margin. + +# 4.2.2 Video-Annotation-Dependent Mask Generation + +In addition to the aforementioned methods, we further compare with two methods that adopt different settings and explore the upper bound of our method. + +RVOS. RVOS [51] is an end-to-end video object segmentation framework that directly runs on videos, which requires labeled videos for training. We adopt the Zero-Shot setting for RVOS, where it is trained with ResNet50 [20] as backbone on 1089 videos (25869 annotated frames in total) of seen classes of YouTube VIS and directly applied to the Unseen-VIS-train videos for mask generation. + +OS-UVC. Here, we consider the One-Shot setting for UVC, where the ground truth masks of the first frame are given for all Unseen-VIS-train videos. + +Selected using GT. We use the ground truth mask labels of Unseen-VIS-train to select the masks predicted by MP R-CNN. The similarity among masks is evaluated based on their Intersection-over-Union, and the Hungarian algorithm is used to select the masks that best match with the ground truth. This can be regarded as an upper bound that we can achieve given the predictions of MP R-CNN. + +Trained with GT. We report the performance of MP R-CNN fine-tuned with ground truth mask labels of Unseen-VIS-train. This can also be regarded as an upper bound, + +Table 1. Mask Generation without Video Annotation. Performance of MP R-CNN on Unseen-VIS-test after fine-tuning on masks generated by various methods applied to Unseen-VIS-train without using any video annotation. + +
Method used for mask generationVideo AnnotationsUnseen-VIS-test
SeenUnseenAPAP50AP75AR1AR3AR5
(bef. fine-tuning)35.861.238.133.347.350.3
RVOS [51]✓38.568.938.035.449.552.8
Ours--39.067.941.335.248.951.4
OS-UVC [30]✓41.573.742.939.152.754.9
Selected using GT✓42.775.145.337.353.453.6
Trained with GT✓50.880.954.643.658.660.6
+ +Table 2. Mask Generation with Video Annotations. Performance of MP R-CNN on Unseen-VIS-test after fine-tuning on the masks generated by various methods that require manual video annotations except ours. RVOS uses labeled videos of Seen classes for training. OS-UVC uses the ground truth masks for the first frame for mask generation. "Selected using GT" represents the masks generated by MP R-CNN selected using ground truth masks and can be regarded as an upper-bound. + +
MethodUse Unla-beled DataJ & FJF
MeanRecallDecayMeanRecallDecay
UnOVOST [35]56.254.463.7-0.0157.965.0
UnOVOST+✓59.959.170.0-0.0660.870.8
+ +Table 3. Zero-Shot Video Object Segmentation evaluation on the DAVIS dataset [43]. UnOVOST [35] relies on an instance segmentation network for mask generation. UnOVOST+ row: After fine-tuning its mask generation network on the DAVIS training dataset using the masks generated by our approach, it achieves higher results on all metrics. + +where all the classes have already been Seen. + +We report the results in Table 2. Compared to RVOS [51] trained with labeled videos, our method can still achieve comparable results on recall while surpassing their results by a large margin on $AP_{75}$ , which means that the masks selected by our method are of better quality. Importantly for practical applications, our method was able to deal with the large domain gap between the images in COCO on which we pre-train MP R-CNN and the frames in YouTube VIS on which we apply and evaluate our method. RVOS was trained and applied on videos from YouTube VIS, and therefore was not confronted to a domain gap. + +While OS-UVC [30] achieves higher results than our approach, it relies mainly on a high-quality first frame mask: We observe a large performance drop when we replace the ground truth masks ("OS-UVC" in Table 2) by the predicted masks ("ZS-UVC" in Table 1). Besides, it can only track objects visible in the first frame as it does not handle the emergence of new objects. + +After simply retraining from scratch both on the 80 seen classes of COCO and the masks generated by our approach on Unseen-VIS-train, MP R-CNN achieves 35.2 mask $AP$ on COCO minimal and 38.9 mask $AP$ on Unseen-VISTest. Compared with the MP R-CNN pre-trained only with COCO dataset, which achieves 35.3 mask $AP$ on COCO minimal, we achieve better performance on Unseen-VIS-test while maintaining the performance on COCO. More details can be found in the supplementary material. + +![](images/6af224665b3f6e5d9d57511b0a09c6208fcc7454ed85182be4565f4a89658254.jpg) +Figure 7. Qualitative results of selected masks on Unseen-VIS-train and detections of new classes on Unseen-VIS-test after fine-tuning on these selected masks. Top: First row: Masks detected by our baseline network MP R-CNN on two sequences from Unseen-VIS-train; Second row: Masks selected by UnOVOST [35]; Third row: Masks selected by our approach. Note that we keep the masks for the pandas and rabbits, and reject the masks that do not correspond to real objects. Bottom: Masks detected in still images from Unseen-VIS-test. Fourth row: Masks detected by MP R-CNN before we fine-tuned it on the masks selected by our approach on Unseen-VIS-train; Fifth row: Masks detected by MP R-CNN after fine-tuning. The masks generated by our method results in a significantly better model for the new classes: We can now correctly segment pandas and rabbits in new videos, even if no manual segmentations for pandas and rabbits were provided. For more examples, please refer to the video in the supplementary material. + +Application to Zero-Shot Video Object Segmentation. As one of the state-of-the-art zero-shot video object segmentation methods $^{2}$ , UnOVOST [35] segments the objects in the videos by linking the masks predicted by an instance segmentation network on each frame. As show in Table 3, by fine-tuning the original mask generation model on the masks generated on the DAVIS training dataset [43] using our method, we achieve much better results. This demonstrates that downstream tasks can benefit from the performance boost brought by our method. + +# 4.3. Ablation Study + +Table 4 shows the positive impact made by each loss term and constraint in Eq. (2). The masks obtained by applying only the background loss $\mathcal{L}_I$ can already improve the performance of baseline on unseen classes. Similarly, adding the constraint that the masks should not overlap, the flow loss $\mathcal{L}_F$ , or the regularization loss $\mathcal{L}_p$ has a positive impact. In particular, this shows that both the flow loss $\mathcal{L}_F$ and the regularization loss $\mathcal{L}_p$ help reranking the combinations of masks given by the background loss. + +# 5. Conclusion + +In this paper, we attacked the problem of localizing and segmenting objects from unseen classes without any manual mask labels. We showed that, based on an instance segmentation model pretrained on some seen classes, our method provides high-quality masks for unseen classes after + +
\( \mathcal{L}_I \)Overl.Constr.\( \mathcal{L}_F \)\( \mathcal{L}_p \)\( AP \)\( AP_{50} \)\( AP_{75} \)\( AR_1 \)\( AR_3 \)\( AR_5 \)
35.861.238.133.347.350.3
✓36.665.237.833.347.750.8
✓✓38.164.640.234.248.551.2
✓✓✓38.767.040.534.748.751.3
✓✓✓✓39.067.941.335.248.951.4
+ +Table 4. Ablation study on the different components of our method. + +analysing unlabeled videos, without requiring difficult-to-tune hyper-parameters. Moreover, we provided an efficient implementation by breaking down the computationally prohibitive optimization into a two-stage optimization. + +It should nevertheless be noted that, in the unsupervised case, the concept of objects is quite ill-defined. The boundary between "things" and "stuff" [5, 16] is sometimes fuzzy: For example, should we consider a stone on the background as an object? What if a person pushes this stone? The granularity of the problem is also not clear: Should we consider a person as one object, or each of their clothes as individual objects? This ambiguity does not arise in the supervised case, as the annotators decide what is an object, but makes the evaluation of unsupervised object detection difficult. It may be important to rethink the definition of object, either by its shape or its function, to make the evaluation of unsupervised object segmentation more meaningful. + +Acknowledgement We thank Ze Chen, Zerui Chen, Changqian Yu, Enze Xie, Tianze Xiao, Yinda Xu, Xi Shen, Mathis Petrovich, and Philippe Chiberre for valuable feedback. This project has received funding from the CHISTERA IPALM project. + +# References + +[1] Jérôme Berclaz, François Fleuret, Engin Turetken, and Pascal Fua. Multiple Object Tracking Using K-Shortest Paths Optimization. IEEE TPAMI, 33(9), 2011. +[2] Philipp Bergmann, Tim Meinhardt, and Laura Leal-Taixe. Tracking Without Bells and Whistles. In CVPR, 2019. +[3] Christopher P. Burgess, Loic Matthey, Nicholas Watters, Rishabh Kabra, Irina Higgins, Matt Botvinick, and Alexander Lerchner. Monet: Unsupervised Scene Decomposition and Representation. In arXiv, 2019. +[4] Sergi Caelles, Kevis-Kokitsi Maninis, Jordi Pont-Tuset, Laura Leal-Taixe, Daniel Cremers, and Luc Van Gool. One-Shot Video Object Segmentation. In CVPR, 2017. +[5] Holger Caesar, Jasper Uijlings, and Vittorio Ferrari. COCO-Stuff: Thing and Stuff Classes in Context. In CVPR, 2018. +[6] Liang-Chieh Chen, Raphael Gontijo Lopes, Bowen Cheng, Maxwell D. Collins, Ekin D. Cubuk, Barret Zoph, Hartwig Adam, and Jonathon Shlens. Naive-Student: Leveraging Semi-Supervised Learning in Video Sequences for Urban Scene Segmentation. In ECCV, 2020. +[7] Yi-Wen Chen, Yi-Hsuan Tsai, Yen-Yu Lin, and Ming-Hsuan Yang. VOSTR: Video Object Segmentation via Transferable Representations. IJCV, 128(4), 2020. +[8] Jingchun Cheng, Yi-Hsuan Tsai, Wei-Chih Hung, Shengjin Wang, and Ming-Hsuan Yang. Fast and Accurate Online Video Object Segmentation via Tracking Parts. In CVPR, 2018. +[9] Jingchun Cheng, Yi-Hsuan Tsai, Shengjin Wang, and Ming-Hsuan Yang. SegFlow: Joint Learning for Video Object Segmentation and Optical Flow. In ICCV, 2017. +[10] Ioana Croitoru, Simion-Vlad Bogolin, and Marius Leordeanu. Unsupervised Learning from Video to Detect Foreground Objects in Single Images. In ICCV, 2017. +[11] Achal Dave, Pavel Tokmakov, and Deva Ramanan. Towards Segmenting Anything That Moves. In ICCV, 2019. +[12] Akshay Dhamija, Manuel Gunther, Jonathan Ventura, and Terrance Boult. The Overlooked Elephant of Object Detection: Open Set. In WACV, 2020. +[13] Edsger W. Dijkstra. A Note on Two Problems in Connexion with Graphs. Numerische mathematik, 1(1), 1959. +[14] Alon Faktor and Michal Irani. Video Segmentation by Non-Local Consensus Voting. In BMVC, 2014. +[15] Zhibo Fan, Jin-Gang Yu, Zhihao Liang, Jiarong Ou, Changxin Gao, G. Xia, and Y. Li. FGN: Fully Guided Network for Few-Shot Instance Segmentation. In CVPR, 2020. +[16] D. A. Forsyth, J. Malik, M. M. Fleck, H. Greenspan, T. K. Leung, S. Belongie, C. Carson, and C. Bregler. Finding Pictures of Objects in Large Collections of Images. In Object Representation in Computer Vision, 1996. +[17] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh R-CNN. In ICCV, 2019. +[18] Klaus Greff, Raphaël Lopez Kaufman, Rishabh Kabra, Nick Watters, Christopher Burgess, Daniel Zoran, Loic Matthey, Matthew Botvinick, and Alexander Lerchner. Multi-Object Representation Learning with Iterative Variational Inference. In ICML, 2019. + +[19] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask R-CNN. In ICCV, 2017. +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016. +[21] Ronghang Hu, Piotr Dólár, Kaiming He, Trevor Darrell, and Ross Girshick. Learning to Segment Every Thing. In CVPR, 2018. +[22] Suyog Dutt Jain, Bo Xiong, and Kristen Grauman. Fusion-seg: Learning to Combine Motion and Appearance for Fully Automatic Segmentation of Generic Objects in Videos. In CVPR, 2017. +[23] Tomas Jakab, Ankush Gupta, Hakan Bilen, and Andrea Vedaldi. Self-Supervised Learning of Interpretable Keypoints from Unlabelled Videos. In CVPR, 2020. +[24] Jisoo Jeong, Seungeui Lee, Jeesoo Kim, and Nojun Kwak. Consistency-Based Semi-Supervised Learning for Object Detection. In NeurIPS, 2019. +[25] SouYoung Jin, Aruni Roychowdhury, Huaizu Jiang, Ashish Singh, Aditya Prasad, Deep Chakraborty, and Erik Learned-Miller. Unsupervised Hard Example Mining from Videos for Improved Object Detection. In ECCV, 2018. +[26] Alexander Kirillov, Kaiming He, Ross Girshick, Carsten Rother, and Piotr Dólár. Panoptic Segmentation. In CVPR, 2019. +[27] Yeong Jun Koh and Chang-Su Kim. Primary Object Segmentation in Videos Based on Region Augmentation and Reduction. In CVPR, 2017. +[28] Weicheng Kuo, A. Angelova, Jitendra Malik, and Tsung-Yi Lin. ShapeMask: Learning to Segment Novel Objects by Refining Shape Priors. In ICCV, 2019. +[29] Fuxin Li, Taeyoung Kim, Ahmad Humayun, David Tsai, and James M. Rehg. Video Segmentation by Tracking Many Figure-Ground Segments. In ICCV, 2013. +[30] Xueting Li, Sifei Liu, Shalini De mello, Xiaolong Wang, Jan Kautz, and Ming-Hsuan Yang. Joint-Task Self-Supervised Learning for Temporal Correspondence. In NeurIPS, 2019. +[31] Yandong Li, Di Huang, Danfeng Qin, Liqiang Wang, and Boqing Gong. Improving Object Detection with Selective Self-Supervised Self-Training. In ECCV, 2020. +[32] Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature Pyramid Networks for Object Detection. In CVPR, 2017. +[33] Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-Centric Learning with Slot Attention. In NeurIPS, 2020. +[34] Xiankai Lu, Wenguan Wang, Jianbing Shen, Yu-Wing Tai, David J. Crandall, and Steven C.H. Hoi. Learning Video Object Segmentation from Unlabeled Videos. In CVPR, 2020. +[35] Jonathon Luiten, Idil Esen Zulfikar, and Bastian Leibe. UnovOST: Unsupervised Offline Video Object Segmentation and Tracking. In WACV, 2020. +[36] Tianyang Ma and Longin Jan Latecki. Maximum Weight Cliques with Mutex Constraints for Video Object Segmentation. In CVPR, 2012. + +[37] Anton Milan, Laura Leal-Taixe, Konrad Schindler, and Ian Reid. Joint Tracking and Segmentation of Multiple Targets. In CVPR, 2015. +[38] Natalia Neverova, David Novotny, and Andrea Vedaldi. Correlated Uncertainty for Learning Dense Correspondences from Noisy Labels. In NeurlPS, 2019. +[39] Seoung Wug Oh, Joon-Young Lee, Ning Xu, and Seon Joo Kim. Video Object Segmentation Using Space-Time Memory Networks. In ICCV, 2019. +[40] Aljoša Osep, Paul Voigtlaender, Jonathon Luiten, Stefan Breuers, and Bastian Leibe. Large-Scale Object Mining for Object Discovery from Unlabeled Video. In ICRA, 2019. +[41] Aljoša Osep, Paul Voigtlaender, Mark Weber, Jonathon Luiten, and Bastian Leibe. 4D Generic Video Object Proposals. In ICRA, 2020. +[42] Anestis Papazoglou and Vittorio Ferrari. Fast Object Segmentation in Unconstrained Video. In ICCV, 2013. +[43] Federico Perazzi, Jordi Pont-Tuset, Brian Mcwilliams, Luc Van Gool, Markus Gross, and Alexander Sorkine-Hornung. A Benchmark Dataset and Evaluation Methodology for Video Object Segmentation. In CVPR, 2016. +[44] Federico Perazzi, Oliver Wang, Markus Gross, and Alexander Sorkine-Hornung. Fully Connected Object Proposals for Video Segmentation. In ICCV, 2015. +[45] Trung Pham, Vijay BG Kumar, Thanh-Toan Do, Gustavo Carneiro, and Ian Reid. Bayesian Semantic Instance Segmentation in Open Set World. In ECCV, 2018. +[46] Ilija Radosavovic, P. Dollár, Ross B. Girshick, Georgia Gkioxari, and Kaiming He. Data Distillation: Towards Omni-Supervised Learning. In CVPR, 2018. +[47] Martin Runz, Kejie Li, Meng Tang, Lingni Ma, Chen Kong, Tanner Schmidt, Ian Reid, Lourdes Agapito, Julian Straub, Steven Lovegrove, and Richard Newcombe. FroDO: From Detections to 3D Objects. In CVPR, 2020. +[48] Otilia Stretcu and Marius Leordeanu. Multiple Frames Matching for Object Discovery in Video. In BMVC, 2015. +[49] Zachary Teed and Jia Deng. RAFT: Recurrent All-Pairs Field Transforms for Optical Flow. In ECCV, 2020. +[50] Zhi Tian, Chunhua Shen, and Hao Chen. Conditional Convolutions for Instance Segmentation. In ECCV, 2020. +[51] Carles Ventura, Miriam Bellver, Andreu Girbau, Amaia Salvador, Ferran Marques, and Xavier Giro-I-Nieto. RVOS: End-To-End Recurrent Network for Video Object Segmentation. In CVPR, 2019. +[52] Paul Voigtlaender, Yuning Chai, Florian Schroff, Hartwig Adam, Bastian Leibe, and Liang-Chieh Chen. FEELVOS: Fast End-To-End Embedding Learning for Video Object Segmentation. In CVPR, 2019. +[53] Kentaro Wada, Kei Okada, and Masayuki Inaba. Joint Learning of Instance and Semantic Segmentation for Robotic Pick-and-Place with Heavy Occlusions in Clutter. In ICRA, 2019. +[54] Xiaolong Wang, Allan Jabri, and Alexei A. Efros. Learning Correspondence from the Cycle-Consistency of Time. In CVPR, 2019. +[55] Xinlong Wang, Tao Kong, Chunhua Shen, Yuning Jiang, and Lei Li. SOLO: Segmenting Objects by Locations. In ECCV, 2020. + +[56] Nicholas Watters, Daniel Zoran, Theophane Weber, Peter Battaglia, Razvan Pascanu, and Andrea Tacchetti. Visual Interaction Networks: Learning a Physics Simulator from Video. In NeurIPS, 2017. +[57] Kelvin Wong, Shenlong Wang, Mengye Ren, Ming Liang, and Raquel Urtasun. Identifying Unknown Instances for Autonomous Driving. In Conference on Robot Learning, 2020. +[58] Zheng Wu, Thomas H. Kunz, and Margrit Betke. Efficient Track Linking Methods for Track Graphs Using Network-Flow and Set-Cover Techniques. In CVPR, 2011. +[59] Christopher Xie, Yu Xiang, Arsalan Mousavian, and Dieter Fox. The Best of Both Modes: Separately Leveraging RGB and Depth for Unseen Object Instance Segmentation. In Conference on robot learning, 2020. +[60] Xiaopeng Yan, Ziliang Chen, Anni Xu, Xiaoxi Wang, Xiaodan Liang, and L. Lin. Meta R-CNN: Towards General Solver for Instance-Level Low-Shot Learning. In ICCV, 2019. +[61] Linjie Yang, Yuchen Fan, and Ning Xu. Video Instance Segmentation. In ICCV, 2019. +[62] Lin Yen-Chen, Andy Zeng, Shuran Song, Phillip Isola, and Tsung-Yi Lin. Learning to See Before Learning to Act: Visual Pre-Training for Manipulation. In ICRA, 2020. +[63] Amir Roshan Zamir, Afshin Dehghan, and Mubarak Shah. GMCP-Tracker: Global Multi-Object Tracking Using Generalized Minimum Clique Graphs. In ECCV, 2012. +[64] Dong Zhang, Omar Javed, and Mubarak Shah. Video Object Segmentation through Spatially Accurate and Temporally Dense Extraction of Primary Object Regions. In CVPR, 2013. +[65] Yanzhao Zhou, Xin Wang, Jianbin Jiao, and Trevor Darell. Learning Saliency Propagation for Semi-Supervised Instance Segmentation. In CVPR, 2020. \ No newline at end of file diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/images.zip b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0ea6288f9d72016bf15dea2f46bb4d047c7b6e51 --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f5ea391bd25f82a73b4015758edba6935062f4c3dfc8f4cc4aa042f478cd508 +size 517803 diff --git a/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/layout.json b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..784ece23b212768af61275bc7aaf8b84e93b4fe5 --- /dev/null +++ b/learningtobettersegmentobjectsfromunseenclasseswithunlabeledvideos/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f383e6483a2157344f13632186fcb20bf534b3ba0488924b6a975bd8242f678 +size 430153 diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_content_list.json b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..96df8d38f71cc0623d43ef006e598b0715e04fb6 --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf23e6ed4e6892fd99d621d6767670df095dbaa99ebf3a2b16b13820a593839 +size 71163 diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_model.json b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e3cdbd83e0b13913c4f1b06fed00409d3821e3d9 --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:261967e01fa949ecb6c9f37abc010871ab0cc9ff2ec0eb6758c70571a68a3d68 +size 87612 diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_origin.pdf b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..376a4488787cb553d9c8b7030ef35d85523c1979 --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/c32047ea-e98b-4a3f-89bc-c51255699217_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21b981c18c6e6aa8c4df18c8becdf7fc839a18fb0f55f448b7d5b4c4f6ef3a59 +size 956853 diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/full.md b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0195833358fe8d83a00a32d1deb7f52fe2d6db28 --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/full.md @@ -0,0 +1,346 @@ +# Learning to Bundle-adjust: A Graph Network Approach to Faster Optimization of Bundle Adjustment for Vehicular SLAM + +Tetsuya Tanaka* + +Socionext Inc. + +tanaka.tetsuya@socienext.com + +Yukihiro Sasagawa* + +Socionext Inc. + +sasagawa.yukihiro@socionext.com + +Takayuki Okatani + +Graduate School of Information Sciences, Tohoku University / RIKEN Center for AIP + +okatani@vision.is.tohoku.ac.jp + +# Abstract + +Bundle adjustment (BA) occupies a large portion of the execution time of SfM and visual SLAM. Local BA over the latest several keyframes plays a crucial role in visual SLAM. Its execution time should be sufficiently short for robust tracking; this is especially critical for embedded systems with a limited computational resource. This study proposes a learning-based bundle adjuster using a graph network. It works faster and can be used instead of conventional optimization-based BA. The graph network operates on a graph consisting of the nodes of keyframes and landmarks and the edges representing the landmarks' visibility. The graph network receives the parameters' initial values as inputs and predicts their updates to the optimal values. It internally uses an intermediate representation of inputs which we design inspired by the normal equation of the Levenberg-Marquardt method. It is trained using the sum of reprojection errors as a loss function. The experiments show that the proposed method outputs parameter estimates with slightly inferior accuracy in 1/60-1/10 of time compared with the conventional BA. + +# 1. Introduction + +Structure-from-Motion (SfM) and visual SLAM (simultaneous localization and mapping) have been successfully used in many real-world applications of computer vision, robotics, augmented reality, and related areas [25, 29]. To improve the accuracy and robustness of 3D reconstruction, researchers have considered several different approaches, such as feature-point-based methods [27], direct methods [7], learning-based methods [24, 23], and their hybrids [3]. + +Among these, the feature-point-based methods are cur + +![](images/fd1d6bf5fcd45320cd0d8468d6b76a6cf3cd81108bb02120f2a18623c05bfd80.jpg) +(a) + +![](images/cfb06982c5c166d2780e461a8157ffaf4afcf2bef3593915e47dc544fd4ae25d.jpg) +(b) +Figure 1. Limiting the computational time budget for local BA results in frequent tracking failures. Left: Without a limit. Right: With a limit. See the text for details. + +rently the most widely used. Visual SLAM is often used in embedded systems with limited computational resources, narrowing choices to those using light-weight feature descriptors, such as ORB-SLAM [16, 17]. Many SfM systems also use feature-point-based methods; they are used to estimate camera poses for the subsequent step of multi-view stereo, in which the dense surfaces of objects/scenes are reconstructed. + +Although it is comparatively smaller, the feature-point-based methods still have a high computational cost. What dominates in their execution time is the step of bundle adjustment (BA). It optimizes the unknown parameters, the 3D positions of the landmarks associated with the feature points and camera poses, refining their initial values to get accurate estimates. This step is usually the bottleneck in terms of the speed of visual SLAM and SfM systems. Taking ORB-SLAM, for instance, it frequently performs BA locally over several keyframes and their associated landmarks, maintaining the accuracy of the most recent reconstruction. BA occupies roughly $60 - 80\%$ of the execution time needed for the mapping operation. + +More importantly, the speed of local BA determines + +the robustness of SLAM systems. Keyframe-based SLAM systems such as ORB-SLAM can track landmarks more stably when there are spatially denser keyframes. ORBSLAM employs the strategy of issuing more than sufficient keyframes and culling unnecessary ones later. However, a new keyframe cannot be created while local BA is running due to the causality. Thus, the ability to complete local BA quickly is necessary for issuing keyframes densely, and it is a basis for robust SLAM. This requirement is more critical for embedded systems having low-speed processors. A remedy is to set a limit on the computational budget for local BA to balance the accuracy of SLAM and the robustness of tracking. For example, we can set the maximum iteration counts for local BA. However, this does not work well in practice, as shown in Figure 1. + +In this paper, we consider a learning-based method that can perform BA more quickly. BA is essentially nonlinear minimization of the sum of squares, and conventionally the Levenberg-Marquardt method is employed. The method iteratively solves a linear equation to obtain a small parameter update and updates the parameters until convergence. When regarding the entire process as a black-box, which receives initial parameter values and outputs their optimal values, we replace it with computation by a graph network [30, 28]. To be specific, we train the graph network with a set of input-output pairs for some videos, i.e., the initial values fed to BA and their optimized values, aiming at computing the optimal parameter values in a shorter time. + +We report the results of our experiments focusing on monocular SLAM, in which we used OpenVSLAM [22] as a testbed and evaluate the method on the KITTI dataset [8]. In the experiments, we trained our graph network on a few sequences from the dataset and tested it on the other sequences. We create training samples by the conventional BA's inputs (i.e., g2o [13]) applied to the training sequences. Using them, we train the graph network using the sum of reprojection errors as a loss. Our method achieved slightly lower accuracy with 1/60-1/10 of computational time compared with the original BA. + +# 2. Related Work + +# 2.1. Speeding up Bundle Adjustment + +BA is the core element of SfM and visual SLAM. It computes camera poses and landmark positions that minimize the sum of reprojection errors, for which the Levenberg-Marquardt method is typically used. Its general algorithm starts with initial values and iteratively updates the parameters until convergence, where the updates are computed by solving the normal equation having the size of the parameters. In the case of BA, the equation's matrix has a particular block structure because there is no direct interaction between camera poses and landmarks. This procedure makes + +it possible to convert the normal equation into a reduced camera system (RCS), which is smaller and can be solved more efficiently [15, 10] + +Several algorithms exist for solving the RCS, and the fastest one differs depending on the problem size. With the growing size of SfM, it has been examined how to solve a large-scale problem efficiently, leading to inexact solvers based on the conjugate gradient (CG) method [1]. For small to mid-size problems (i.e., a few hundred images according to [1]), exact solvers are superior, which use dense or sparse Cholesky decomposition. In parallel to these, researchers have also studied the implementation of the algorithms that best utilize CPU, and GPU parallelism [12, 26]. + +Another approach uses the belief propagation (BP) algorithm, mainly loopy BP such as Gaussian BP, on the factor graph consisting of camera poses and landmarks, aiming at estimating the marginal distribution of each parameter [19, 6]. When implemented in CPU or GPU, it fails to yield comparable performance to the above methods. Recently, however, it has been shown [18] that a graph processor (i.e., Graphcore's Intelligence Processing Unit) can run Gaussian BP to perform BA at a competitive speed. + +Our method is a learning-based method that uses a graph network, which is orthogonal to any of the above methods, although there is some similarity to each. The method iteratively updates the parameters from given initial values, as with the LM method. However, it does not solve the normal equation; it directly predicts the updates from several inputs (i.e., the latest parameters and a few derived terms) whose design is inspired by the Levenberg-Marquardt updates. This point is the major factor of the speed-up from the standard BA. The graph network is built upon the factor graph used in the BP-based BA. + +# 2.2. Learning to Simulate Complex Dynamics by Graph Networks + +Graph networks (GNs) [5] are a type of graph neural networks [21]. Receiving a graph as input, a GN outputs a graph of the same shape but with different attribute values at their nodes and edges. During the propagation from the input to the output, information is exchanged between its nodes and edges in the form of message-passing. By training a GN using pairs of the input and the output, it can represent various phenomena emerging from interactions between multiple entities, where how to pass messages is adjusted. + +This approach has been proven to be effective for learning complex forward dynamics, such as rigid body collision [4], particle-based simulation of complex physics [20], robotic control [14], to name a few, as well as the behavior of non-physical systems. + +The idea of using machine learning models to perform complex physics simulations is not new [9]. It learns to rep + +resent the state transition between two time-points using observations as training data. It aims to avoid difficulties with traditional simulation based on physical models, such as the computational complexity or physical models' inaccuracy. However, making a universal ML model learn mapping with large degrees of freedom in high-dimensional state space is not simple. The success of GNs is attributable to the just enough representation of the interaction between entities by a graph. + +We apply GNs to BA, where the input is the specified initial values for camera poses and landmarks, and the output is their optimized values. We use the factor graph consisting of camera poses and landmarks to construct a GN and tailor the inputs for the message passing, inspired by the Hessian used in the Levenberg-Marquardt method, enabling end-to-end learning. + +# 3. Proposed Method + +# 3.1. Learning to Bundle-adjust + +Given the initial values of camera poses and landmarks' 3D coordinates, BA computes their estimates that best reproduce the given observations, i.e., the image coordinates of the landmarks. Visual SLAM systems frequently conduct small-/mid-size BA internally, which usually uses the Levenberg-Marquardt method. It iteratively updates the estimates by solving a linear equation. Its computational complexity increases with the number of parameters; 5-15 updates are necessary until convergence. + +To complete this BA computation in a shorter time, we replace the Levenberg-Marquardt method with a learning-based method. Specifically, we train a model that receives the initial values of the camera poses and the landmarks and outputs their estimates. Such a model needs to fulfill the following requirements: + +- It can handle a variable number of inputs/outputs, i.e., $M$ camera poses and $N$ landmarks, where $M$ and $N$ differ at each time. The provided observations also differ. +- It can predict the parameters as accurately as possible, despite that there are large degrees of freedom in the mapping from the input to the output. + +To fulfill these requirements, we employ the graph network framework [5]. It uses a graph to make use of inductive bias of the problem at hand and performs inference on it; graphs are created adaptively depending on inputs. In this study, we use the popular graph representation with BA, i.e., a bipartite graph between two types of nodes, i.e., keyframes (i.e., camera poses) and landmarks, whose edges reflect the visibility of landmarks from keyframes. This graph handles all the possible interactions between + +![](images/098fbcc6bbdb5eeed15b8a9ca074fc1ee07a5e0412972e10707269644312697b.jpg) +(a) The standard BA based on the Levenberg-Marquardt method + +![](images/74cfaf67ec5c36dd3e44804a3ee8e374b461998309bf4aecef3ab794622e2e14.jpg) +(b) The learning-based BA with graph networks +Figure 2. Comparison of the standard BA based on the Levenberg-Marquardt method and the proposed learning-based method. + +keyframes and landmarks, making it possible to use the inductive bias in our problem. However, there remains a large degree of freedom in designing the components in the graph network. How should we choose a proper design? + +Our solution is to mimic the Levenberg-Marquardt method; see Figure 2. As it will not contribute to speed-up if we perform the exact computation, we consider bypassing a part of the Levenberg-Marquardt computation with a learnable model. Our preliminary tests have found that it works to train a model to predict the update of parameters from the block diagonal elements of the Hessian matrix and the gradient. + +Following the Levenberg-Marquardt method, we update the parameters multiple times, while the count of updates is fixed, not 'until convergence.' We design a graph-network (GN) block to update the parameters once and stack them to perform multiple counts of updates. We train the stack of GN blocks so that the final output will minimize reprojection errors. Thus, note that we do not attempt or expect to make each block predict a Levenberg-Marquardt update. + +# 3.2. Predicting Parameter Updates + +The updating equation of the Levenberg-Marquardt method is written as + +$$ +\left(\mathbf {H} + \lambda \mathbf {I}\right) \Delta \xi = \mathbf {g}, \tag {1} +$$ + +where $\mathbf{H}$ is the Hessian matrix; $\mathbf{g}$ is the gradient vector; and $\Delta \xi$ is the updates of the parameter $\xi$ . We use $h_{\alpha \alpha}^{xx} (\alpha = 1, \dots, N)$ and $\{h_{\kappa \kappa}^{\omega \omega}, h_{\kappa \kappa}^{\omega t}, h_{\kappa \kappa}^{t\omega}, h_{\kappa \kappa}^{tt}\} (\kappa = 1, \dots, M)$ to denote the diagonal blocks of $\mathbf{H}$ . Omitting the off-diagonal blocks and the gradient descent term $\lambda \mathbf{I}$ , we rewrite the left hand side of (1 as + +$$ +\left[ \begin{array}{c c c c c c c c} h _ {1 1} ^ {x x} & & & & & & & \\ & \ddots & & & & & & \\ & & h _ {N N} ^ {x x} & & & & & \\ & & & h _ {1 1} ^ {\omega \omega} & h _ {1 1} ^ {\omega t} & & & \\ & & & h _ {1 1} ^ {\omega t} & h _ {1 1} ^ {t t} & & & \\ & & & & \ddots & & \\ & & & & & h _ {M M} ^ {\omega \omega} & h _ {M M} ^ {\omega t} \\ & & & & & h _ {M M} ^ {t \omega} & h _ {M M} ^ {t t} \\ & & & & & \end{array} \right] \left[ \begin{array}{c} \Delta \mathbf {x} _ {1} \\ \vdots \\ \Delta \mathbf {x} _ {N} \\ \Delta \omega_ {1} \\ \Delta \mathbf {t} _ {1} \\ \vdots \\ \Delta \omega_ {M} \\ \Delta \mathbf {t} _ {M} \end{array} \right], +$$ + +where $\Delta \mathbf{x}_{\alpha}$ 's are the updates of the landmarks' 3D coordinates and $\{\Delta \omega_{\kappa}, \Delta \mathbf{t}_{\kappa}\}'$ s are those of the camera poses. + +The block $h_{\alpha \alpha}^{xx}$ and the associated component of $\mathbf{g}$ are as follows: + +$$ +h _ {\alpha \alpha} ^ {x x} = \sum_ {j = 1} ^ {M} I _ {\alpha j} \mathbf {R} _ {j} \mathbf {W} _ {\alpha j} \mathbf {W} _ {\alpha j} ^ {\top} \mathbf {R} _ {j} ^ {\top}, \tag {3a} +$$ + +$$ +g _ {\alpha} ^ {x} = 2 \sum_ {j = 1} ^ {M} I _ {\alpha j} \mathbf {R} _ {j} \mathbf {W} _ {\alpha j} \mathbf {e} _ {\alpha j}, \tag {3b} +$$ + +where $I_{\alpha j} \in \{0,1\}$ indicates the visibility of $\alpha$ -th landmark from $j$ -th camera pose; $\mathbf{R}_j$ is the rotation matrix of $j$ -th camera pose; $\mathbf{W}_{\alpha j}$ is a $3 \times 2$ matrix calculated from $\alpha$ -th landmark and $j$ -th camera pose; and $\mathbf{e}_{\alpha j}$ is the difference from the reprojected image point and its observation. + +The blocks $\bar{h}_{\kappa \kappa}^{\omega \omega}$ and $\bar{h}_{\kappa \kappa}^{\omega t}$ and the associated component of $\mathbf{g}$ are as follows: + +$$ +h _ {\kappa \kappa} ^ {\omega \omega} = \sum_ {i = 1} ^ {N} I _ {i \kappa} \left(\mathbf {x} _ {i} - \mathbf {t} _ {\kappa}\right) \times \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {W} _ {i \kappa} ^ {\top} \mathbf {R} _ {\kappa} ^ {\top} \left\{\left(\mathbf {x} _ {i} - \mathbf {t} _ {\kappa}\right) \times \mathbf {I} \right\}, \tag {4a} +$$ + +$$ +h _ {\kappa \kappa} ^ {\omega t} = \sum_ {i = 1} ^ {N} I _ {i \kappa} \left(\mathbf {x} _ {i} - \mathbf {t} _ {\kappa}\right) \times \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {W} _ {i \kappa} ^ {\top} \mathbf {R} _ {\kappa} ^ {\top}, \tag {4b} +$$ + +$$ +g _ {\kappa} ^ {\omega} = 2 \sum_ {i = 1} ^ {N} I _ {i \kappa} \left(\mathbf {x} _ {i} - \mathbf {t} _ {\kappa}\right) \times \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {e} _ {i \kappa}, \tag {4c} +$$ + +where $\mathbf{x}_i$ is $i$ -th landmark and $\mathbf{t}_{\kappa}$ is the translation vector of $\kappa$ -th camera pose. + +Similarly, the blocks $h_{\kappa \kappa}^{tw}$ and $h_{\kappa \kappa}^{tt}$ and the associated component of $\mathbf{g}$ are: + +$$ +h _ {\kappa \kappa} ^ {t \omega} = \sum_ {i = 1} ^ {N} I _ {i \kappa} \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {W} _ {i \kappa} ^ {\top} \mathbf {R} _ {\kappa} ^ {\top} \left\{\left(\mathbf {x} _ {i} - \mathbf {t} _ {\kappa}\right) \times \mathbf {I} \right\}, \tag {5a} +$$ + +$$ +h _ {\kappa \kappa} ^ {t t} = \sum_ {i = 1} ^ {N} I _ {i \kappa} \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {W} _ {i \kappa} ^ {\top} \mathbf {R} _ {\kappa} ^ {T}, \tag {5b} +$$ + +$$ +g _ {\kappa} ^ {t} = 2 \sum_ {i = 1} ^ {N} I _ {i \kappa} \mathbf {R} _ {\kappa} \mathbf {W} _ {i \kappa} \mathbf {e} _ {i \kappa}. \tag {5c} +$$ + +We use these block-diagonal components of $\mathbf{H}$ and the associated block components of $\mathbf{g}$ to predict the updates of landmarks and camera poses. To be specific, we use a predictor $\phi^{\mathrm{LM}}$ to predict the update of landmark as $\Delta \mathbf{x}_{\alpha} = \phi^{\mathrm{LM}}(h_{\alpha \alpha}^{xx}, g_{\alpha}^{x})$ . We use a predictor $\phi^{\mathrm{KF}}$ to predict the update of the rotation and translation components as $[\Delta \omega_{\kappa}^{\top}, \Delta \mathbf{t}_{\kappa}^{\top}]^{\top} = \phi^{\mathrm{KF}}(h_{\kappa \kappa}^{\omega \omega}, h_{\kappa \kappa}^{\omega t}, h_{\kappa \kappa}^{tw}, h_{\kappa \kappa}^{tt}, g_{\kappa}^{\omega}, g_{\kappa}^{t})$ . For each of these predictors, we employ a four-layer neural network; details will be given below. We train $\phi^{\mathrm{LM}}$ and $\phi^{\mathrm{KF}}$ to predict those updates so that $S$ iterations of the updates yield the optimal parameters minimizing the sum of the reprojection errors. + +# 3.3. Implementation with Graph Network + +We implement our learning-based BA using the graph network framework [5]. One may think that it receives a graph with initial parameter values and outputs the same graph but with optimal parameter values. As mentioned above, our graph is a common bipartite graph whose vertices are keyframes (i.e., camera poses) and landmarks; its edges connect these two types of vertices according to the visibility of the landmarks, as shown in Figure 3. + +We denote the $\kappa$ -th keyframe vertex by $V_{\kappa}^{\mathrm{KF}}$ and the $\alpha$ -th landmark vertex by $V_{\alpha}^{\mathrm{LM}}$ , respectively. We use $E_{\alpha \kappa}$ to denote the edge connecting $V_{\kappa}^{\mathrm{KF}}$ and $V_{\alpha}^{\mathrm{LM}}$ , if any. The vertices $V_{\kappa}^{\mathrm{KF}}$ and $V_{\alpha}^{\mathrm{LM}}$ retain the parameter values $(\mathbf{R}_{\kappa}, \mathbf{t}_{\kappa})$ and $\mathbf{x}_{\alpha}$ as their attributes, respectively. Each of them also retains a flag named un-fixed, using which we control which keyframe or landmark to lock to resolve the gauge freedom, as is commonly done in BA. The edge $E_{\alpha \kappa}$ retains normalized image coordinates of keypoints (i.e., the observation of a landmark) as its attribute. + +As is shown in Figure 2, the parameter values are updated by a series of $S$ GN blocks. We use an identical GN block, including learnable weights for all the blocks. Figure 3 shows the design of a single GN block. It receives the whole graph, i.e., the graph structure and the parameter values stored at the vertices. It consists of five components, i.e., the two vertex predictors $\phi^{\mathrm{KF}}$ and $\phi^{\mathrm{LM}}$ , which are explained above, two vertex aggregators $\rho^{\mathrm{KF}}$ and $\rho^{\mathrm{LM}}$ , and one edge predictor $\phi^{\mathrm{E}}$ . The latter three (i.e., $\rho^{\mathrm{KF}}, \rho^{\mathrm{LM}},$ and $\phi^{\mathrm{E}}$ ) do not have learnable weights; they exist to calculate the inputs to $\phi^{\mathrm{KF}}$ and $\phi^{\mathrm{LM}}$ according to the graph structure. They also enable backpropagation of gradients from the final output to the input through the stack of GN blocks. + +More specifically, $\phi^{\mathrm{E}}$ operates independently on each edge, as shown in Figure 4(a), receiving as inputs $(\mathbf{R}_{\kappa},\mathbf{t}_{\kappa})$ + +![](images/89f877b1de252ac2ceb54fa2d9336255a3178a9dfda812f77a8e94925259a7f9.jpg) +Figure 3. Overview of the GN block. + +![](images/20a3579ab3bcebfc9c19bf68d9d58b2af70aaf4d9c09b630bcdf29deb33dd5ad.jpg) +(a) Edge predictor + +![](images/edabe575ed566c37815a69be60552779f08568f46ce6ecad527349af67af5560.jpg) +(b) Vertex aggregator + +![](images/638a55d2415d364d61efb0fa5e9dca20060d127913e42c11609557bf86274a57.jpg) +Figure 4. The information flow of (a) the edge predictor $\phi^{\mathrm{E}}$ and (b) the vertex aggregators $\rho^{\mathrm{LM}}$ and $\rho^{\mathrm{KF}}$ . + +and $\mathbf{x}_{\alpha}$ from its connecting verteces and calculating the component terms shared in the right hand sides of (3), (4), and (5), i.e., $\mathbf{e}_{\alpha \kappa}, \mathbf{R}_{\kappa} \mathbf{W}_{\alpha \kappa}$ , and $(\mathbf{x}_{\alpha} - \mathbf{t}_{\kappa})$ , which are fed to $\rho^{\mathrm{LM}}$ and $\rho^{\mathrm{KF}}$ . + +As shown in Figure 4, the vertex aggregator $\rho^{\mathrm{LM}}$ operates independently on each landmark vertex to perform the summation over the connecting keyframe verteces $j = 1,\dots ,M$ , as in (3). Similarly, $\rho^{\mathrm{KF}}$ operates independently on each keyframe vertex to perform the summation over $i = 1,\ldots ,N$ as in (4) and (5). + +The outputs of these aggregators are fed to the two vertex predictors $\phi^{\mathrm{LM}}$ and $\phi^{\mathrm{KF}}$ , which predict the updates as $\Delta \mathbf{x}_{\alpha} = \phi^{\mathrm{LM}}(h_{\alpha \alpha}^{\mathrm{LM}}, g_{\alpha}^{\mathrm{LM}})$ and $[\Delta \omega_{\kappa}^{\top}, \Delta \mathbf{t}_{\kappa}^{\top}]^{\top} = \phi^{\mathrm{KF}}(h_{\kappa \kappa}^{\omega \omega}, h_{\kappa \kappa}^{\omega t}, h_{\kappa \kappa}^{t\omega}, h_{\kappa \kappa}^{tt}, g_{\kappa}^{\omega}, g_{\kappa}^{t})$ , respectively, as mentioned earlier. For each of these predictors, we employ a four-layer MLP (multi-layer perceptron); its details are shown in Table 1. It employs layer normalization [2] at the first layer and three linear layers followed by ReLU and one linear layer for the output. The numbers indicate the hidden units and the outputs in the MLP. Note that learnable + +Table 1. Design of the neural network used for the two vertex predictors. + +
PredictorHidden units / ActivationOutputs
φLM12/ReLU9/ReLU9/ReLU3
φKF42/ReLU18/ReLU18/ReLU6
+ +weights exist only in these predictors. Figure 5 shows a diagram illustrating more details of the GN block. + +# 3.4. Training the Graph Network + +We train the graph network as follows. Choosing a monocular image sequence, we first apply a conventional SLAM system to it and extract local BA runs; each run possesses a multi-view system consisting of several keyframes and landmarks observed from them, initial values of the parameters, and the observations (i.e., the landmarks image coordinates from the keyframes). + +We treat each BA run as an independent training sample. We construct a graph based on the structure of the multiview system, feed it along with initial parameter values to the graph network, obtaining their updated estimates; see Figure 6. As mentioned earlier, the graph network is a stack of $S$ GN blocks, and each block is identical, including the learnable weights in the two vertex predictors. As it predicts only parameter updates, we add them to the initial values to get the parameter estimates. We then calculate the loss for the estimate. + +For the loss, we use the sum of the reprojection errors used in the standard BA, i.e., the sum of the differences of the image coordinates of the landmarks computed by the estimates from their observations. Following ORB-SLAM, we employ the Huber loss to ensure robustness in the presence of erroneous point correspondences, which is given by + +$$ +L \left(e _ {x}, e _ {y}\right) = \rho \left(e _ {x}\right) + \rho \left(e _ {y}\right) \tag {6a} +$$ + +$$ +\rho (e) = \left\{ \begin{array}{l l} \frac {1}{2} e ^ {2} & \text {f o r} | e | \leq \delta , \\ \delta \left(| e | - \frac {1}{2} \delta\right) & \text {o t h e r w i s e}, \end{array} \right. \tag {6b} +$$ + +where $e_x$ and $e_y$ are the reprojection error in $x$ and $y$ directions in an image; we set $\delta$ to 2.0 as in ORB-SLAM. We compute the sum of loss values over multiple BA runs in a minibatch and use the Adam optimizer [11] to reduce the loss. + +# 4. Experimental Results + +We conduct experiments to test the proposed method. + +# 4.1. Experimental Configuration + +We evaluate the performance of the proposed method on the monocular video sequences from the KITTI dataset [8]. + +![](images/82f8e0ec8dea0710183d70148bb5324450a57e0c6c7b95353481d1a2f5e5a88e.jpg) +Figure 5. The internal structure of the GN block. + +![](images/5e3704cdc65d666e306dc46167595c4c5db7dd8e00f5b708f571cbd14182d681.jpg) +Figure 6. The information flow from the input to the output of the graph network at training time. + +It contains multiple independent sequences of a vehicle running on different urban streets. We select some sequences from them for training our graph network and test it on other sequences. + +We employ OpenVSLAM [22], an ORB-based visual SLAM using g2o [13], for BA [15] as a testbed. We replace the g2o::SparseOptimizer class (with related classes and functions in g2o performing BA) with our method, and evaluate and compare its performance with the original BA by g2o. To do this, we first run the visual SLAM with g2o on the selected sequence and extract all the runs of local BA. We use them for training our graph networks. + +In the experiments reported in Sec. 4.2, we create a test dataset in the same way as above from the other sequences + +and report the residual Huber loss of the final estimates. In the experiments of Sec. 4.3, we report the performance of a complete SLAM system in which the g2o BA is replaced with the proposed method. We run it on the KITTI sequences from the start to the end (or until tracking is lost) and evaluate its accuracy. + +We report the residual Huber loss below, which are obtained when the horizontal images size (i.e., 1,226 pixels) is normalized to 1.0. We use the Graph Nets library [5] for the implementation of the graph network. For the training with Adam optimizer, we set the initial learning rate to $1.0 \times 10^{-2}$ , and the learning rate decay = 0.99. + +![](images/29a2e094cc5f49b1a07a0378607aa6c58ef288f548cde798f87b3d6b04e03d55.jpg) +Figure 7. Residual Huber loss for different number of GN blocks. + +# 4.2. Performance as a Bundle-adjuster + +As mentioned above, we first evaluate the performance of the proposed method when applied to each of the BA runs extracted from the test sequences. We use here a KITTI sequence K05 for training and K06, K08, K10, K11, and K12 for test. We chose these sequences, since they contain relatively more frequent scene changes. The former has 850 BA runs and the latter has 3030 BA runs in total. + +# 4.2.1 GN Steps and Error Decrease + +As explained in Sec. 3.3, our method uses the graph network consisting of the $S$ -stack of GN blocks sharing the same parameters. Figure 7 shows the residual Huber loss for different $S$ 's. It decreases as $S$ increases, but increases at $S = 5$ . A similar phenomenon is reported in a previous study of applying graph networks to physics simulation [20]; a larger number of steps lead to worse results. We choose $S = 4$ from the result and use it in the experiments below. + +# 4.2.2 Performance on Individual BA Runs + +Figure 8 shows the residual Huber loss averaged over all the BA runs of each sequence for the proposed method and the original g2o BA. It can be seen that the proposed method decreases the loss for all the sequences, although it is modestly worse than the g2o BA. Note that there is a certain amount of gap between the test sequences. This evaluation validates the generalization ability of the proposed method. We obtained similar results for different combinations of sequences for training and test. + +# 4.2.3 Computational Time + +We also evaluated the computational time of our method. We measured the elapsed real-time from the start to the end of each BA run on a PC with an Intel Core i7-2600K CPU @ 3.40GHz. Figure 9 shows the histogram of the elapsed time for the proposed method and the g2o BA. The results show that our method takes only about 1/60–1/10 of the + +![](images/6271b9142241b9be36380f6414fb2579188747847d64f628fbc9c2bfbbf0b594.jpg) +Figure 8. The averaged (residual) Huber loss over the local BA runs of each sequence for the initial value, g2o, and the proposed method. + +![](images/9b3f91e91d56361ac4f03cd4aac6bad8b7fdbdc0bc48050598f552d7b43ac7cc.jpg) +Figure 9. Computational time (erapsed real time) needed for each BA run by the proposed method and the g2o BA. + +time needed by the g2o BA $(0.2\rightarrow 0.003\mathrm{sec})$ . Since the g2o BA needs 5-15 iterations for each run, restricting its iterations to 1/10 to save computational time is not realistic. As shown in Figure 1(b), even more mild constraint on the computational budget leads to frequent tracking failures. The proposed method runs five times faster (i.e., from 0.2 to 0.04sec in the histogram peak) than the g2o BA when it is incorporated in the full SLAM pipeline. + +# 4.3. Performance of Complete SLAM + +The performance on individual BA runs will not fully represent how well the entire SLAM system works. Thus, we test the SLAM system with the g2o BA replaced with the proposed method. This evaluation is important, since the proposed method shows slightly worse performance on individual BA runs than the original BA. The worse performance could lead to the accumulation of errors, or even tracking failures. + +We evaluate here the residual Huber loss of the landmarks that are tracked at each frame. If the proposed method fails to optimize the parameters, then the residual loss will increase as time goes. Figure 10 shows an example for a sequence K07, while the graph network is trained + +![](images/727e934455c28a80b6d644ff2275604c85b895646cae5733d017232c64f37935.jpg) + +![](images/34ad183c343fe71c3a562b86501af324c4be106f56dd17c59116dbbd4746b854.jpg) +(a) Keyframe 1 to 179 +(b) Keyframe 180 to 350 + +on K04, K05, and K06. It is seen that the residual Huber loss temporarily increases from frame 1 to 20. However, it decreases to a reasonable level after that (i.e., from frame 21 to 35), showing that the proposed method optimizes the parameters well. It is also seen that there occasionally emerges very large errors, e.g., at frames 37, 45, 80, 118, 137, 256, and 334; these are mostly caused by large appearance changes at these frames. Our method can handle these cases properly. Overall, the residual loss is controlled to be within a low range. + +Figure 11 shows the trajectory and the landmarks estimated by the SLAM systems with the original g2o BA and the proposed method. Figure 12 shows the absolute trajectory error measured using the ground truth vehicle trajectory. The RMSE for the system with the original g2o BA is $8.26\mathrm{m}$ and that for the proposed method is $11.90\mathrm{m}$ . Although the proposed method yields slightly worse trajectory accuracy, the result shows that the proposed method serves as a valid bundle adjuster. Checking its performance on various combinations of sequences for training and test, we confirm the robustness of the proposed method at the cost of slightly lower accuracy. + +# 5. Conclusion + +In this study, we have explored the possibility of replacing the standard Levenberg-Marquardt method for BA with a learning-based approach. To precisely model the structure of the multi-view systems dealt with in local BA, we design a graph network implementing the bipartite graph composed of the nodes of keyframes and landmarks and the edges corresponding to the landmarks' visibility. We train it to predict the geometric parameters. + +We design the graph network as a stack of multiple identical GN (graph network) blocks. For the design of the GN + +![](images/7bce526dba0702aade826814c3305f581a753296c80fb4eb7a343eb74ab00f1e.jpg) +(a) + +![](images/dcb21821e31b36cc5a24952919d957d0240d8c503625e4fda937e6fc512a90ea.jpg) +(b) + +![](images/c41f9f875537fe0564af0697125255a29ee1ffedc8ecfe2beee4be00fee023c8.jpg) +Figure 10. An example of how the (mean) residual Huber loss of the tracked landmarks varies within a sequence (KITTI K07). +Figure 11. Reconstructed trajectories and landmarks by (a) the conventional BA (g2o) and (b) the proposed method. +(a) +Figure 12. Errors of estimated trajectories of (a) the conventional BA (g2o) and (b) the proposed method. + +![](images/7776338856b75845c1ae0194885f85ddd5d646d0899f604215fe8bcbf8a8e6b8.jpg) +(b) + +block, we employ an approach inspired by the normal equation of the Levenberg-Marquardt method. We use its components (i.e., the block-diagonal elements of the Hessian and the gradients) as the 'intermediate representation' of inputs to predict the parameters. We design two vertex predictors, which predict keyframe and landmark parameters, and implement them as neural networks. We also design auxiliary components to compute the inputs to the predictors. We then train the whole graph network to predict the parameter updates that minimize the sum of reprojection errors. + +We have confirmed through experiments on the KITTI dataset that the proposed method works well as a bundle adjuster. It is slightly worse in the estimation of geometric parameters than the standard BA but works robustly. We will examine the performance of the proposed method in a more variety of training and test data in the future. There remains much room for improvements such as more optimal network structures and better design of intermediate representation of inputs fed to the predictors (i.e., neural networks). + +# Acknowledgement + +This work was partly supported by JSPS KAKENHI Grant Number 20H05952 and JP19H01110. + +# References + +[1] Sameer Agarwal, Noah Snavely, Steven M. Seitz, and Richard Szeliski. Bundle adjustment in the large. In Kostas Daniilidis, Petros Maragos, and Nikos Paragios, editors, + +Computer Vision - ECCV 2010, pages 29-42, Berlin, Heidelberg, 2010. Springer Berlin Heidelberg. +[2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +[3] Dan Barnes, Will Maddern, Geoffrey Pascoe, and Ingmar Posner. Driven to distraction: Self-supervised distractor learning for robust monocular visual odometry in urban environments. CoRR, abs/1711.06623, 2017. +[4] Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, and Koray kavukcuoglu. Interaction networks for learning about objects, relations and physics. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, page 45094517, Red Hook, NY, USA, 2016. Curran Associates Inc. +[5] Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulcehre, Francis Song, Andrew Ballard, Justin Gilmer, George Dahl, Ashish Vaswani, Kelsey Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. https://github.com/deepmind/graph_nets.git, 2018. +[6] D. Crandall, A. Owens, N. Snavely, and D. Huttenlocher. Discrete-continuous optimization for large-scale structure from motion. In CVPR 2011, pages 3001-3008, 2011. +[7] Jakob Engel, Thomas Schöps, and Daniel Cremers. Lsdslam: Large-scale direct monocular slam. In David Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars, editors, Computer Vision - ECCV 2014, pages 834-849, Cham, 2014. Springer International Publishing. +[8] A. Geiger, P. Lenz, and R. Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 3354-3361, 2012. +[9] Radek Grzeszczuk, Demetri Terzopoulos, and Geoffrey Hinton. Neuroanimator: Fast neural network emulation and control of physics-based models. In Proceedings of the 25th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH '98, page 920, New York, NY, USA, 1998. Association for Computing Machinery. +[10] Y. Jeong, D. Nister, D. Steedly, R. Szeliski, and I. Kweon. Pushing the envelope of modern methods for bundle adjustment. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(8):1605-1617, 2012. +[11] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2017. +[12] Kurt Konolige. Sparse sparse bundle adjustment. In Proceedings of the British Machine Vision Conference, pages 102.1-102.11. BMVA Press, 2010. doi:10.5244/C.24.102. +[13] R. Kmmerle, G. Grisetti, H. Strasdat, K. Konolige, and W. Burgard. G2o: A general framework for graph optimization. In 2011 IEEE International Conference on Robotics and Automation, pages 3607-3613, 2011. + +[14] Y. Li, J. Wu, J. Zhu, J. B. Tenenbaum, A. Torralba, and R. Tedrake. Propagation networks for model-based control under partial observation. In 2019 International Conference on Robotics and Automation (ICRA), pages 1205-1211, 2019. +[15] Manolis I. A. Lourakis and Antonis A. Argyros. Sba: A software package for generic sparse bundle adjustment. ACM Trans. Math. Softw., 36(1), Mar. 2009. +[16] R. Mur-Artal, J. M. M. Montiel, and J. D. Tards. Orb-slam: A versatile and accurate monocular slam system. IEEE Transactions on Robotics, 31(5):1147-1163, 2015. +[17] R. Mur-Artal and J. D. Tards. Orb-slam2: An open-source slam system for monocular, stereo, and rgb-d cameras. IEEE Transactions on Robotics, 33(5):1255-1262, 2017. +[18] J. Ortiz, M. Pupilli, S. Leutenegger, and A. J. Davison. Bundle adjustment on a graph processor. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2413-2422, 2020. +[19] Ananth Ranganathan, Michael Kaess, and Frank Dellaert. Loopy sam. In Proceedings of the 20th International Joint Conference on Artificial Intelligence, IJCAI'07, page 21912196, San Francisco, CA, USA, 2007. Morgan Kaufmann Publishers Inc. +[20] Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter W. Battaglia. Learning to simulate complex physics with graph networks, 2020. +[21] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61-80, 2009. +[22] Shinya Sumikura, Mikiya Shibuya, and Ken Sakurada. Openvslam. Proceedings of the 27th ACM International Conference on Multimedia, Oct 2019. +[23] K. Tateno, F. Tombari, I. Laina, and N. Navab. Cnn-slam: Real-time dense monocular slam with learned depth prediction. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6565-6574, 2017. +[24] Sen Wang, Ronald Clark, Hongkai Wen, and Niki Trigoni. Deepvo: Towards end-to-end visual odometry with deep recurrent convolutional neural networks. CoRR, abs/1709.08429, 2017. +[25] Ying-mei Wei, Lai Kang, Bing Yang, and Ling-da Wu. Applications of structure from motion: a survey. Journal of Zhejiang University SCIENCE C, 14(7):486-494, Jul 2013. +[26] C. Wu, S. Agarwal, B. Curless, and S. M. Seitz. Multicore bundle adjustment. In CVPR 2011, pages 3057-3064, 2011. +[27] E. Wu, L. Zhao, Y. Guo, W. Zhou, and Q. Wang. Monocular vision slam based on key feature points selection. In The 2010 IEEE International Conference on Information and Automation, pages 1741-1745, 2010. +[28] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. CoRR, abs/1901.00596, 2019. +[29] Khalid Yousif, Alireza Bab-Hadiashar, and Reza Hosein- nezhad. An overview to visual odometry and visual slam: Applications to mobile robotics. Intelligent Industrial Systems, 1(4):289-311, Dec 2015. +[30] Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, and Maosong Sun. Graph neural networks: A + +review of methods and applications. CoRR, abs/1812.08434, 2018. \ No newline at end of file diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/images.zip b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d17e4b90271c910c268de62415a4df224396b9da --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f1fc341b9989b0a56b72964ae60b56420dee6419bde23b139a3251da07fff15 +size 485316 diff --git a/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/layout.json b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..80057f4bf7d0062e15bb619019ee18a0d7cb0a8f --- /dev/null +++ b/learningtobundleadjustagraphnetworkapproachtofasteroptimizationofbundleadjustmentforvehicularslam/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08ab894479907efe41dd6bbd3f048648ba7a140db6f4ad2f27b506b65072c1aa +size 391343 diff --git a/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_content_list.json b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6bf42e2408414a0a9fee459c868a8ea5117b9547 --- /dev/null +++ b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33486e8179bb4f2f3ff8f149234b729a5b6ad9b5340a3c9f7e6aa94f11fe66ab +size 79289 diff --git a/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_model.json b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f487dcb805afe6286dfa2b08e89a2d0de522f81c --- /dev/null +++ b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8a8f28f9dec7928ffd97da4f8504b559d3dffb0c5b47ebdbcb4e45b4399b597 +size 101932 diff --git a/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_origin.pdf b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..33b2b69367e246d31f30cc0dc9bb098d2e464ff5 --- /dev/null +++ b/learningtocutbywatchingmovies/ec717a03-ea60-4f68-adf4-195f43a5967a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fce403d4e74b6cf2942fb46989b587428a7d5e562a6d3422e9674b481a6cd849 +size 5716966 diff --git a/learningtocutbywatchingmovies/full.md b/learningtocutbywatchingmovies/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5032e17fe72a0fea7663d20475c3f6b979ffbd95 --- /dev/null +++ b/learningtocutbywatchingmovies/full.md @@ -0,0 +1,287 @@ +# Learning to Cut by Watching Movies + +Alejandro Pardo $^{1}$ Fabian Caba Heilbron $^{2}$ Juan León Alcazar $^{1}$ Ali Thabet $^{1}$ Bernard Ghanem $^{1}$ $^{1}$ King Abdullah University of Science and Technology (KAUST) $^{2}$ Adobe Research + +{alejandro.pardo,human.alwassel,ali.thabet,bernard.ghanem}@kaust.edu.sa caba@adobe.com https://alejandrodropardo.net/publication/learning-to-cut/ + +# Abstract + +Video content creation keeps growing at an incredible pace; yet, creating engaging stories remains challenging and requires non-trivial video editing expertise. Many video editing components are astonishingly hard to automate primarily due to the lack of raw video materials. This paper focuses on a new task for computational video editing, namely the task of raking cut plausibility. Our key idea is to leverage content that has already been edited to learn fine-grained audiovisual patterns that trigger cuts. To do this, we first collected a data source of more than $10K$ videos, from which we extract more than $255K$ cuts. We devise a model that learns to discriminate between real and artificial cuts via contrastive learning. We set up a new task and a set of baselines to benchmark video cut generation. We observe that our proposed model outperforms the baselines by large margins. To demonstrate our model in real-world applications, we conduct human studies in a collection of unedited videos. The results show that our model does a better job at cutting than random and alternative baselines. + +# 1. Introduction + +The lack of video editing expertise is a common blocker for aspiring video creators. It takes many training hours and extensive manual work to edit videos that convey engaging stories. Arguably, the most time-consuming and critical task in video editing is to compose the right cuts, i.e., decide how (and when) to join two untrimmed videos to create a single clip that respects continuity editing [58]. To the untrained eye, cutting might seem easy; however, experienced editors spend hours selecting the best frames for cutting and joining clips. In light of this complexity, it is pertinent to ask: could artificial systems rank video cuts by how plausible they are? + +Before delving into addressing the question above, it is worth defining the task of video cut ranking in detail. As Figure 1 illustrates, given two untrimmed input videos, the goal is to find the best moments (in each video) to trigger cuts, which join the pair into a single continuous sequence. + +![](images/0241c2483b529f5112e71a7c8480b86d98ea1b592234d837fbba6b4faf95dc13.jpg) +Figure 1: Ranking Cut Plausibility. We illustrate the process of ranking video cuts. The first row shows a pair of untrimmed videos (raw footage) as the input. The output would be the ranking of all the possible cuts across the pair of shots. Ideally, the top ranked cuts should be the more plausible cuts providing a smooth transition between the shots, and the worst cuts would be places in where there is break of spatial-temporal continuity. + +A key challenge is to generate videos that make the audience believe actions unfold continuously. This type of cutting is often called continuity editing and aims to evoke an illusion of reality [7, 58], even though, the source videos could be recorded at different times. Figure 1 shows a typical trigger for cuts – the moment when the speaker changes. In practice, the director could give the shot order via a storyboard or script, and it is the editor's job to realize which patterns make smooth transitions between shots. Our hypothesis is that many of those cut-trigger patterns can be found by carefully analyzing of audio-visual cues. + +Despite its importance, potential impact, and research + +challenges, the computer vision community has overlooked the video cut ranking problem. While there has been significant progress in shot boundary detection [52], video scene segmentation [57], video summarization [48], and videostory understanding [9, 33], few to no works have focused on pushing the envelope of computational video editing. + +The most relevant works at addressing video cut ranking and generation are found in the graphics and HCI communities [10, 19, 41, 65, 69]. These attempts take on a different perspective and focus on human-computer experiences for faster video editing. Yet, they still demand extensive work from an editor in the loop. We hypothesize that the cut ranking task has been neglected due to the lack of data, i.e., raw footage, and its corresponding cuts done by an editor. + +In this paper, we introduce the first learning-based method to rank the plausibility of video cuts. It is important to note that we do not have access to the raw footage for each shot since it is difficult, i.e., requires expertise and extensive manual work, to gather a dataset of raw videos with the corresponding edits and cuts. Therefore, Our key idea is to leverage edited video content to learn the audio-visual patterns that commonly trigger cuts. + +While this data is not the same as the real-world input for generating and ranking cuts, we can still model the audiovisual data before and after the cut, thus modeling what good cuts look like. Additionally, this type of data can be found abundantly, which enables the development of data-driven models. Our results show that a model learned to solve this proxy task can be leveraged to practical use cases. + +Our approach begins with a pair of consecutive shots that form a cut (similar to the bottom row in Figure 1). We look for a representation that discriminates between the good cuts (actual cuts found on edited video) against all alternative options (random alignments). To achieve this goal, we first collect a large-scale set of professionally edited movies, from which we extract shot boundaries to create more than $260\mathrm{K}$ cuts and shot pairs. Using this new dataset, we train an audio-visual model, Learning-to-Cut, which learns to rank cuts via contrastive learning. Our experimental results show that, while challenging, it is possible to build data-driven models to rank the plausibility of video cuts, improving upon random chance and other standard audio-visual baselines. + +Contributions. To the best of our knowledge, we are the first to address video cut ranking from a learning-based perspective. To this end, our work brings two contributions. + +(1) We propose Learning-to-Cut, an audio-visual approach based on contrastive learning. Our method learns cross-shot patterns that trigger cuts in edited videos (Section 3). +(2) We introduce a benchmark and performance metrics for video cut ranking, where we show the effectiveness of Learning to Cut. Moreover, we showcase that expert editors more likely prefer the cuts generated by our method as compared to cuts randomly ranked and other baselines (Section 4). + +# 2. Related Work + +Computational Video Editing. Earlier research in computational video editing focuses on designing new experiences that speed up the video creation process [10, 19, 41, 65, 69]. For instance, Leake et al. propose a system for the automatic editing of dialogue-driven scenes [41]. This system takes as input raw footage, including multiple takes of the same scene, and transcribed dialogue, to create a sequence that satisfies a user-specified film idiom [7]. Although this method offers a modern video editing experience, it still relies on a rule-based mechanism to generate the cuts. Another line of work focuses on designing transcript-based video editing systems. To cite an example, QuickCut [65] and Write-A-Video [69] develop user interfaces that allow aspiring editors to create video montages using text narrations as input. Although significant progress has been made to create better video editing experiences, it is still an open question of whether learning-based approaches can advance computational video editing. Our work provides a step towards that direction by introducing a benchmark for ranking the plausibility of video cuts and an audio-visual method that learns how to approximate them, without fixed rules and trained from an unconstrained set of professionally edited videos. + +Long-term video analysis. Many efforts have been made to develop deep learning models that analyze and understand long-term information [25, 72] and model relationships in long video formats [9, 24, 33]. Recently, Bain et al. [9] collected a dataset that contains movie scenes along with their captions, characters, subtitles, and face-tracks. Similarly, Huang et al. [33] created a dataset that comprises complete movies along with their trailers, pictures, synopses, transcripts, subtitles, and general metadata. Based on these datasets, the research community has developed solutions for new movie-related tasks, such as: shot-type classification [56], movie-scene segmentation [57], character re-identification and recognition [11, 32, 35, 70], trailer and synopsis analysis [34, 71], and visual-question answering in movies [21, 36]. Unlike previous works in long-term video analysis, our work centers around the video creation process. Another line of work worth a bit more closer to ours is video summarization [22, 49, 60]. These approaches are typically given one long video stream and their task is to select and shorten shots while keeping the semantic meaning of the composed video. Although video summarization techniques compose shot sequences, they tend to disregard critical aspects of video editing such as maintaining spatial-temporal continuity across shots. To the best of our knowledge, our work is the first benchmark studying the plausibility of cuts. As there are limited previous works aligning with our task, we define a set of initial baselines, and a novel approach for evaluating the ranking quality of video cuts. + +Cross-Modal Representations. The joint exploration of multiple modalities is a hot topic in the research commu + +nity. Several works have explored self-supervised learning to learn semantic embeddings using cross-modality supervision by using text, audio, and visual streams [2, 4, 6, 8, 38, 40, 46, 50, 51, 53, 63]. Moreover, recent works have used already pre-trained embeddings from different modalities on video retrieval tasks [5, 17, 20, 42, 43, 45, 73], active speaker detection [3, 15, 16], and sign spotting [47]. Our method adopts multimodal streams and backbones to model audio-visual signals and learn the patterns that commonly trigger a cut. + +Contrastive Losses for Video. Rapid progress has been attained in video understanding research by leveraging contrastive losses [26,46]. The InfoNCE loss [26], particularly, has gained tremendous popularity with the advent of self supervised learning [2, 23, 28, 29, 54, 55, 66, 67]. The idea behind this loss is simple; given a query representation, its goal is to maximize the similarity with a corresponding positive sample, but minimize the similarity concerning a bag of negatives. In the video domain, the InfoNCE loss and its variants (e.g., MIL-NCE [46]) have been used for learning: general video representations [23, 55, 66], joint text-video embeddings [2, 46], or audio-visual models [1, 2, 54]. Following the widespread adoption in the video community, our work leverage the InfoNCE loss [26] to learn a representation that encodes how good video cuts look (and sound) compared to all the other cut alternative for a pair of shots. + +# 3. Learning to Cut + +# 3.1. Leveraging Edited Video + +As a reminder, a shot is a continuous take from the same camera, and a cut occurs between a pair of shots (section 1). We introduce a data source devised for the task of learning suitable video cuts from professionally edited movies. The primary purpose of this data collection is to leverage already edited content for learning fine-grained audio-visual patterns that trigger cuts in the video editing process. It is composed of 10707 movie scenes along with 257064 cuts. This dataset includes several streams of data for every shot, including visual, audio, and transcripts. Around $32\%$ of shots in the dataset include speech; the remaining shots without speech come mainly from action-driven scenes. In the supplementary material we provide additional statistics. + +Gathering edited video. Movies are a great source of video data containing creatively edited video. Following Bain et al. [9], we downloaded 10.707 videos from MovieClips1. Each of these videos correspond to a single movie scene (a section of the movie occurring in a single location with a continuous and condensed plot). Then, we automatically detected shot boundaries using [27]. To assess the quality of the detections, we verified 5.000 of them and found an error rate of $4,34\%$ (217 errors). Typical errors include shots with heavy visual effects, and partial dissolves. + +![](images/cadef12736d01b9729b1ea0bca8ac8b71f6f5d6a64a42cd73c1606761c38f94d.jpg) +(a) + +![](images/66f755785231c348e5e7fee859d4b7a5f8ae016301944e17f705cd486e5e1751.jpg) +(b) + +![](images/b49a16c9452732b10e27135ee23f2e2b9bfd892c2461953fa973e7b2bc81c16c.jpg) +(c) + +![](images/7e1ef74749536e8eed083b02d030163835d3294d4d0c72d693090142122bd4be.jpg) +(d) +Figure 2: Examples of the retrieved content. Figure 2a shows a cut driven by the visual action of entering through a door. Figure 2b shows a cut driven by the matching audio between two sounds. Figure 2c shows a cut driven by a conversation an its audio-visual signal. Finally, 2d shows a visual-reaction cut that is driven by an audio-visual action. + +We find that each scene contains 114 shots on average. Thus, an editor has to make more than a hundred cuts for every scene in a movie. Such a level of involvement further shows the complexity and time-consuming nature of the editing process. An appealing property of the chosen video source, MovieClips, is that it has weekly uploads of famous movie scenes, along with their metadata. Since our shot annotations are automatically generated, we can easily augment the dataset in the future. + +Data source samples. Figure 2 shows examples from the collected data. As specified before, the cut can be driven by visual, audio, and audio-visual cues. In Figure 2a, the visual action of entering the door triggers the cut, while the audio stream does it in Figure 2b. In the latter, the editor matched two similar sounds from two different space-time locations; this example shows a visually discontinuous cut, where the audio matches perfectly between the two shots. The last two examples are cuts driven by audio-visual cues. + +On one hand, Figure 2c is triggered by the nature of a + +fluid conversation – we can appreciate that the cut happens after the active speaker changes. On the other hand, the cut in Figure 2d is driven by an action observed in both streams – the scene shows a person's reaction to an audio-visual action. Note that these are just some of the triggers for cuts, and many others exist, making it hard to list and model each of them independently. Therefore, our next goal is to leverage this data to learn cut triggers in a data-driven fashion. + +Dataset. We use edited movies to learn the proxy task of cutting already edited videos. To do so, we split our dataset into train and validation sets. Since our task requires both positive and negative examples per pair of shots, we ignore shots shorter than one second for both sets. We use the frame-cut info to remove all the snippets that contain shot transitions within them to avoid the degenerate shortcut of learning how to detect shots. After these two filters, the training set consists of 7.494 scenes with 177.987 shots, and the validation set consists of 3.213 scenes with 79.077 shots. + +# 3.2. Proxy task + +We propose a proxy task closely related to the actual editing process of cutting (and merging) two shots. We define a snippet as a short time range within a shot. A snippet is fully contained within a shot and hence is much shorter. Our proxy task consists of learning which pair of snippets (from a set composed of all clips from consecutive shots) is the best to stitch together. Since we know that the editing process is mainly done in sequential order (stitching the left shot to the right shot), we can try to solve a local (two- neighboring-shots) proxy task by recurrently asking the following question: which snippets in both of the shot videos are the best to stitch together?. The best place to cut in each of the two shots are these two retrieved snippets. + +Our proxy task resembles the actual editing process, where the editor needs to pick a place to cut based on what they want to show in the next shot. However, it is not exactly the same, since we do not have the part of the shots that are cut out during the editing process. Obtaining such data is challenging as it requires video editing expertise to select the appropriate cuts, and at the same time, it is hard to find large-scale footage without edits. Although not all possible clips are available during training, we argue (and show with experiments) that our proxy task, paired with a vast number of edited videos, provide enough supervisory signals to learn the audio-visual cues and patterns that trigger the cuts. + +We can address the proxy task in several ways; however, there is one that best fits the task editors solve in continuity editing [58]: maximize the smoothness of the transition or minimize the discontinuity in the semantics of the scene across a cut. Furthermore, given the task's artistic nature, there is not necessarily a single correct answer. There might be more than one place in the videos where a cut can be placed and several pairs that would make semantic sense. + +Considering the previous observations, we decide to model this task as a ranking problem. We also build a small temporal window near the actual shot boundaries, and consider all clips within this window as appropriate cutting points. As a result we don't aim at retrieving only the clips at the very end/beginning of adjacent shots, but we also consider as valid some highly similar clips with significant temporal overlap. We approach this task by using Contrastive Learning. In fact, we aim to find a space, where the representations of clip pairs that belong together are close to each other and far from all others. + +Technical description. Given a ground-truth cut formed by a pair of shots $(S_L, S_R)$ , we aim to find the best pair of snippets to stitch together. We define $S_L$ as the set $\{a_i | i \in \mathbb{N}, 0 \leq i \leq t_L\}$ , and $S_R$ as $\{b_j | j \in \mathbb{N}, 0 \leq j \leq t_R\}$ , with $t_L$ and $t_R$ being the number of snippets contained in the shots, respectively. Our proxy task consists of ranking the set of all pairs of snippets $\{(a_i, b_j) | i, j \in \mathbb{N}, 0 \leq i \leq t_L, 0 \leq j \leq t_R\}$ . We know that the pair that should appear on top of the ranking is the one formed by the temporally adjacent snippets $(a_{t_L}, b_0)$ . The rest of the pairs are negative samples that we want to avoid retrieving. + +Potential short cuts. One may think that this artificial task can be easily solved by any machine learning model by learning shortcuts and apparent biases, for instance, always ranking first the pair composed by the last clip of the left-hand-side shot and the first of the right-hand-side shot. Additionally, if we include the clip in which the actual shot transition occurs in our training data, we would end up learning a shot detector. We avoid these two degenerate cases by not including any information of the temporal position of a clip within the shot and also ignoring all the clips that contain the transition from one shot to another. + +# 3.3. Learning to Cut Model + +Our cut ranking model consists of three main modules: a Feature Extraction step, a Contrastive Learning module, and an Auxiliary Task module. We first extract audio-visual features from candidate snippets. Then, the Contrastive Learning Module refines these features such that pairs of clips forming good cuts yield higher similarity score than others. The last module consists of an auxiliary task that guides the model by predicting whether individual snippets are good places to cut or not. Our pipeline is illustrated in Figure 3. Below, we describe each module in detail. + +# 3.3.1 Feature Extraction + +This task is inherently multimodal, since editors use fine-grained visual and audio signals from the shots to determine the cuts. Hence, we use both audio and visual backbones. It has been shown that effective visual features for video analysis come from short-term spatio-temporal architec + +![](images/4f2029773958899822148950112b78fb9c029317075ba3edc443e6fb05f5f29f.jpg) +Figure 3: Learning to Cut Model. Our model takes as input the audio-visual streams of a pair of shots. It computes their snippet pair-wise similarity and backpropagates it using the NCE-loss. Finally, it predicts a score per snippet that indicates whether or not it is a good place to cut. In the figure the non-blurred frames represent positive pairs. The NCE-loss only positive sample is represented with red on the grid, which corresponds to the neighbour friends of the left and right shots. + +tures [12, 18, 37, 62, 64, 68]. Similarly, effective audio architectures represent each time instance with a temporal window of fixed size and its corresponding spectogram [13, 31, 61]. We extract features for each snippet of $T$ frames with temporal stride of $\Delta$ . We input each one of the shots $S_{\{LR\}}$ with $N_{\{LR\}}$ frames to extract $t_{\{LR\}} = \text{Floor} \left( \frac{N_{\{LR\}} - T}{\Delta} \right) + 1$ snippets, and extract shot-level features $F_{\{L,R\}}$ by concatenating each of its snippet-level feature maps of dimension $H$ . Formally $F_L = [\alpha_1; \dots; \alpha_{t_L}]$ and $F_R = [\beta_1; \dots; \beta_{t_R}]$ where $\alpha, \beta \in \mathbb{R}^{1 \times H}$ . + +# 3.3.2 Contrastive Learning Module + +This module consists of a Multi-Layer Perceptron (MLP) with $l_{1}$ layers interleaved with a ReLU activation. It receives the shot-level features $F_{\{LR\}}$ . Each layer reduces the size of the previous layer by $c$ , similar to the projection head used in [14]. It produces a feature $F_{\{LR\}}^{\prime}$ where each of its elements belongs to $\mathbb{R}^{1\times \frac{H}{c^m1}}$ . We compute each of the possible snippet pairs between $F_{L}^{\prime}$ and $F_{R}^{\prime}$ , and we produce the annotations as follows: the positive sample is the pair $(\alpha_{t_L},\beta_0)$ , while the negative samples are the set $N(\alpha ,\beta) = \{(\alpha_{i'},\beta_{j'})|i',j'\in \mathbb{N},0\leq i'\leq t_L - 1,1\leq j'\leq t_R\}$ . We + +aim at bringing the features into a different space, in which snippet pairs that are good to stitch together are close to each other and far from the rest. To enable this, we use a Noise-Contrastive-Estimation (NCE) loss [26] defined as: + +$$ +N C E (S) = - \log \left(\frac {e ^ {\alpha_ {t} ^ {\top} \beta_ {0}}}{e ^ {\alpha_ {t L} ^ {\top} \beta_ {0}} + \sum_ {N (\alpha , \beta)} e ^ {\alpha_ {i ^ {\prime}} ^ {\top} \beta_ {j ^ {\prime}}}}\right) \tag {1} +$$ + +This loss encourages that the positive pair (numerator) attains the highest correlation score among all pairs (denominator). We expect it to align well with the ranking task we are interested in. By maximizing the similarity between the two adjacent snippets from each pair of shots, we expect the model to learn smooth transitions between shots, thus mimicking what editors do in continuity editing [58]. + +# 3.3.3 Auxiliary Task Module + +It consists of an MLP with $l_{2}$ FC-layers to produce a single value per snippet, which is then passed through a sigmoid function. This module receives the feature map $F_{\{LR\}}'$ and produces a vector $v_{\{LR\}} \in \mathbb{R}^{(t_L + t_R) \times 1}$ , one score per snippet. The higher the score, the higher the probability $p_{y_i}$ for a snippet to be a good place to cut. Remember that our auxiliary task aims to answer whether or not each snippet is a good place to cut. We believe that this is a reasonable task to guide the learning process, since there are some pre-established rules in video editing that drive the cutting process [7, 10]. And so, we hypothesize that individual snippets can contain some information about these cues and can guide the model to cut more precisely. We propose to learn this auxiliary task by classifying each of the snippets as a good place to cut or not. In this case, the only positive snippet is $\alpha_{t_L}$ . We iterate over each snippet in $S_L$ to calculate the Binary Cross-Entropy (BCE) Loss per shot: + +$$ +B C E (S) = - \frac {1}{t} \sum_ {i} ^ {t} y _ {i} \log \left(p _ {y _ {i}}\right) + \left(1 - y _ {i}\right) \log \left(1 - p _ {y _ {i}}\right) \quad (2) +$$ + +Therefore, our model optimizes for both two tasks jointly and the losses are combined as follows: + +$$ +\operatorname {L o s s} (S) = \lambda_ {1} \cdot N C E (S) + \lambda_ {2} \cdot B C E (S) \tag {3} +$$ + +# 4. Experiments + +This section describes the experimental pipeline that we follow to validate our approach's effectiveness in learning to rank cuts. We detail our performance metrics, implementation details of our model, and introduce baseline approaches. Then, we then study our method's performance on + +our dataset 3.1 by comparing to the baselines and ablating each of its components. Finally, we use our model to rank cuts in an unedited set of video footage and assess the quality of the top ranked results via human studies. + +# 4.1. Experimental Setup + +Metrics. We aim to define metrics that measure the quality of automatically ranked video cuts. One desirable property of automatic cut generation method is the ability to rank the good cuts with higher confidence across a test subset. To capture this property, we measure Recall at $(\eta K)$ , $(R@\eta K)$ , where $\eta \in \{1,5,10\}$ is a value that controls the number of retrieved results and $K$ is fixed to the number of ground truth cuts in the entire inference set. In our experiments, $K \approx 80000$ , which corresponds to the number of shot pairs or cuts in the validation subset. To account for the ambiguity of cuts, we measure $R@(\eta K)$ using different temporal precision ranges when counting the true positive cuts. Our intuition is that cuts near the ground-truth might be equally good and still useful for many practical scenarios. Therefore, we introduce a distance to cut $d$ , which augments the number of positives with all clip pairs that are within $d$ seconds from the ground-truth cut. In practice, $d$ is the number of clips away from the ground truth cut. We report $R@(\eta K)$ for three distance values $d \in \{1,2,3\}$ . These metrics allow us to study the performance of methods under different use cases. For instance, if someone plans to evaluate performance for automatic retrieval, $R@1K$ would be the best fit; however, if there will be a human-in-the-loop, $R@10K$ seems a more appealing metric to optimize, as a human could select the best cut from a small list of candidates. Conversely, measuring performance at $d = 1$ and $d = 3$ resemble cases where an application requires high-precision (e.g. editing for professional film) and low-precision cuts (e.g. editing for social media), respectively. + +Implementation Details. We first extract frames for each scene video at 24 fps. In terms of backbones, we use ResNexT-101-3D [30] pre-trained on Kinetics [39] for the visual stream and ResNet-18 pre-trained on VGGSound [13] for the audio stream. We freeze each of them and extract features from each of the last convolutional layers after Global Average Pooling. We extract snippet features in a sliding window strategy with window size of $T = 16$ frames and stride of $\Delta = 8$ . The feature dimensions are 2048 for the visual backbone and 512 for the audio backbone. We concatenate these features into a 2560-dimensional feature vector. The final output is the feature map $F_{n} \in R^{t_{n} \times 2560}$ . We jointly train the contrastive learning module (CLM) and the auxiliary task module (ATM) with an initial learning rate of 0.003 using Adam optimizer. We use $l_{1} = 2$ layers with a reduction factor of $c = 2$ for the CLM, and $l_{2} = 1$ layers for the ATM. We reduce the learning rate by a factor of 0.9 if the validation loss does not decrease after an epoch. We choose + +$\lambda_{1} = 1$ and $\lambda_{2} = 0.2$ as trade off coefficients in Equation (3), such that both losses are of the same scale. While we train both tasks together, we perform inference through a two-stage prediction by first choosing the top $M = 30\%$ scoring snippets from the ATM and then having CLM rank these retrieved pairs. + +Baselines. Our main task is to rank each of the pairs according to their similarity score. Ideally, the pairs that first appear in the ranked list are the ones that are a better fit to form the cut, i.e. the right places to cut. Below, we define all the methods that will be compared on this task. + +Random Baseline: We assign a uniform random score for each pair of clips in the validation subset. + +Audio-visual baseline: Since the ranking is given by a similarity score, we can use the raw backbone features directly (i.e. without passing them through CLM and ATM) to measure their correlations as the ranking score. In our comparisons, we study three alternatives: (i) using only visual features (visual), (ii) using only audio features (audio), and (iii) concatenating audio-visual features (Audio-visual). + +Learning to Cut (Single-stage): We use the CLM scores for all the pairs to perform the ranking, i.e. ATM is not used here. We refer to this baseline as Ours (w/o multi-stage). + +Learning to Cut (Full): As explained earlier, we first use the individual clip scores from ATM to choose the top $M$ scoring clips, which are then ranked using CLM similarity scores. + +Inference time. At run time, features are pre-computed and cached and the feature similarity (cut ranking) runs on the fly. Extracting features takes about 6 seconds per minute of video (240 fps). Computing similarity can be done efficiently via dot product, which computation time is negligible compared to the forward pass. + +# 4.2. Ranking Results + +Comparison with baselines We compare our Learning to Cut method against the different baselines in Table 1. We report Recall $R@\alpha K$ with $\alpha \in \{1,5,10\}$ and under distances $d \in \{1,2,3\}$ clips (or $d \in \{0.33,0.67,1\}$ seconds) from the ground truth cut. We observe how challenging the task is by looking at the Random baseline performance. In the most strict setting ( $R@1K$ and $d = 1$ ), this method can only retrieve $0.6\%$ of the positive pairs. Even in the loosest setting ( $R@10K$ and $d = 3$ ), it only retrieves $\sim 34\%$ of the positive pairs. Since sharp visual changes often occur between shots in continual editing, the similarity score of cross-shot clips is very low [44], even at the ground truth cuts. Thus, the raw visual features perform poorly as well. + +When combining both raw audio-visual features, we observe a different trend. Even though the results are low, they are better than random chance. We attribute this performance discrepancy (visual vs. audio-visual raw features) to the fact that most audios are continuous across the given shot pairs; making the audio features to spot temporal disconti + +
Modeld=1d=2d=3
R@1KR@5KR@10KR@1KR@5KR@10KR@1KR@5KR@10K
Random0.603.256.561.699.4418.453.5517.6233.75
Visual Raw Features1.112.785.172.035.3510.262.747.4614.73
Audio-visual Raw Features1.176.3711.732.5113.1524.253.7319.3334.97
Learning to Cut (Single-stage)2.899.8216.155.3718.2430.017.1024.1840.21
Learning to Cut (Full)8.1824.4430.4015.3048.2659.5019.1864.3079.42
+ +Table 1: Comparison with baselines. We show the different baselines compare to our method, with and without two-stage inference. We observe that our method beats all of the baselines by large margins in all the metrics. Also, the two-stage inference significantly improves upon its one-stage counterpart. We report $R@ \{1,5,10\}$ with $d \in \{1,2,3\}$ . + +
Modeld=1d=2d=3
R@1KR@5KR@10KR@1KR@5KR@10KR@1KR@5KR@10K
Learning to Cut (Full)8.1824.4430.4015.3048.2659.5019.1864.3079.42
w/o audio6.3022.6531.8812.6144.5661.8516.5459.3782.13
w/o auxiliary4.9120.6423.2310.0843.9548.8513.7861.2967.95
+ +Table 2: Ablation study. We evaluate our method against its variants: without the visual stream, without the audio stream, and without the auxiliary task. We observe that our design choices for modeling audiovisual information and jointly training learning to cut with a single-sided cut probability provides the edge to achieve better ranking results. + +nuities. However, that is not enough. Overall, we observe that raw visual features are not appropriate enough to offer a good margin in ranking performance with respect to random chance. In contrast, both variants of our models outperform random chance (and the baselines) by large margins across all metrics. Indeed, the most important finding is the effectiveness of the two-stage inference, which improves the performance of the single-stage model by two or even three times in each of the metrics. This finding shows the importance of combining CLM and ATM, which mimics the process of first finding individual cut moments and then finding pairs that make a smooth transition across shots. We find that there is no significant difference when evaluating only on scenes from movies that were not seen at training. + +Ablation Study. To validate the design choices in our Learning to Cut model, we remove each of its main components, evaluate the resulting variant model, and report all ablation results in Table 2. We observe that modeling both Audio and Visual information jointly provides and edge in performance. This trend is particularly evidenced for the stricter ranking metrics (e.g. $R@1K$ ). We attribute these results to the fact that a good cut is made of both: visual compositions and sound; and having a single modality is not enough to do a good ranking. Finally, we observe that one key component of our model is the auxiliary task. When it is not used to facilitate the learning process (i.e. when $\lambda_2 = 0$ ), the model's performance drops several points in each metric. We validate the auxiliary task as an essential component of our model. This task aligns with the editing process, whereby the editor + +picks a place where to cut, and only then, they pick the best match to glue together [7, 10]. More detailed ablations can be found in the supplementary material. + +# 4.3. Human Studies + +We use our method for ranking cut plausibility on raw video footage licensed from Editstock.com. We licensed five different projects including more than eight hours of raw/unedited footage. Unlike previous experiments, we now address the cut ranking problem in the same setting an editor would encounter it. In this case, the method takes as input two untrimmed unedited videos. The task is to produce potential cut locations in each of these videos. While we have shown that our method offers good ranking results in our proxy task, does it work for practical scenarios, where videos are unedited and untrimmed? + +To answer this question, we conduct a human study with ten professional video editors. Although we could have invited general audience to our study, we decide not to do so; it has been shown [59] that the general population is unable to perceive the fine-grained details of good cuts. We design a study that asks participants to select the best cut among two options, which can be either taken from the professional editors' cuts $^{2}$ generated by the random method, generated by the audio-visual baseline, or generated by our proposed approach. We conduct the user study in a one vs. one manner: i.e. we mixed all possible combination of choices for the + +![](images/d47f30277031431256439a4ccdddd9a430788dfb62df4fa86f66167a08428718.jpg) +Figure 4: Qualitative Results. We show the pair-wise feature similarity across two consecutive shots before and after learning to cut. The lighter the color the higher the correlation. Sharper regions around the center of the matrices corresponds to cases where Learning to Cut is able to retrieve the correct ground truth (green box). We observe that Learning to Cut is able to make the cross-shot similarity spike in short temporal regions. In contrary, raw features' cross-shot similarity activates sparsely. + +![](images/7ff5b2798e0a4a0eb8b6938e21b96c245359552b68b9491836d7e70221eb4a18.jpg) +(a) One vs All percentage of times each source of cut is preferred. + +![](images/597b28c02172592cb057d6fd94ba0e9480a553001162401696807e256d9e2049.jpg) +(b) Pair-wise percentage of times each source of cut is preferred over the professional cuts. +Figure 5: Human study. We show the absolute percentages per cut source 5a, and the chosen percentage of each of them relative to professional cuts 5b. These results provide further evidence that our approach offers better rankings than the Audio-visual and random baselines. + +participants, and all the options were faced against each other. Thus, every alternative appeared the same number of times. We report the results in Figure 5. Interestingly, our method's cuts are chosen by the participants more often than + +those from the baselines. However, the editors can clearly identify the professionally curated cuts. Despite the progress made by this work, there is still a long way to generate cuts with professional quality. We do believe, though, that our approach and baselines are first steps towards this direction. Qualitative Results We show a pair-wise feature correlation between a pair of adjacent shot in figure 4. Each entry of the matrix is the similarity between a snippet of the left and right shot of the cut. The axes are center around the cut, such that the center of the matrix has the similarities of the positive pairs. We observe how our method transforms the features and make them spike around the cut's region. + +# 5. Conclusion + +We introduced the task of cut plausibility ranking for computational video editing. We proposed a proxy task that aligns with the actual video editing process by leveraging knowledge from already edited scenes. Additionally, we collected more than 260K edited video clips. Using this edited footage, we created the first method capable of ranking cuts automatically, which learns in a data-driven fashion. We benchmarked our method with a set of proposed metrics that reflect the model's level of precision at retrieval and expertise at providing tighter cuts. Finally, we used our method in a real-case scenario, where our model ranked cuts from non-edited videos. We conducted a user study in which editors picked our model's cuts more often compared to those made by the baselines. Yet, there is still a long way to match editors' expertise in selecting the most smooth cuts. This work aims at opening the door for data-driven computational video editing to the research community. Future directions include the use of fine-grained features to learn more subtle patterns that approximate better the fine-grained process of cutting video. Additionally, other modalities such as speech and language could bring benefits for ranking video cuts. + +Acknowledgments This work was supported by the King Abdullah University of Science and Technology (KAUST) Office of Sponsored Research through the Visual Computing Center (VCC) funding. + +# References + +[1] Triantafyllos Afouras, Andrew Owens, Joon Son Chung, and Andrew Zisserman. Self-supervised learning of audio-visual objects from video. European Conference on Computer Vision (ECCV), 2020. 3 +[2] Jean-Baptiste Alayrac, Adrià Recasens, Rosalia Schneider, Relja Arandjelović, Jason Ramapuram, Jeffrey De Fauw, Lucas Smaira, Sander Dieleman, and Andrew Zisserman. Self-supervised multimodal versatile networks. Advances in Neural Information Processing Systems, 33, 2020. 3 +[3] Juan Leon Alcazar, Fabian Caba, Long Mai, Federico Peruzzi, Joon-Young Lee, Pablo Arbelaez, and Bernard Ghanem. Active speakers in context. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12465–12474, 2020. 3 +[4] Humam Alwassel, Dhruv Mahajan, Bruno Korbar, Lorenzo Torresani, Bernard Ghanem, and Du Tran. Self-supervised learning by cross-modal audio-video clustering, 2020. 3 +[5] Elad Amrani, Rami Ben-Ari, Daniel Rotman, and Alex Bronstein. Noise estimation using density estimation for self-supervised multimodal learning, 2020. 3 +[6] Relja Arandjelovic and Andrew Zisserman. Look, listen and learn. In Proceedings of the IEEE International Conference on Computer Vision, pages 609-617, 2017. 3 +[7] Daniel Arijon. Grammar of the film language. Focal Press London, 1976. 1, 2, 5, 7 +[8] Yusuf Aytar, Carl Vondrick, and Antonio Torralba. See, hear, and read: Deep aligned representations. arXiv preprint arXiv:1706.00932, 2017. 3 +[9] Max Bain, Arsha Nagrani, Andrew Brown, and Andrew Zisserman. Condensed movies: Story based retrieval with contextual embeddings. In Proceedings of the Asian Conference on Computer Vision, 2020. 2, 3 +[10] Floraine Berthouzoz, Wilmot Li, and Maneesh Agrawala. Tools for placing cuts and transitions in interview video. ACM Transactions on Graphics (TOG), 31(4):1-8, 2012. 2, 5, 7 +[11] Andrew Brown, Jaesung Huh, Arsha Nagrani, Joon Son Chung, and Andrew Zisserman. Playing a part: Speaker verification at the movies. arXiv preprint arXiv:2010.15716, 2020. 2 +[12] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299-6308, 2017. 5 +[13] Honglie Chen, Weidi Xie, Andrea Vedaldi, and Andrew Zisserman. Vggsound: A large-scale audio-visual dataset. In International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2020. 5, 6 +[14] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 5 +[15] Joon Son Chung, Arsha Nagrani, and Andrew Zisserman. Voxceleb2: Deep speaker recognition. arXiv preprint arXiv:1806.05622, 2018.3 + +[16] Joon Son Chung and Andrew Zisserman. Out of time: automated lip sync in the wild. In Asian conference on computer vision, pages 251-263. Springer, 2016. 3 +[17] Victor Escorcia, Mattia Soldan, Josef Sivic, Bernard Ghanem, and Bryan Russell. Temporal localization of moments in video collections with natural language. arXiv preprint arXiv:1907.12763, 2019. 3 +[18] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE international conference on computer vision, pages 6202-6211, 2019. 5 +[19] Ohad Fried, Ayush Tewari, Michael Zollhöfer, Adam Finkelstein, Eli Shechtman, Dan B Goldman, Kyle Genova, Zeyu Jin, Christian Theobalt, and Maneesh Agrawala. Text-based editing of talking-head video. ACM Transactions on Graphics (TOG), 38(4):1-14, 2019. 2 +[20] Valentin Gabeur, Chen Sun, Karteek Alahari, and Cordelia Schmid. Multi-modal transformer for video retrieval. In European Conference on Computer Vision (ECCV), 2020. 3 +[21] Noa Garcia and Yuta Nakashima. Knowledge-based video question answering with unsupervised scene descriptions. arXiv preprint arXiv:2007.08751, 2020. 2 +[22] Boqing Gong, Wei-Lun Chao, Kristen Grauman, and Fei Sha. Diverse sequential subset selection for supervised video summarization. In Advances in neural information processing systems, pages 2069-2077, 2014. 2 +[23] Daniel Gordon, Kiana Ehsani, Dieter Fox, and Ali Farhadi. Watching the world go by: Representation learning from unlabeled videos. arXiv preprint arXiv:2003.07990, 2020. 3 +[24] Chunhui Gu, Chen Sun, David A Ross, Carl Vondrick, Caroline Pantofaru, Yeqing Li, Sudheendra Vijayanarasimhan, George Toderici, Susanna Ricco, Rahul Sukthankar, et al. Ava: A video dataset of spatio-temporally localized atomic visual actions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6047-6056, 2018. 2 +[25] Rohit Gupta and Kush Motwani. Linear models for video memorability prediction using visual and semantic features. In MediaEval, 2018. 2 +[26] Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010. 3, 5 +[27] Michael Gygli. Ridiculously fast shot boundary detection with fully convolutional neural networks. arXiv preprint arXiv:1705.08214, 2017. 3 +[28] Tengda Han, Weidi Xie, and Andrew Zisserman. Video representation learning by dense predictive coding. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019. 3 +[29] Tengda Han, Weidi Xie, and Andrew Zisserman. Self-supervised co-training for video representation learning. arXiv preprint arXiv:2010.09709, 2020. 3 +[30] Kensho Hara, Hirokatsu Kataoka, and Yutaka Satoh. Can spatiotemporal 3d cnns retrace the history of 2d cnns and image? In Proceedings of the IEEE Conference on Computer + +Vision and Pattern Recognition (CVPR), pages 6546-6555, 2018. 6 +[31] Shawn Hershey, Sourish Chaudhuri, Daniel PW Ellis, Jort F Gemmeke, Aren Jansen, R Channing Moore, Manoj Plakal, Devin Platt, Rif A Saurous, Bryan Seybold, et al. Cnn architectures for large-scale audio classification. In 2017 ieee international conference on acoustics, speech and signal processing (icassp), pages 131-135. IEEE, 2017. 5 +[32] Qingqiu Huang, Wentao Liu, and Dahua Lin. Person search in videos with one portrait through visual and temporal links. In Proceedings of the European Conference on Computer Vision (ECCV), pages 425-441, 2018. 2 +[33] Qingqiu Huang, Yu Xiong, Anyi Rao, Jiaze Wang, and Dahua Lin. Movienet: A holistic dataset for movie understanding. In The European Conference on Computer Vision (ECCV), 2020. 2 +[34] Qingqiu Huang, Yuanjun Xiong, Yu Xiong, Yuqi Zhang, and Dahua Lin. From trailers to storylines: An efficient way to learn from movies. arXiv preprint arXiv:1806.05341, 2018. 2 +[35] Qingqiu Huang, Lei Yang, Huaiyi Huang, Tong Wu, and Dahua Lin. Caption-supervised face recognition: Training a state-of-the-art face model without manual annotation. In The European Conference on Computer Vision (ECCV), 2020. 2 +[36] Bhavan Jasani, Rohit Girdhar, and Deva Ramanan. Are we asking the right questions in movieqa? In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 0–0, 2019. 2 +[37] Shuiwang Ji, Wei Xu, Ming Yang, and Kai Yu. 3d convolutional neural networks for human action recognition. IEEE transactions on pattern analysis and machine intelligence, 35(1):221-231, 2012. 5 +[38] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning, 2020. 3 +[39] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, Mustafa Suleyman, and Andrew Zisserman. The kinetics human action video dataset, 2017. 6 +[40] Bruno Korbar, Du Tran, and Lorenzo Torresani. Cooperative learning of audio and video models from self-supervised synchronization. In Advances in Neural Information Processing Systems, pages 7763-7774, 2018. 3 +[41] Mackenzie Leake, Abe Davis, Anh Truong, and Maneesh Agrawala. Computational video editing for dialogue-driven scenes. ACM Trans. Graph., 2017. 2 +[42] Jie Lei, Licheng Yu, Tamara L Berg, and Mohit Bansal. Tvr: A large-scale dataset for video-subtitle moment retrieval. arXiv preprint arXiv:2001.09099, 2020. 3 +[43] Linjie Li, Yen-Chun Chen, Yu Cheng, Zhe Gan, Licheng Yu, and Jingjing Liu. Hero: Hierarchical encoder for video+ language omni-representation pre-training. arXiv preprint arXiv:2005.00200, 2020. 3 +[44] Xiaolong Liu, Yao Hu, Song Bai, Fei Ding, Xiang Bai, and Philip HS Torr. Multi-shot temporal event localization: a benchmark. arXiv preprint arXiv:2012.09434, 2020. 6 + +[45] Yang Liu, Samuel Albanie, Arsha Nagrani, and Andrew Zisserman. Use what you have: Video retrieval using representations from collaborative experts. arXiv preprint arXiv:1907.13487, 2019. 3 +[46] Antoine Miech, Jean-Baptiste Alayrac, Lucas Smaira, Ivan Laptev, Josef Sivic, and Andrew Zisserman. End-to-end learning of visual representations from uncurated instructional videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9879-9889, 2020. 3 +[47] Liliane Momeni, Gül Varol, Samuel Albania, Triantafyllos Afouras, and Andrew Zisserman. Watch, read and lookup: learning to spot signs from multiple supervisors. arXiv preprint arXiv:2010.04002, 2020. 3 +[48] Arthur G Money and Harry Agius. Video summarisation: A conceptual framework and survey of the state of the art. Journal of visual communication and image representation, 19(2):121-143, 2008. 2 +[49] Mayu Otani, Yuta Nakashima, Esa Rahtu, and Janne Heikkila. Rethinking the evaluation of video summaries. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7596-7604, 2019. 2 +[50] Andrew Owens and Alexei A Efros. Audio-visual scene analysis with self-supervised multisensory features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 631–648, 2018. 3 +[51] Andrew Owens, Jiajun Wu, Josh H McDermott, William T Freeman, and Antonio Torralba. Ambient sound provides supervision for visual learning. In European conference on computer vision, pages 801-816. Springer, 2016. 3 +[52] Gautam Pal, Dwijen Rudrapaul, Suovjit Acharjee, Ruben Ray, Sayan Chakraborty, and Nilanan Dey. Video shot boundary detection: a review. In Emerging ICT for Bridging the Future-Proceedings of the 49th Annual Convention of the Computer Society of India CSI Volume 2, pages 119–127. Springer, 2015. 2 +[53] Mandela Patrick, Yuki M Asano, Ruth Fong, João F Henriques, Geoffrey Zweig, and Andrea Vedaldi. Multi-modal self-supervision from generalized data transformations. arXiv preprint arXiv:2003.04298, 2020. 3 +[54] Nuno Vasconcelos Pedro Morgado, Yi Li. Learning representations from audio-visual spatial alignment. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 3 +[55] Rui Qian, Tianjian Meng, Boqing Gong, Ming-Hsuan Yang, Huisheng Wang, Serge Belongie, and Yin Cui. Spatiotemporal contrastive video representation learning. arXiv preprint arXiv:2008.03800, 2020. 3 +[56] Anyi Rao, Jiaze Wang, Linning Xu, Xuekun Jiang, Qingqiu Huang, Bolei Zhou, and Dahua Lin. A unified framework for shot type classification based on subject centric lens. In The European Conference on Computer Vision (ECCV), 2020. 2 +[57] Anyi Rao, Linning Xu, Yu Xiong, Guodong Xu, Qingqiu Huang, Bolei Zhou, and Dahua Lin. A local-to-global approach to multi-modal movie scene segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10146-10155, 2020. 2 +[58] Tim J Smith. An attentional theory of continuity editing. 2006. 1, 4, 5 + +[59] Tim J Smith and John M Henderson. Edit blindness: The relationship between attention and global change blindness in dynamic scenes. 2008. 7 +[60] Yale Song, Jordi Vallmitjana, Amanda Stent, and Alejandro Jaimes. Tvsum: Summarizing web videos using titles. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5179-5187, 2015. 2 +[61] Naoya Takahashi, Michael Gygli, Beat Pfister, and Luc Van Gool. Deep convolutional neural networks and data augmentation for acoustic event detection. arXiv preprint arXiv:1604.07160, 2016. 5 +[62] Graham W Taylor, Rob Fergus, Yann LeCun, and Christoph Bregler. Convolutional learning of spatio-temporal features. In European conference on computer vision, pages 140-153. Springer, 2010. 5 +[63] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. 3 +[64] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489-4497, 2015. 5 +[65] Anh Truong, Floraine Berthouzoz, Wilmot Li, and Maneesh Agrawala. Quickcut: An interactive tool for editing narrated video. In Proceedings of the 29th Annual Symposium on User Interface Software and Technology, pages 497-507, 2016. 2 +[66] Michael Tschannen, Josip Djolonga, Marvin Ritter, Aravindh Mahendran, Neil Houlsby, Sylvain Gelly, and Mario Lucic. Self-supervised learning of video-induced visual invariances. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13806-13815, 2020. 3 +[67] Jiangliu Wang, Jianbo Jiao, Linchao Bao, Shengfeng He, Wei Liu, and Yun hui Liu. Self-supervised video representation learning by uncovering spatio-temporal statistics, 2020. 3 +[68] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaou Tang, and Luc Van Gool. Temporal segment networks for action recognition in videos. IEEE transactions on pattern analysis and machine intelligence, 41(11):2740-2755, 2018. 5 +[69] Miao Wang, Guo-Wei Yang, Shi-Min Hu, Shing-Tung Yau, and Ariel Shamir. Write-a-video: computational video montage from themed text. ACM Trans. Graph., 38(6):177-1, 2019. 2 +[70] Jiangyue Xia, Anyi Rao, Linning Xu, Qingqiu Huang, Jiangtao Wen, and Dahua Lin. Online multi-modal person search in videos. In The European Conference on Computer Vision (ECCV), 2020. 2 +[71] Yu Xiong, Qingqiu Huang, Lingfeng Guo, Hang Zhou, Bolei Zhou, and Dahua Lin. A graph-based framework to bridge movies and synopses. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 2 +[72] Fan Yu, DanDan Wang, Beibei Zhang, and Tongwei Ren. Deep relationship analysis in video with multimodal feature fusion. In Proceedings of the 28th ACM International Conference on Multimedia, page 4640-4644. Association for Computing Machinery, 2020. 2 + +[73] Xinli Yu, Mohsen Malmir, Cynthia He, Yue Liu, and Rex Wu. Video moment retrieval via natural language queries. arXiv preprint arXiv:2009.02406, 2020. 3 \ No newline at end of file diff --git a/learningtocutbywatchingmovies/images.zip b/learningtocutbywatchingmovies/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8e1c1c20cf5578d67de08563f591f4fed5258e93 --- /dev/null +++ b/learningtocutbywatchingmovies/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9995a40dc22daa5f0883a43ae27ece3833aa7924bdabe4e748692da10fc05979 +size 376897 diff --git a/learningtocutbywatchingmovies/layout.json b/learningtocutbywatchingmovies/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6a9e81c73c62135272e3ab3e7786c11c6a5fd3ce --- /dev/null +++ b/learningtocutbywatchingmovies/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2eb32bb252b96fe19f058b3bf65fa8281f4b208b8df0544ebfcc439936dfefa1 +size 387294 diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_content_list.json b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c787d332e86ebddcd261bdc7d1b5494d6dd6dbae --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3f1682ae7aa2320e3bc78f40d6611c41bdada293ef91ceefb463e8c3595770c +size 74754 diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_model.json b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3153ccfabcd5117c98f0cb1d9783883a22d7c377 --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de857999499a3aeacb965aff3d20731edf77a639c2257d2739a7a149f6dc7a1b +size 92171 diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_origin.pdf b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..eaec36826363d49bb0a80855983c42cb922d88ad --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/a28bd132-c3a1-4474-aa27-845b179c0fe9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:193dfd9128aa25a8f3407226a70a609e293a9e913d6804ac0f40d38dc4e22d97 +size 2154694 diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/full.md b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..327936cf7b8e38de46d14263fc69328d901830b2 --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/full.md @@ -0,0 +1,314 @@ +# Learning to Discover Reflection Symmetry via Polar Matching Convolution + +Ahyun Seo* Woohyeon Shim* Minsu Cho + +Pohang University of Science and Technology (POSTECH), South Korea + +http://cvlab.postech.ac.kr/research/PMCNet + +# Abstract + +The task of reflection symmetry detection remains challenging due to significant variations and ambiguities of symmetry patterns in the wild. Furthermore, since the local regions are required to match in reflection for detecting a symmetry pattern, it is hard for standard convolutional networks, which are not equivariant to rotation and reflection, to learn the task. To address the issue, we introduce a new convolutional technique, dubbed the polar matching convolution, which leverages a polar feature pooling, a self-similarity encoding, and a systematic kernel design for axes of different angles. The proposed high-dimensional kernel convolution network effectively learns to discover symmetry patterns from real-world images, overcoming the limitations of standard convolution. In addition, we present a new dataset and introduce a self-supervised learning strategy by augmenting the dataset with synthesizing images. Experiments demonstrate that our method outperforms state-of-the-art methods in terms of accuracy and robustness. + +# 1. Introduction + +The world is built on symmetry. From the physical structures of nature, the biological patterns of life, to the artifacts of human, symmetries reveal themselves almost everywhere. Perception of such symmetries plays a crucial role at different levels of human vision [38]; it provides humans with pre-attentive cues for early visual analysis and also acts as an integral part for 3D object perception under perspective distortion. Among common groups of symmetry, the most basic and popular form is reflection, mirror, or bilateral symmetry, which is the focus of this work. The task of reflection symmetry detection is to discover reflective patterns from images by detecting their axes of symmetry. Despite the apparent simplicity of the mathematical concept [40] and the long history of research [24], the problem remains challenging due to significant variations and ambiguities of symmetry patterns in the wild. + +![](images/e370e95cdae1a00aebc9a0d8be7228d936f6e61577e670ea59867a556e69be59.jpg) +Figure 1. Feature matching in reflection symmetry. Perception of reflection symmetry requires matching features of corresponding regions in reflection with respect to its symmetry axis. Grids represent feature maps, and red squares denote corresponding regions. + +One of the most promising directions for tackling the challenge would be to learn from data [15]. While deep convolutional neural networks (CNNs) have made remarkable progress in a wide range of computer vision problems, there has been little work for learning symmetry detection on real-world images. Previous work [14] adapts a CNN [3] to regress a dense heatmap of symmetry axes for symmetry detection. While the results demonstrate the effectiveness of learning, the method does not consider the limitation of conventional CNNs in learning symmetry. As illustrated in Fig. 1, discovering symmetry requires recognizing matching pairs of local regions in reflection, and this may make it hard for CNNs, which are neither invariant nor equivariant to reflection [8, 20], to learn the task. Furthermore, the rotational freedom of the symmetry axis makes it even harder since conventional CNNs are not invariant to rotation either. Standard convolution alone is not effective in learning the required properties solely from data. + +In this work, we introduce a new convolutional technique, dubbed the polar matching convolution (PMC), which leverages a polar feature pooling, a self-similarity encoding, and a systematic kernel design for axes of different angles. On the basis of symmetrically matched feature pairs in a polar structure, the polar matching kernel computes the confidence of symmetry by exploiting both local similarities + +and geometric layouts of local patterns. The proposed convolution neural network learns to discover symmetry patterns with the high-dimensional kernel that effectively compares corresponding features in reflection with respect to the possible candidate axes of symmetry. We also present a new symmetry detection dataset and introduce a self-supervised learning strategy using synthesized images. The experimental evaluation on the SDRW [23] benchmark and our dataset shows that the proposed method, PMCNet, outperforms state-of-the-art methods in accuracy and robustness. + +# 2. Related Work + +Reflection symmetry algorithms can be broadly classified into two classes depending on whether the symmetry axes are detected using keypoint matching [4, 7, 26, 28, 39] or heatmap prediction [11, 12, 14, 36]. + +Keypoint matching. Early work on symmetry detection [4, 26] constructs the symmetry axes using the sparse set of symmetry matches obtained by matching the local features of the keypoints. Keypoint matching is done by comparing the original features and their mirrored counterparts. The descriptors need to be equivariant under reflection on images. Loy and Eklundh [26] use the SIFT [25] descriptor so they can compute the reflected counterpart of the descriptor by reordering its elements. For each pair, a candidate of a symmetry axis is the line perpendicularly passing through the mid-point of the symmetry pair. Patraucean et al. [30] develop a validation scheme using contrario theory on top of the work [26] to find the best mirror-symmetric image patches. Cicconet et al. [6] propose a pairwise voting scheme based on the symmetry coefficient computed with the tangents. Elawady et al. [10] transform the voting problem into the kernel density estimation and handle the displacement and orientation information with a linear-directional kernel-based voting representation. Cho and Lee [4] propose a symmetry-growing method to exploit further information than the local symmetry regions. The initial symmetry feature pairs are used as seeds to be merged and refined with geometric consistency and photometric similarity. The methods [7, 28] group the pixel correspondences using a randomized algorithm and registration. Cicconet et al. [7] propose a Mirror Symmetry via Registration (MSR) framework to perform registration between the original and reflected patterns using normalized cross-correlation matches. They obtain the optimal symmetry plan with the reflection and registration mappings. Cornelius et al. [17] consider detecting reflection symmetries on planar surfaces and locate them using a hough-voting scheme with feature quadruplets. They also improve this framework efficiently with the local affine frame [18] that takes a single symmetry pair to hypothesize the symmetry axis. Sinha et al. [34] adopt a camera coordinate system to + +assume planar symmetry and use random sample consensus (RANSAC) algorithm to extract the camera parameters and the representative symmetry. Our convolutional technique, PMC, is inspired by these keypoint matching schemes and designed to detect deformed real-world symmetries in the images. + +Heatmap prediction. Other than comparing between features, recently proposed methods directly predict the symmetry for each pixel. Tsogkas et al. [36] assign each pixel a bag of features at all orientations and scales to obtain the symmetry probability map. These symmetry structures are found with multiple instance learning. Nagar et al. [28] leverage PatchMatch [1] to produce dense SymmMap comprising the displacement field to the mirror reflection and the confidence score for each pixel. SymmMap is first initialized with the sparse set of symmetry points and iteratively updated by searching neighbors which maximize the confidence scores. Fukushima et al. [11, 12] introduce a 4-layer neural network rather than using hand-crafted features. The network extracts and blurs the edges from the image to produce a dense heatmap of the symmetry axes. + +Funk et al. [14] is the first to use deep CNN to regress the symmetry heatmap directly. This work [14] employs a segmentation-based model [3] and trains with $\ell 2$ -loss over ground-truth heaptmaps. While the simple CNN model outperforms the methods using the local feature descriptors, it often fails to discover real-world symmetries with deformed axes since conventional CNNs are neither invariant nor equivariant to reflection and rotation. To mitigate these difficulties, we extend PMC to use the self-similarity descriptor for detecting symmetries. + +# 3. Proposed Approach + +The proposed method discovers reflection symmetry patterns by learning convolution with high-dimensional kernels for reflective feature matching. Figure 2 briefly illustrates the overall architecture. Given an input image $\mathbf{I}$ , a base feature $\mathbf{F}$ is computed by a feature encoder ENC. We transform the base feature $\mathbf{F}$ to a polar self-similarity descriptor $\mathbf{P}$ . Then, the polar matching convolutions, $\mathrm{PMC}^{\mathrm{F}}$ and $\mathrm{PMC}^{\mathrm{P}}$ , compute the symmetry scores, $\mathbf{S}^{\mathrm{F}}$ and $\mathbf{S}^{\mathrm{P}}$ , for the features, $\mathbf{F}$ and $\mathbf{P}$ , respectively. The final prediction is obtained by applying a convolutional block $g(\cdot)$ after combining the scores $\mathbf{S}^{\mathrm{F}}$ and $\mathbf{S}^{\mathrm{P}}$ , and the base feature $\mathbf{F}$ . In the following, we elaborate the polar matching convolutions $\mathrm{PMC}^{\mathrm{F}}$ and $\mathrm{PMC}^{\mathrm{P}}$ and then describe the final output and the training objective for our model, the polar matching convolution network. + +# 3.1. Polar Matching Convolution (PMC) + +The convolution operation detects local patterns by multiplying shared kernels with features at different positions. + +![](images/b9ef0fd4ac2966a58e56b4cf77c259e7e91c5c031403158df0b97d6cc68bc501.jpg) +Figure 2. Overview of our proposed method. For details, see Sec. 3. + +![](images/1de436135ae1c1ade3b8137364a8a978505066b936781f769d978f8d3660f4fe.jpg) +(a) Polar region descriptor $\mathbf{Z}^{\mathrm{F}}$ + +![](images/24c4897fea3829749209a85a3d4e95aa88c7148d15aaae7e1669d4034ee3e011.jpg) +(b) Intra-region correlation $\mathbf{C}^{\mathrm{F}}$ +Figure 3. Illustration of the Polar Matching Convolution (PMC). (a) The polar region descriptor $\mathbf{Z}^{\mathrm{F}}$ is sampled from the given base feature $\mathbf{F}$ with the number of sampling angles $M_{\mathrm{ang}}$ and radii $M_{\mathrm{rad}}$ . (b) The intra-region correlation $\mathbf{C}^{\mathrm{F}}$ are computed using the polar region descriptor $\mathbf{Z}^{\mathrm{F}}$ . (c) The reflective matching kernel $\mathbf{K}^{\mathrm{F}}$ is applied to $\mathbf{C}^{\mathrm{F}}$ to compute the symmetry score tensor $\mathbf{S}^{\mathrm{F}}$ . The matching feature pairs are indicated with black dotted lines. Note that $N_{\mathrm{axi}}$ is the number of the candidate axes. + +![](images/adef6050a5a169e6453e65d6bf72e711e032b49012b02d6f7ac02548a18c1a72.jpg) +(c) Reflective matching kernel $\mathbf{K}^{\mathrm{F}}$ + +The standard convolution in neural networks is trained to learn the kernels according to the target objective without specific constraints in convolution. For effective symmetry detection, we propose the polar matching convolution (PMC) that is designed to learn to extract symmetry patterns w.r.t. the axes of symmetry. The operations of PMC are illustrated in Fig. 3 and detailed in the following. + +Polar region descriptor. As a basic unit for local matching, we use a polar region descriptor (Fig. 3a). For each spatial position $(x,y)$ of feature tensor $\mathbf{F} \in \mathbb{R}^{W \times H \times C}$ , we collect the features of the neighborhood points sampled with a polar grid centered at $(x,y)$ . We set the maximum radius as $M_{\mathrm{len}}$ , and the number of sampling angles $M_{\mathrm{ang}}$ and radii $M_{\mathrm{rad}}$ . A polar region descriptor $\mathbf{Z}^{\mathrm{F}} \in \mathbb{R}^{W \times H \times M_{\mathrm{rad}} \times M_{\mathrm{ang}} \times C}$ is designed to contain the local polar window for all spatial position $(x,y)$ sampled with bilinear interpolation from $\mathbf{F}$ : + +$$ +\mathbf {Z} _ {x, y, \gamma , \phi , c} ^ {\mathrm {F}} = \mathbf {F} _ {x - \gamma \cos \phi , y + \gamma \sin \phi , c}, \tag {1} +$$ + +where $\phi$ indicates the offset angle and $\gamma$ offset radius from the center of each polar region. The offsets $\phi$ and $\gamma$ are evenly distributed in $[0, \frac{M_{\mathrm{len}}}{M_{\mathrm{rad}}}]$ and $[0, \frac{2\pi}{M_{\mathrm{ang}}}]$ , respectively. + +Intra-region correlation. To capture the symmetry pattern within each polar region, we compute an intra-region + +correlation tensor $\mathbf{C}^{\mathrm{F}}\in \mathbb{R}^{W\times H\times M_{\mathrm{ang}}\times M_{\mathrm{ang}}}$ (Fig. 3b) as + +$$ +\mathbf {C} _ {x, y, \phi , \phi^ {\prime}} ^ {\mathrm {F}} = \sum_ {\gamma} \operatorname {s i m} \left(\mathbf {Z} _ {x, y, \gamma , \phi ,,:} ^ {\mathrm {F}}, \mathbf {Z} _ {x, y, \gamma , \phi^ {\prime},,:} ^ {\mathrm {F}}\right), t \tag {2} +$$ + +to contain the similarities across different angles. For the similarity function, the cosine-similarity is used. The colon (:) represents the whole elements in the specified axis. + +Reflective matching kernel. From the intra-region correlation $\mathbf{C}^{\mathrm{F}}$ , the symmetry axes are detected by the reflective matching kernel $\mathbf{K}^{\mathrm{F}} \in \mathbb{R}^{N_{\mathrm{axi}} \times M_{\mathrm{ang}} \times M_{\mathrm{ang}}}$ where $N_{\mathrm{axi}}$ is the number of the candidate axes. The kernel associates with all the pairs in the polar region by construction. As shown in Fig. 3c, if the region is symmetry with respect to the axis of the red-dotted line, the (unordered) feature pairs $\{(1,2),(3,8),(4,7),(5,6)\}$ should have high correlations. On the other hand, for the axis of the blue-dotted line, the matching feature pairs should be $\{(1,8),(2,7),(3,6),(4,5)\}$ . Likewise, we establish a matching set for each candidate axis. In training, we learn the parameters of kernel $\mathbf{K}^{\mathrm{F}}$ involved in the matching sets only and discard the other entries. This results in a kernel with $N_{\mathrm{axi}} M_{\mathrm{ang}}$ trainable parameters in total. The symmetry score $\mathbf{S}^{\mathrm{F}} \in \mathbb{R}^{W \times H \times N_{\mathrm{axi}}}$ is computed by convolution with + +Figure 4. Illustration of PMC with self-similarity $(\mathrm{PMC}^{\mathrm{P}})$ . (a) The polar self-similarity $\mathbf{P}$ contains self-similarity values of the neighborhood pixels sampled with $N_{\mathrm{rad}}$ and $N_{\mathrm{ang}}$ . The polar region descriptor $\mathbf{Z}^{\mathrm{P}}$ is then sampled from the polar self-similarity $\mathbf{P}$ with the sampling radius $M_{\mathrm{rad}}$ and the sampling angle $M_{\mathrm{ang}}$ . (b) The reflective matching kernel $\mathbf{K}^{\mathrm{P}}$ extracts the relevant angle-wise relation pairs for $N_{\mathrm{axi}}$ candidate axes. The kernel can be decomposed to the lower-dimensional kernels to tackle the relations within the polar region descriptor and the polar self-similarity descriptor. +![](images/9f1ec0db81d434db918eee00f30e76c651eb960106ab249acae2202123c50c58.jpg) +$\mathbf{F} \in \mathbb{R}^{W \times H \times C} \quad \mathbf{P} \in \mathbb{R}^{W \times H \times N_{\mathrm{rad}} \times N_{\mathrm{ang}}} \quad \mathbf{Z}^{\mathrm{P}} \in \mathbb{R}^{W \times H \times M_{\mathrm{rad}} \times M_{\mathrm{ang}} \times N_{\mathrm{rad}} \times N_{\mathrm{ang}}}$ +(a) Polar self-similarity region descriptor $\mathbf{Z}^{\mathrm{P}}$ + +![](images/3beb8268f1be4c143e9d13ebc018b5b6814d9815afe5b40f1dfbfa7d3839f706.jpg) +$\mathbf{K}^{\mathrm{P}}\in \mathbb{R}^{N_{\mathrm{axi}}\times M_{\mathrm{ang}}\times M_{\mathrm{ang}}\times N_{\mathrm{ang}}\times N_{\mathrm{ang}}}$ +(b) Separable reflective matching kernel $\mathbf{K}^{\mathrm{P}}$ + +![](images/603ee63afd7ee33d58e3b98bc56446812e7b272139cc7e273df627187b56aee2.jpg) +Figure 5. Matching with self-similarity in reflection symmetry. The red grid represents a self-similarity descriptor where each position encodes its similarity value to the center. Between the two corresponding regions in reflection, the self-similarity descriptor is preserved in reflection if each similarity value is invariant to reflection and rotation. See text for details. + +the reflective matching kernel as + +$$ +\mathbf {S} _ {x, y, k} ^ {\mathrm {F}} = \sum_ {\phi , \phi^ {\prime}} \mathbf {K} _ {k, \phi , \phi^ {\prime}} ^ {\mathrm {F}} \mathbf {C} _ {x, y, \phi , \phi^ {\prime}} ^ {\mathrm {F}}. \tag {3} +$$ + +# 3.2. PMC with self-similarity + +Since CNNs are neither invariant nor equivariant to rotation and reflection, PMC may still have difficulty in learning to detect symmetry. For example, in the case of Fig. 1, PMC effectively detects reflection if the base feature is entirely invariant for both reflection and rotation. However, it may be an excessive requirement for the base feature extractor, i.e., lower convolutional layers, to achieve. To tackle this issue, we relax the requirement by extending PMC with the self-similarity descriptor [31]. Figure 5 illustrates the basic idea. Let us represent each region as the descriptor of self-similarity values to the neighbor regions. The self-similarity descriptor is preserved in reflection if the pairwise similarity values are invariant to reflection and rotation. In other + +words, the region descriptor would be reflection-equivariant if similarity between two regions is invariant to reflection and rotation. Note that this invariance requirement on pairwise similarities is weaker than the original invariance requirement on individual features. To this end, we transform the base feature into self-similarity by using the neighborhood in a polar grid. The details of the extended $\mathrm{PMC}^{\mathrm{P}}$ are illustrated in Fig. 4 and described in the following. + +Polar self-similarity descriptor. We adopt self-similarity with a polar-shaped local window to encode relational information with varying orientations. Given an base feature $\mathbf{F} \in \mathbb{R}^{W \times H \times C}$ , polar self-similarity $\mathbf{P} \in \mathbb{R}^{W \times H \times N_{\mathrm{rad}} \times N_{\mathrm{ang}}}$ is computed as + +$$ +\mathbf {P} _ {x, y, r, \theta} = \operatorname {s i m} \left(\mathbf {F} _ {x, y,:}, \mathbf {F} _ {x - r \cos \theta , y + r \sin \theta , :}\right), \tag {4} +$$ + +where $x$ and $y$ indicate the spatial position, and $r$ and $\theta$ denote the offsets for a spatial position in polar coordinate. $r$ and $\theta$ are evenly distributed between $[0, \frac{N_{\mathrm{len}}}{N_{\mathrm{rad}}}]$ and $[0, \frac{2\pi}{N_{\mathrm{ang}}}]$ , respectively, where $N_{\mathrm{rad}}$ is the number of sampled radii, $N_{\mathrm{ang}}$ the number of angles, and $N_{\mathrm{len}}$ the maximum radius. For the similarity function, the rectified cosine-similarity, which is the cosine similarity followed by ReLU. The polar region descriptor $\mathbf{Z}^{\mathrm{P}} \in \mathbb{R}^{W \times H \times M_{\mathrm{rad}} \times M_{\mathrm{ang}} \times N_{\mathrm{rad}} \times N_{\mathrm{ang}}}$ is constructed by sampling the polar self-similarity descriptor $\mathbf{P}$ with bilinear interpolation: + +$$ +\mathbf {Z} _ {x, y, \gamma , \phi , r, \theta} ^ {\mathrm {P}} = \mathbf {P} _ {x - \gamma \cos \phi , y + \gamma \sin \phi , r, \theta}. \tag {5} +$$ + +Note that we preserve the structure of the polar-shaped local windows of $\mathbf{P}$ so that we construct the match w.r.t. the polar self-similarity descriptor $\mathbf{P}$ . + +Intra-region correlation. From the polar region descriptor $\mathbf{Z}^{\mathrm{P}}$ ,the intra-region correlation tensor $\mathbf{C}^{\mathrm{P}}\in$ $\mathbb{R}^{W\times H\times M_{\mathrm{ang}}\times M_{\mathrm{ang}}\times N_{\mathrm{ang}}\times N_{\mathrm{ang}}}$ is computed as + +$$ +\mathbf {C} _ {x, y, \phi , \phi^ {\prime}, \theta , \theta^ {\prime}} ^ {\mathrm {P}} = \sum_ {\gamma , r} \mathbf {Z} _ {x, y, \gamma , \phi , r, \theta} ^ {\mathrm {P}} \mathbf {Z} _ {x, y, \gamma , \phi^ {\prime}, r, \theta^ {\prime}} ^ {\mathrm {P}}. \tag {6} +$$ + +The operation above is equivalent to the outer product of $N_{\mathrm{ang}}$ -dimensional polar self-similarity vectors in polar region, results in $(N_{\mathrm{ang}} \times N_{\mathrm{ang}})$ element-wise relations of the polar self-similarity descriptor $\mathbf{P}$ . + +Separable reflective matching kernel. To detect symmetry axes from the intra-region correlation $\mathbf{C}^{\mathrm{P}}$ , the reflective matching kernel $\mathbf{K}^{\mathrm{P}} \in \mathbb{R}^{N_{\mathrm{axi}} \times M_{\mathrm{ang}} \times M_{\mathrm{ang}} \times N_{\mathrm{ang}} \times N_{\mathrm{ang}}}$ is required. The symmetry score $\mathbf{S}^{\mathrm{P}} \in \mathbb{R}^{W \times H \times N_{\mathrm{axi}}}$ is computed by convolution with the reflective matching kernel as + +$$ +\mathbf {S} _ {x, y, k} ^ {\mathrm {P}} = \sum_ {\phi , \phi^ {\prime}, \theta , \theta^ {\prime}} \mathbf {K} _ {k, \phi , \phi^ {\prime}, \theta , \theta^ {\prime}} ^ {\mathrm {P}} \mathbf {C} _ {x, y, \phi , \phi^ {\prime}, \theta , \theta^ {\prime}} ^ {\mathrm {P}}. \tag {7} +$$ + +Alternatively, the kernel $\mathbf{K}^{\mathrm{P}}$ can be computed by sequentially applying the kernels $\mathbf{K}^{\mathrm{PM}}\in \mathbb{R}^{N_{\mathrm{axi}}\times M_{\mathrm{ang}}\times M_{\mathrm{ang}}}$ and $\mathbf{K}^{\mathrm{PN}}\in \mathbb{R}^{N_{\mathrm{axi}}\times N_{\mathrm{ang}}\times N_{\mathrm{ang}}}$ as illustrated in Fig. 4b. If the image is symmetry w.r.t. the axis of the red-dotted line, the (unordered) feature pairs $\{(1,2),(3,8),(4,7),(5,6)\}$ and the element pairs $\{(1,2),(3,8),(4,7),(5,6)\}$ should be matched. Different from Sec. 3.1, the matching set of $\mathrm{PMC}^{\mathrm{P}}$ encompasses two levels of matching pairs. When $M_{\mathrm{ang}} = N_{\mathrm{ang}}$ , the self-similar pattern enables the kernels $\mathbf{K}^{\mathrm{PM}}$ and $\mathbf{K}^{\mathrm{PN}}$ to share the kernel parameters. We denote the shared kernel by $\mathbf{K}^{\mathrm{PS}}\in \mathbb{R}^{N_{\mathrm{axi}}\times N_{\mathrm{ang}}\times N_{\mathrm{ang}}}$ . As in the reflective matching kernel of Sec. 3.1, we only use and train $N_{\mathrm{axi}}N_{\mathrm{ang}}$ elements among $N_{\mathrm{axi}}N_{\mathrm{ang}}N_{\mathrm{ang}}$ parameters of the kernel. We can thus rewrite Eq. (7) as + +$$ +\tilde {\mathbf {C}} _ {x, y, \theta , \theta^ {\prime}} ^ {\mathrm {P}} = \sum_ {\phi , \phi^ {\prime}} \mathbf {K} _ {k, \phi , \phi^ {\prime}} ^ {\mathrm {P s}} \mathbf {C} _ {x, y, \phi , \phi^ {\prime}, \theta , \theta^ {\prime}} ^ {\mathrm {P}}, \tag {8} +$$ + +$$ +\mathbf {S} _ {x, y, k} ^ {\mathrm {P}} = \sum_ {\theta , \theta^ {\prime}} \mathbf {K} _ {k, \theta , \theta^ {\prime}} ^ {\mathrm {P} _ {\mathbb {S}}} \tilde {\mathbf {C}} _ {x, y, \theta , \theta^ {\prime}} ^ {\mathrm {P}}. \tag {9} +$$ + +# 3.3. Reflection symmetry detection + +We combine $\mathbf{S}^{\mathrm{P}}$ , $\mathbf{S}^{\mathrm{F}}$ , and $\mathbf{F}$ as the input to the decoder (DEC). To feed the positional confidence to the decoder as an additional input, we construct the maximum score map $\tilde{\mathbf{S}} \in \mathbb{R}^{W \times H \times 1}$ by pooling the maximum score for each spatial position and then replace $\mathbf{S}$ with $[\tilde{\mathbf{S}} ||\mathbf{S}]$ . The final prediction $\mathbf{Y}$ is the output of the decoder $g(\cdot)$ : + +$$ +\mathbf {Y} = g \left(\left[ \mathbf {S} ^ {\mathrm {P}} \right| \left| \mathbf {S} ^ {\mathrm {F}} \right| \left| \mathbf {F} \right]\right), \tag {10} +$$ + +where $||$ denotes the concatenation operation along the channel. The decoder $g(\cdot)$ consists of two blocks of $(3 \times 3$ conv-BN-DO-ReLU) and a $1 \times 1$ conv layer with sigmoid, where BN and DO denote batch normalization and dropout, respectively. + +# 3.4. Training objective + +Our network basically performs pixel-wise binary classification for detection of symmetry axes. Since the symmetry axes occupy only a tiny part of the image, we adopt + +![](images/8ca8f6c0c03b274f1f0b9cacb223ff55cb126e1cfea7ce16cb9ca389c8651447.jpg) +(a) + +![](images/94b93c480685fed88341c882fa7ddc9a639311393ff063b2f1a3646bde582131.jpg) +(b) + +![](images/a38f47ac514f21b6eb3de3d13b0fd71d9528a11252b459f8758df64da5bed2f2.jpg) +(c) + +![](images/6fd4031e64345e1bd6118063f0a5e1875404e0ec6d06a192180d614301857e2e.jpg) +(d) +Figure 6. An example of a synthesized image. (a) A foreground image with randomly sampled axes. (b) Ground-truth symmetry axes. (c) The result of simple paste of the mirror-flipped foreground instances to the background image. (d) A final training sample with a blending procedure. + +$\alpha$ -variant of the focal loss [21] to down-weight the non-axes region in training: + +$$ +\mathcal {L} = \sum_ {x, y} - \alpha_ {t} (x, y) \left(1 - p _ {t} (x, y)\right) ^ {\beta} \log \left(p _ {t} (x, y)\right), \tag {11} +$$ + +where $\alpha_{t}(x,y)$ balances the importance of axes/non-axes region and $p_t(x,y)$ is a confidence of symmetry, which adjust the rate between the easy and the hard samples with the focusing parameter $\beta$ [21]. Moreover, we soft-weight $p_t(x,y)$ and $\alpha_{t}(x,y)$ after smoothing the corresponding label with gaussian blur with radius 5 following [14], + +$$ +p _ {t} (x, y) = \mathbf {Y} _ {x, y} \mathbf {M} _ {x, y} + (1 - \mathbf {Y} _ {x, y}) (1 - \mathbf {M} _ {x, y}), \tag {12} +$$ + +$$ +\alpha_ {t} (x, y) = \alpha \mathbf {M} _ {x, y} + (1 - \alpha) (1 - \mathbf {M} _ {x, y}), \tag {13} +$$ + +where $\mathbf{Y}$ and $\mathbf{M}$ are the predicted heatmap and the ground-truth (GT) label heatmap and $\alpha$ is a pre-specified scalar that typically set by inverse class frequency. + +# 4. Experiments + +# 4.1. Datasets + +Existing datasets. SDRW [23] is used in Symmetry Detection from Real World Images Competition '13 which contains 51/70 images for training and testing purposes. NYU [5] consists of 176 single-symmetry and 63 multiple-symmetry images. DSW [13] contains 100 images for each single and multiple symmetries and is used in the challenge Detecting Symmetry in the Wild '17. Sym-COCO [13] is the dataset built on images selected from COCO [22] containing 250 training and 240 test images for reflection symmetry. BPS [14] is a dataset with 1,202 images collected + +from COCO to train the deep neural networks. The test set of Sym-COCO and BPS are the same. Unfortunately, both DSW and BPS datasets are not available at this point. Therefore, we use the two available datasets, SDRW and NYU, and construct a new dataset, LDRS, and its synthetic augmentation, LDRS-synth, as follows. + +Our dataset (LDRS). We construct the LDRS dataset, which is named after the acronym of our work, following the dataset collection protocol of BPS [14] in terms of the scale and the characteristics of the images. First, we filter the images from COCO [22] dataset by excluding the instances with the area less than $\frac{hw}{16}$ given image height $h$ and width $w$ and discarding the images with less than three instances. Among them, we manually select 1,500 candidate images with the valid reflection symmetries for the train/val split. For the test split, we selected 240 images from the 250 training images of Sym-COCO [13] as they were part of the test split of the COCO dataset. We mainly follow the annotation guidelines of the previous datasets [5, 23, 14] except we do not consider the 3D prior-based or semantic symmetries. Four human annotators labeled the symmetry axes as line segments using the annotation tool labelMe [37]. The train/val/test split contains 1,110/127/240 images, respectively, and all of the images contain at least one ground-truth symmetry axis. + +Synthetic augmentation. To overcome the limited real-world training data, we adopt a self-supervised learning strategy of using synthesized images from the existing dataset. We use COCO [22] images and annotations utilized for instance segmentation. The images are generated online during training, and we denote this set of images as LDRS-synth. We pre-select the valid foreground images (6,526) while using the whole training split (83,000) for the background. An example is shown in Fig. 6. The synthesis process takes a pair of images, one for the foreground and the other for the background. Given a foreground image and its mask, we select the top-5 instances by area. For each instance, we randomly select two angles $\psi_{1}$ and $\psi_{2}$ to rotate the masks. We assign vertical axes for each instance and mirror one of the two parts of the target instance. Then, we rotate the image reverse so that each axis results in the angle of $-\psi_{1}$ and $-\psi_{2}$ . Among ten candidate instances, the combinations with the largest sum of the length of the axes are selected for foreground instances. The instances are blurred with a radius of 5 and matched with the statistics of the background image after normalization for blending. The detailed algorithm is stated in the supplementary material. + +# 4.2. Experimental setup + +Training and testing data. For training, we use the training splits of SDRW and LDRS along with the whole sets + +![](images/77aa424c25222f92054960a4c0907cb4bc1819230e44fb9e984b2dd3c326c9b7.jpg) +Figure 7. Precision-Recall curve on the SDRV [23] symmetry detection dataset. The (recall, precision) point of the maximum F1-score is indicated with dots. + +of NYU and LDRS-synth. For evaluation, we use the test splits of SDRW and LDRS. + +Evaluation metric. Since the ground-truth axes are pixel-width, we follow the common procedure for evaluating the boundaries by applying the morphological thinning [10, 27] to the output heatmap and performing the pixel matching algorithm between the output and the ground-truth boundaries. We set the maximum distance as 0.01 of the image diagonal for the pixel matching process. We use 100 evenly distributed thresholds to compute the F1 score, the harmonic mean of precision and recall, following [10]. We report the maximum F1 score (\%) for the test split of both SDRV and our LDRS datasets for ablation studies. + +Implementation details. We employ ResNet-101 [16] pre-trained on ImageNet [9] as the backbone for the base feature $\mathbf{F}$ . To aggregate multi-resolution features, we apply the Atrous Spatial Pyramid Pooling module (ASPP) [2]. The dropout [33] rates of two blocks in the decoder $g(\cdot)$ are 0.5 and 0.1, respectively. The hyperparameters for the polar descriptors are set as $M_{\mathrm{rad}} = 5$ , $M_{\mathrm{ang}} = 8$ , $N_{\mathrm{rad}} = 5$ , $N_{\mathrm{ang}} = 8$ , $M_{\mathrm{len}} = 8$ , $N_{\mathrm{len}} = 4$ , and $N_{\mathrm{axi}} = 8$ . When $N_{\mathrm{axi}} = 8$ , the 4 axes lie on the polar descriptor, and the other 4 axes lie in between the polar descriptor. The focal loss is applied with the weighting factor $\alpha = 0.95$ and the focusing parameter $\beta = 2$ . The model is trained end-to-end for 100 epochs with an initial learning rate 0.001 using Adam optimizer [19] while the learning rate is decayed by the factor of 0.1 at $50^{\mathrm{th}}$ and $75^{\mathrm{th}}$ epochs. The training batch is randomly composed of 16 images from the different datasets. The images are augmented with random rotation and color jittering. During training, we evaluate our model every 5 epochs in our validation set with 10 thresholds. The input images are resized to (417, 417) for both training and testing, while we resize the output back to its original size for evaluation. We use + +
descriptortest dataset
polar regionpolar self-similaritySDRWLDRS
✓65.535.3
✓66.233.7
✓✓68.335.9
+ +Table 1. Ablation on descriptors. + +
kerneltest dataset
learnable axis-awareSDRWLDRS
✓65.434.6
✓67.535.3
✓68.837.3
+ +Table 2. Ablation on kernels. + +
decoder inputtest dataset
score (S^P, S^F)base feature (F)SDRWLDRS
✓62.732.5
✓66.836.2
✓✓68.837.3
+ +Table 3. Ablation on decoder inputs. + +
training strategytest dataset
pre-trainingfine-tuningSDRWLDRS
✓47.825.5
✓67.232.7
✓✓68.837.3
+ +Table 4. Ablation on training strategies. + +
train datasettest dataset
LDRS-synthSDRW + LDRS + NYUSDRWLDRS
✓37.614.2
✓61.634.8
✓✓68.837.3
+ +Table 5. Ablation on training datasets. + +PyTorch [29] framework to implement our model. + +# 4.3. Ablation study + +Different types of descriptors. We introduce two types of polar descriptors in Sec. 3.2: the polar region descriptor and the polar self-similarity descriptor. While the $\mathrm{PMC^F}$ extracts the polar region descriptor from the base feature, the $\mathrm{PMC^P}$ first computes the polar self-similarity descriptor using the base feature, then constructs the polar region descriptor. To investigate the impact of the proposed polar descriptors, we conduct experiments using decoder input of $(\mathbf{S}||\mathbf{F})$ , which contains a single score computed by the corresponding PMC. Without the polar region descriptor, the region is a single pixel. As shown in Tab. 1, using both polar descriptors are effective. + +Reflective matching kernels. We show the effectiveness of the kernel design in PMC in Tab. 2. If the kernel is not axis-aware, we use all parameters consisting of the kernels. If the kernel is not learnable, we fix the values and do not update during training. The learnable and axis-aware kernel results in the best performance. Interestingly, the axis-aware kernel increases the max F1 score while using only $\frac{1}{N_{\mathrm{axi}}}$ of the total learnable kernel parameters. + +Decoder inputs. We compare the different inputs to the decoder of our model in Tab. 3. The score denotes the combination of $\mathbf{S}^{\mathrm{P}}$ and $\mathbf{S}^{\mathrm{F}}$ and the base feature indicates $\mathbf{F}$ . Without the base feature, the model scores lower than the final model because of the lack of semantic information from the CNN features. The model with base feature becomes a simple segmentation network similar to [14]. Since the base feature does not contain the axis-aware pixel matching information, using score improves the max F1 score. + +Training strategies. The backbone network of our model is initialized with the ImageNet pre-trained weights and fine-tuned during training. Tab. 4 shows comparisons to results (1) w/o pre-training on the ImageNet and (2) w/o + +fine-tuning the feature extractor. The performance drops significantly without fine-tuning, but not in the case without pre-training. While adapting the whole network to polar matching kernels is crucial, the pre-trained weights still act as a good initial prior for computing pixel-level similarities. + +Training datasets. We investigate the effectiveness of the self-supervised learning strategy of using synthetically augmented images using the different combinations of the train datasets in Tab. 5. For the real-image datasets, we combine SDRW-train [23], NYU [5], and LDRS-train each consisting of 51, 239 and 1,110 images, respectively. For the augmented images, we use LDRS-synth, which is generated using COCO images. Training only with LDRS-synth suffers from poor generalization ability, but it is helpful when used together with the real-image datasets as when the amount of the real images is far less than that of the augmented images. + +# 4.4. Comparison with the state-of-the-art methods + +We compare our method with the state-of-the-art methods in Fig. 7. Our method achieves the F1 score of $68.8\%$ and outperforms the state-of-the-art method SymResNet [14] with a large margin. Notably, our model and LE [26] show robust performance against dense detection methods [14, 32, 35, 36], which supports our claim that the reflection-equivariance of the feature descriptor is essential in detecting symmetry patterns. + +The qualitative results are shown in Fig. 8. We compare our PMCNet with MIL [36] and Sym-ResNet [14] on (a) SDRW [23] and (b) LDRS (Ours) datasets. SDRW exhibit well-defined symmetries while LDRS include deformed real-world symmetries. MIL works well at the simple cases such as Fig. 8a-(i) and Fig. 8b-(i), but it mostly fails with the complicated and textured objects. Sym-ResNet fails by missing the apparent symmetries in Fig. 8a-(i), adding irrelevant regions in Fig. 8b-(i), falsely detecting the nearby relevant regions in Fig. 8a-(ii) and Fig. 8b-(ii). In contrast, PMCNet successfully detects the well-defined symmetries in Fig. 8a-(ii-iv) and the complex cases in Fig. 8b-(ii-iv) where the other methods fail. Furthermore, PM + +![](images/347810e651c14b2e2160ed044eb25b339c4071b774ac68c9793ae4676b68ad83.jpg) +Figure 8. Qualitative results from the test splits of (a) SDRW and (b) LDRS datasets. + +CNet even detects symmetries of hierarchical patterns in Fig. 8a-(v) and thin object in Fig. 8b-(v), which were missed in the ground-truth annotations. PMCNet fails at detecting the ambiguous symmetries in Fig. 8a-(vi), multi-angled symmetries in Fig. 8b-(vi), and the symmetries at multiple scales in Fig. 8a-(vii) and Fig. 8b-(vii). + +PMCNet remains some limitations. The discrete and sparse bins of the polar descriptors might not fully represent the rotational freedom of the symmetry axis. Also, a single-level PMC with fixed polar window sizes is not capable of detecting the complex multi-scale symmetries. Improving the model considering aforementioned issues and collecting the larger dataset will be interesting for future work. + +# 5. Conclusion + +We have introduced the polar matching convolution (PMC) to discover reflection symmetry patterns. It effec + +tively learns to detect symmetry patterns by leveraging the high-dimensional matching kernel with the relational descriptors, achieving the state of the art on the SDRW reflection symmetry benchmark. The ablation studies demonstrate the effectiveness of the components of PMCNet - a polar feature pooling, a self-similarity encoding, and a systematic kernel design for axes of different angles. Further research on this direction can benefit different symmetry detection tasks and a wide range of problems related to symmetries. + +Acknowledgements. This work was supported by Samsung Advanced Institute of Technology (SAIT), the NRF grant (NRF-2017R1E1A1A01077999), and the IITP grant (No.2019-0-01906, AI Graduate School Program -POSTECH) funded by Ministry of Science and ICT, Korea. + +# References + +[1] Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. Patchmatch: A randomized correspondence algorithm for structural image editing. ACM Transactions on Graphics, 28(3):24, 2009. 2 +[2] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. CoRR, abs/1706.05587, 2017. 6 +[3] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2018. 1, 2 +[4] Minsu Cho and Kyoung Mu Lee. Bilateral symmetry detection via symmetry-growing. In Proceedings of the British Machine Vision Conference (BMVC), pages 1-11. CiteSeer, 2009. 2 +[5] M. Cicconet, V. Birodkar, M. Lund, M. Werman, and D. Geiger. A convolutional approach to reflection symmetry, 2016. New York. 5, 6, 7 +[6] Marcelo Ciconet, Davi Geiger, Kristin C Gunsalus, and Michael Werman. Mirror symmetry histograms for capturing geometric properties in images. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), pages 2981-2986, 2014. 2 +[7] Marcelo Cicconet, David GC Hildebrand, and Hunter Elliott. Finding mirror symmetry via registration and optimal symmetric pairwise assignment of curves. In IEEE International Conference on Computer Vision Workshop (ICCVW), pages 1749-1758, 2017. 2 +[8] Taco Cohen and Max Welling. Group equivariant convolutional networks. In Proceedings of the International Conference on Machine Learning (ICML), pages 2990-2999. PMLR, 2016. 1 +[9] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), 2009. 6 +[10] Mohamed Elawady, Olivier Alata, Christophe Ducottet, Cécile Barat, and Philippe Colantoni. Multiple reflection symmetry detection via linear-directional kernel density estimation. In Proceedings of the International Conference on Computer Analysis of Images and Patterns (CAIP), pages 344-355. Springer, 2017. 2, 6 +[11] Kunihiko Fukushima. Use of non-uniform spatial blur for image comparison: Symmetry axis extraction. Neural Network, 18(1):23-32, Jan. 2005. 2 +[12] Kunihiko Fukushima and Masayuki Kikuchi. Symmetry axis extraction by a neural network. Neurocomputing, 69(16):1827-1836, 2006. 2 +[13] Christopher Funk, Seungkyu Lee, Martin R Oswald, Stavros Tsogkas, Wei Shen, Andrea Cohen, Sven Dickinson, and Yanxi Liu. 2017 iccv challenge: Detecting symmetry in the wild. In IEEE International Conference on Computer Vision Workshop (ICCVW), pages 1692-1701, 2017. 5, 6 +[14] Christopher Funk and Yanxi Liu. Beyond planar symmetry: Modeling human perception of reflection and rotation sym + +metries in the wild. In Proceedings of the International Conference on Computer Vision (ICCV), pages 793-803, 2017, 1, 2, 5, 6, 7 +[15] Alon Halevy, Peter Norvig, and Fernando Pereira. The unreasonable effectiveness of data. IEEE Intelligent Systems, 24(2):8-12, 2009. 1 +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 6 +[17] Cornelius Hugo and Loy Gareth. Detecting bilateral symmetry in perspective. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2006. 2 +[18] Cornelius Hugo, Perdoch Michal, Matas Jiri, and Loy Gareth. Efficient symmetry detection using local affine frames. In Scandinavian Conference on Image Analysis (SCIA), 2007. 2 +[19] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2015. 6 +[20] Risi Kondor and Shubhendu Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. In Proceedings of the International Conference on Machine Learning (ICML), pages 2747-2755. PMLR, 2018. 1 +[21] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), pages 2980-2988, 2017. 5 +[22] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Proceedings of the European Conference on Computer Vision (ECCV), pages 740-755. Springer, 2014. 5, 6 +[23] Jingchen Liu, George Slota, Gang Zheng, Zhaohui Wu, Minwoo Park, Seungkyu Lee, Ingmar Rauschert, and Yanxi Liu. Symmetry detection from realworld images competition 2013: Summary and results. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 200-205, 2013. 2, 5, 6, 7 +[24] Yanxi Liu, Hagit Hel-Or, and Craig S Kaplan. Computational symmetry in computer vision and computer graphics. Now publishers Inc, 2010. 1 +[25] David G Lowe. Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision (IJCV), 60(2):91-110, 2004. 2 +[26] Gareth Loy and Jan-Olof Eklundh. Detecting symmetry and symmetric constellations of features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 508-521. Springer, 2006. 2, 7 +[27] David R Martin, Charless C Fowlkes, and Jitendra Malik. Learning to detect natural image boundaries using local brightness, color, and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 26(5):530-549, 2004. 6 + +[28] Rajendra Nagar and Shanmuganathan Raman. Symmmap: Estimation of the 2-d reflection symmetry map and its applications. In IEEE International Conference on Computer Vision Workshop (ICCVW), pages 1715-1724, 2017. 2 +[29] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems (NeurIPS), pages 8024-8035. Curran Associates, Inc., 2019. 7 +[30] Viorica Patraucean, Rafael Grompone von Gioi, and Maks Ovsjanikov. Detection of mirror-symmetric image patches. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 211-216, 2013. 2 +[31] Eli Shechtman and Michal Irani. Matching local self-similarities across images and videos. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), pages 1-8. IEEE, 2007. 4 +[32] Wei Shen, Kai Zhao, Yuan Jiang, Yan Wang, Zhijiang Zhang, and Xiang Bai. Object skeleton extraction in natural images by fusing scale-associated deep side outputs. In Proceedings of the International Conference on Computer Vision and Pattern Recognition (CVPR), pages 222-230, 2016. 7 +[33] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929-1958, 2014. 6 +[34] Sinha Sudipta N., Ramnath Krishnan, and Szeliski Richard. Detecting and reconstructing 3d mirror symmetric objects. In Proceedings of the European Conference on Computer Vision (ECCV), pages 586-600. Springer, 2012. 2 +[35] Ching L Teo, Cornelia Fermuller, and Yiannis Aloimonos. Detection and segmentation of 2d curved reflection symmetric structures. In Proceedings of the International Conference on Computer Vision (ICCV), pages 1644-1652, 2015. 7 +[36] Stavros Tsogkas and Iasonas Kokkinos. Learning-based symmetry detection in natural images. In Proceedings of the European Conference on Computer Vision (ECCV), pages 41-54. Springer, 2012. 2, 7 +[37] Kentaro Wada. labelme: Image Polygonal Annotation with Python. https://github.com/wkentaro/ labelme, 2016. 6 +[38] Johan Wagemans. Detection of visual symmetries. Spatial vision, 9(1):9-32, 1995. 1 +[39] Zhaozhong Wang, Zesheng Tang, and Xiao Zhang. Reflection symmetry detection using locally affine invariant edge correspondence. IEEE Transactions on Image Processing (TIP), 24(4):1297-1301, 2015. 2 +[40] Hermann Weyl. Symmetry princeton university press. Princeton, New Jersey, page 17, 1952. 1 \ No newline at end of file diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/images.zip b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d3d27d0cdf2ebc495c5da63c4fa42f42419f1e20 --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb32776c60b9525ab01309fda3df686c80cb1a4874c8f76ae352fa1209571b73 +size 680330 diff --git a/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/layout.json b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b14ab85b4cb999da4553d667696dee828250d84c --- /dev/null +++ b/learningtodiscoverreflectionsymmetryviapolarmatchingconvolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae8cdbdc4b634ea23ff33510b193b30ae4c8bd217f4103f2a13bbbd2a507d3b0 +size 429653 diff --git a/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_content_list.json b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5500dfab3e38f069ebef013112e1bc4862b2c261 --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:504c69f12c34f0eaaf5a6f9f3f77f166c9be58d43174515dbd6c3c727cdf6576 +size 73503 diff --git a/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_model.json b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..16fcfb2babd74ff6e5a8b8d3217b3a0501b045c5 --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d98636507bd7f9dbab09df390c1da5322c44bf6f3c69acbd13241defd5a6452c +size 92094 diff --git a/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_origin.pdf b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..46a1abade1679613751c3d1f8702784562a6e741 --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/75eae9fc-b583-488b-832c-c5978fc8b5b7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8af12112346a7b19e0fcd94c449d6abd9ec29a13ea9b32e7eaf0c13621ac771 +size 1600427 diff --git a/learningtodiversifyforsingledomaingeneralization/full.md b/learningtodiversifyforsingledomaingeneralization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d6ae0eb07c1ad7dad5bb5ef6b03dd24aa6de1089 --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/full.md @@ -0,0 +1,304 @@ +# Learning to Diversify for Single Domain Generalization + +Zijian Wang Yadan Luo Ruihong Qiu Zi Huang Mahsa Baktashmotlagh University of Queesland + +{zijian.wang, y.luo, r.qiu, m.baktashmotlagh} @uq.edu.au, huang@itee.uq.edu.au + +# Abstract + +Domain generalization (DG) aims to generalize a model trained on multiple source (i.e., training) domains to a distributionally different target (i.e., test) domain. In contrast to the conventional DG that strictly requires the availability of multiple source domains, this paper considers a more realistic yet challenging scenario, namely Single Domain Generalization (Single-DG), where only one source domain is available for training. In this scenario, the limited diversity may jeopardize the model generalization on unseen target domains. To tackle this problem, we propose a style-complement module to enhance the generalization power of the model by synthesizing images from diverse distributions that are complementary to the source ones. More specifically, we adopt a tractable upper bound of mutual information (MI) between the generated and source samples and perform a two-step optimization iteratively: (1) by minimizing the MI upper bound approximation for each sample pair, the generated images are forced to be diversified from the source samples; (2) subsequently, we maximize the MI between the samples from the same semantic category, which assists the network to learn discriminative features from diverse-styled images. Extensive experiments on three benchmark datasets demonstrate the superiority of our approach, which surpasses the state-of-the-art single-DG methods by up to $25.14\%$ . The code will be publicly available at https://github.com/BUserName/Learning_to_diversify + +# 1. Introduction + +The remarkable success of modern machine learning algorithms is built on the assumption that the source (i.e., training) and target (i.e., test) samples are drawn from similar distributions. In practice, this assumption is commonly violated by various factors, such as the changes of illuminations, object appearance, or background, which are known as the domain shift problem [36, 3]. Due to the discrepancy across domains, the performance of a model trained on the source domain can be significantly degraded when applied + +to the target domain. + +To tackle this problem, extensive research has been carried out mainly on domain adaptation and domain generalization. Domain adaptation aims to transfer the knowledge from the labeled source domain(s) to an unlabeled target domain [45, 1, 26, 13], while domain generalization attempts to generalize a model to an unseen target domain by learning from multiple source domains [34, 42, 10, 42]. Compared with domain adaptation, domain generalization (DG) is considered as a more challenging task as the target samples are not exposed in the training phase. Regarding different strategies for transferring knowledge from source domains to the unseen target domain, existing DG techniques can be subsumed under two broad categories, i.e., alignment-based [2, 11, 33] and augmentation-based [5, 17, 44, 50, 47]. Technically, alignment-based approaches aim to reach the consensus from multiple source domains and learn domain-invariant latent representations for the target domain. Augmentation-based approaches learn to augment the source images with different transformations or generate the pseudo-novel samples for each source domain. + +In general, the paradigm of DG relies on the availability of multiple source domains. However, it is more plausible to consider a more realistic scenario namely single domain generalization (Single-DG), where only one source domain is at hand during training. Despite DG has been extensively studied, single-DG remains under-explored. It is nontrivial for prior DG methods to handle this new setting, as the samples gathered from multiple sources and the domain identifiers are no longer accessible. Without the domain information to rely on, neither alignment-based nor augmentation-based models could well identify the domain-invariant features or transformations that are robust to unseen target domain shifts. Very recently, a few works [37, 49] are proposed that learn to add adversarial noises on the source images in order to train robust classifiers against unforeseen data shifts. While contributing positively to address the model vulnerability, the manipulated images are indistinguishable from the original source images, which are not sufficiently diverse to cover the real target distributions. + +To address the issue of insufficient diversity, in this paper, we propose a novel approach of Learning-to-diversify (L2D), which aims to improve the model generalization capacity by alternating diverse sample generation and discriminative style-invariant representation learning as illustrated in Figure 1. Specifically, we design a style-complement module, which learns to synthesize samples with unseen styles, which are out of original distributions. Different from previous augmentation approaches that quantify diversity with the Euclidean distance in the image space, we diversify the generated samples in the latent feature space. By explicitly posing a greater challenge on the trained classifier, the model resilience against the target shift is enhanced. We gradually enlarge the shift between the distributions of the generated samples and the source samples at the training time and perform the two-step optimization iteratively. By minimizing the tractable upper bound of mutual information for each sample pair, the generated images are forced to diversify from the source samples in subspace. Furthermore, to obtain the style-invariant features, we maximize the mutual information between the images belonging to the same semantic category. Consequently, the style-complement module and the task model compete in a min-max game, which improves the generalization ability of the task model by iteratively generating out-of-domain images and optimizing the style-invariant latent space. Note that, under this objective, the images generated by the proposed style-complement module will not only being diversified from the source ones, but also can be considered as challenging samples to the task model. + +The main contributions of our work are summarized as follows. + +- We propose a style-complement module that addresses the single domain generalization by learning to generate diverse images. +- A min-max mutual information optimization strategy is designed to gradually enlarge the distribution shift between the generated and the source images, while simultaneously bringing the samples from the same semantic category close in the latent space. +- To validate the effectiveness of the proposed method, extensive experiments are conducted on three benchmark datasets, including digits recognition, corrupted CIFAR-10, and PACS. We further show the effectiveness of our approach in the standard DG setting under the leave-one-domain-out protocol. The results clearly demonstrate that our method surpasses the state-of-the-art DG and Single-DG methods on all datasets. + +# 2. Related Work + +Domain Shift. Most of the existing machine learning methods suffer from performance degradation when the source (i.e. training) domain and the target (i.e. test) domain follow different distributions. The difference between the distributions is termed as the domain shift [36, 8]. In computer vision applications, such a shift may be brought by but not limited to environment and style changes. To this problem, domain adaptation (DA) approaches have been proposed to minimize the domain shift across the domains by matching the marginal [26, 13, 1] or conditional distributions [27, 29] of the source and target domains. Domain adaptation has been widely studied in various settings, such as semi-supervised [18, 38, 46] and unsupervised scenarios [26, 28], which leverage the partially labelled or unlabelled target domain in the training process. More recently, few-shot DA [32] is proposed, where only a few labelled target samples together with source samples are available in the training phase. + +Domain Generalization. The most significant difference between domain adaptation (DA) and domain generalization (DG) is that DG does not require access to the target domain in the training phase. Existing DG methods can be rough classified into two categories of learning the domain invariant representation and data augmentation. The key idea behind the former category is to reduce the discrepancy between representations of multiple source domains. Muandet et al. [34] first proposed a kernel-based method to obtain domain invariant features. [14] learns the latent invariant representation by jointly considering the domain reconstruction task. [33] further introduces a contrastive semantic alignment loss, which encourages the intra-class similarity and inter-class difference. Li et al. proposed to reduce the gap across the domains by minimizing Maximum Mean Discrepancy (MMD) under adversarial autoencoder framework. [44] aims to learn a domain agnostic representation by enforcing an orthogonal constrain on textural information of images and the corresponding latent representations. Recently, meta-learning procedure has been studied to solve DG problem [10, 24, 11]. Li et al. put forward a gradient-based model agnostic meta-learning algorithm for DG. Dou et al. [10] exploits the episodic training scheme to enforce the global and local alignment. [11] incorporates variational information bottleneck with meta-learning to narrow the domain gap between the source domains. + +The other category is related to data augmentation. This line of work generally aims to generate out-of-domain samples, which are then used to train the network along with the source samples to improve the generalization ability. For instance, [42] exploits the adversarial training scheme to generate 'hard' samples for the classifier. Shankar et al. [39] proposed to augment the source samples along the direction of the domain change. [50] exploits a conditional gener + +![](images/28728870cee0b837f918502ab4015e38af770b57600059725d679f8e5a421457.jpg) +Figure 1: The overall framework of the proposed Learning-to-diversify (L2D). L2D alternatively trains the style-complement module $G(\cdot; \theta_G)$ and the task model $F(\cdot; \theta_F)$ , $q(\cdot; \theta_q)$ , and $H(\cdot; \theta_H)$ . Specifically, (1) the upper bound of mutual information (MI) is minimized between the source and generated images, and (2) MI among samples belonging to the same category is maximized. It enhances the generalization power of the task model in an adversarial min-max manner. + +ative adversarial network (GAN) to synthesize data from pseudo-novel domain. [5] is considered as another type of augmentation, which exploits an auxiliary self-supervision training signal from solving a jigsaw puzzle to improve the generalization ability of the classifier. + +This paper focuses on a more challenging yet realistic setting, namely single domain generalization [37, 49]. In Single-DG, the network is trained on a single source domain, while it is evaluated on multiple unseen domains. Gradient-based image augmentation is an effective strategy for Single-DG. [37] improves the ADA by encouraging semantic consistency between the augmented and source images in the latent space via an auxiliary Wasserstein autoencoder. [49] considers entropy maximization in the adversarial training framework to generate challenging perturbations of the source samples. In all the aforementioned approaches for Single-DG, the visual differences between the source and generated images are mostly depicted in the color and texture of the augmented samples. Different from existing Single-DG methods, our method aims to generate diverse samples with novel style/texture/appearance having a larger shift from the source distribution, and thus can be considered as complementary to the source data distribution. + +# 3. Methodology + +Given a source domain $S = \{x_i, y_i\}_{i=1}^N$ of $N$ samples, the goal of single domain generalization is to learn a model that can generalize to many unseen target domains $\mathcal{T}$ . With no prior knowledge on the target domain, we propose a + +style-complement module $G(\cdot; \theta_G) : x \to x^+$ to augment the source domain by synthesizing the $x^+$ that shares the same semantic information with the source image $x$ , albeit with different styles. As shown in Figure 1, we firstly apply the feature extractor $F(\cdot; \theta_F)$ to transform images $x$ and $x^+$ to latent vectors $z$ and $z^+$ . To diversify the generated features from the source samples, the MI upper bound approximation for each pair $z$ and $z^+$ is minimized to learn $G$ ; subsequently, we freeze $G$ and maximize MI between the $z$ and $z^+$ from the same semantic category, which assists the task network $F$ and classifier $H(\cdot; \theta_H)$ parameterized by $\theta_H$ to learn discriminative features from diverse-styled images. + +Style-Complement Module. The style-complement module $G(\cdot; \theta_G)$ consists of $K$ transformations, each of which is comprised of a convolutional layer, a style learning layer, and a transposed convolutional layer. By applying the convolution operations, the source images are projected from the original distribution to a novel distribution with arbitrary style shift. We further enhance the diversity of the generated samples by creating the style shift at the pixel level. Specifically, we add learnable parameters $\theta_{G,k} = \{\mu_k, \sigma_k\}$ for each of the $k$ transformations, where the learnable parameters $\mu_k, \sigma_k \in \mathbb{R}^{h * w * c}$ are the mean shift and variance shift. More concretely, we have: + +$$ +T \left(f _ {i, k}; \theta_ {G, k}\right) = \sigma_ {k} * \frac {f _ {i , k} - \mu}{\sigma} + \mu_ {k}, \tag {1} +$$ + +where $f_{i,k} \in \mathbb{R}^{h * w * c}$ is the output of the convolutional operation applied on $x_{i}$ in the $k$ -th transformation, with $h, w$ + +and $c$ representing the height, width, and channel, respectively. $\mu$ and $\sigma$ correspond to the mean and covariance of the $f_{i,k}$ . The transformed feature map $f_{i,k}^{\prime} = T(f_{i,k};\theta_{G,k})$ are then applied with the transposed convolutional operation to reconstruct to the original image dimension of $x$ . The final outcome $x_{i}^{+}$ of the style-complement module is the linear combination of the augmented images $x_{i,k}^{+}$ obtained from $k$ -th transformation: + +$$ +x _ {i} ^ {+} = \frac {1}{\sum_ {k = 1} ^ {K} \left(w _ {k}\right)} \sum_ {k = 1} ^ {K} \left(w _ {k} \sigma \left(x _ {i, k} ^ {+}\right)\right), \tag {2} +$$ + +$$ +w _ {k} \sim N o r m a l (0, 1) +$$ + +where $w_{k}$ is a scalar sampled from a normal distribution and weights the contribution of augmented image $x_{i,k}$ from the transformation $k$ to the output augmented image $x_{i}^{+}$ . We apply the activation function $\sigma(\cdot)$ , e.g. $\tanh$ , to scale $x_{i}^{+}$ . + +Synthesizing Novel Styles. The objective of the style-complement module is to generalize from the source domain distribution to the out-of-domain distribution. To increase the diversity of the created styles, the correlation between the generated images and the source images should be minimized. Mutual information (MI) $I(z;z^{+})$ serves as a measure of quantifying the correlation of $z$ and $z^{+}$ , which is defined as: + +$$ +I (z; z ^ {+}) = \mathbb {E} _ {p (z, z ^ {+})} \left[ \log \frac {p (z ^ {+} \mid z)}{p (z ^ {+})} \right] \tag {3} +$$ + +We minimize the mutual information (MI) between the source and generated images in the latent feature space $\mathbb{Z}$ , achieved by passing images through $F(\cdot ;\theta_F)$ . The upper bound of MI defined in [7] is: + +$$ +I (z; z ^ {+}) \leq \mathbb {E} _ {p (z, z ^ {+})} [ \log p (z ^ {+} | z) ] - \mathbb {E} _ {p (z) p (z ^ {+})} [ \log p (z ^ {+} | z) ], \tag {4} +$$ + +where $z$ and $z^{+}$ are the respective latent vectors of the source image $x$ and the generated image $x^{+}$ . + +Since the conditional distribution $p(z^{+}|z)$ is intractable, the upper bound of $I(z;z^{+})$ cannot be directly minimized. Therefore, we adopt a variational distribution $q(z^{+}|z)$ , that employs a neural network parameterized by $\theta_{q}$ to approximate the upper bound $\hat{I}(z;z^{+})$ of mutual information: + +$$ +\hat {I} (z; z ^ {+}) = \frac {1}{N} \sum_ {i = 1} ^ {N} \left[ \log q _ {\theta} \left(z _ {i} ^ {+} \mid z _ {i}\right) - \frac {1}{N} \sum_ {j = 1} ^ {N} \log q _ {\theta} \left(z _ {j} ^ {+} \mid z _ {i}\right) \right] \tag {5} +$$ + +By minimizing Eq. (5), the learnable mean/variance shift parameters in our model are trained to complement the style of the source domain. Although $\hat{I} (z;z^{+})$ is no longer an upper bound for MI as the conditional distribution $p(z^{+}|z)$ is substituted with a variational approximation $q_{\theta}(z^{+}|z)$ , $\hat{I} (z;z^{+})$ can be a reliable upper bound estimator if the difference between the two distributions is small. Specifically, + +we estimate the difference $\Delta$ between $\hat{I}(z;z^{+})$ and the upper bound of $I(z;z^{+})$ by using the Kullback-Leibler divergence (KLD): + +$$ +\begin{array}{l} \Delta = K L D (p \left(z ^ {+}, z\right) \| q _ {\theta} \left(z ^ {+}, z\right)) \\ = \mathbb {E} _ {p (z, z ^ {+})} [ \log (p (z ^ {+} | z) p (z)) - \log (q _ {\theta} (z ^ {+} | z) p (z)) ] \\ = \mathbb {E} _ {p (z, z ^ {+})} [ \log p (z ^ {+} | z) ] - \mathbb {E} _ {p (z, z ^ {+})} [ \log q _ {\theta} (z ^ {+} | z) ]. \tag {6} \\ \end{array} +$$ + +The above equation shows that the difference $\Delta$ is affected by two terms. Since the first term of Eq. 6 is not related to $\theta_{q}$ , we minimize the negative log-likelihood between $z_{i}$ and $z_{i}^{+}$ instead of directly minimizing $\Delta$ : + +$$ +L _ {\text {l i k e l i}} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \log q _ {\theta} \left(z _ {i} ^ {+} \mid z _ {i}\right). \tag {7} +$$ + +Semantic Consistency. While the style-complement module can generate images with diverse styles, it may introduce noise or generate images with distorted semantic information from original source images (e.g., when the variance shift $\sigma_{k}$ equals to 0, the generated images will become meaningless). Therefore, it is important to limit the conditional distribution shift from the source distribution to the out-of-domain distribution, thereby avoiding generating semantically unrelated images. To achieve this, we minimize the class-conditional maximum mean discrepancy (MMD) in the latent space as follows, + +$$ +L _ {\text {c o n s t}} = \frac {1}{C} \sum_ {m = 1} ^ {C} \left(\| \frac {1}{n _ {s} ^ {m}} \sum_ {i = 1} ^ {n _ {s} ^ {m}} \phi \left(z _ {i} ^ {m}\right) - \frac {1}{n _ {t} ^ {m}} \sum_ {i = 1} ^ {n _ {t} ^ {m}} \phi \left(z _ {j} ^ {m +}\right) \| ^ {2}\right), \tag {8} +$$ + +where $z_{i}^{m}$ and $z_{i}^{m + }$ are the $i$ -th latent vector of the source and augmented sample of the class $m$ , respectively. $n_{s}^{m}$ and $n_{t}^{m}$ are the total number of original and augmented sample of class $m$ . $\phi(\cdot)$ represents the kernel function. Conditional MMD mitigates the potential semantic information distortion by constraining the distribution shift of samples that belong to the same class. + +MI Maximization. We aim to obtain a generalizable and robust model by playing a min-max game between the style-complement module $G(\cdot;\theta_G)$ and the task model $F(\cdot;\theta_F)$ . While the style-complement module aims to generate diverse images that have minimum information on the source images, the task model can cluster images with same semantic label in the embedding space. The lower bound on MI between two variables proposed in [40] is: + +$$ +I (z; z ^ {+}) \geq \mathbb {E} \left[ \frac {1}{N} \sum_ {i = 1} ^ {N} \log \frac {e ^ {f (z , z ^ {+})}}{\sum_ {j = 1} ^ {N} e ^ {f \left(z _ {i} , z _ {j} ^ {+}\right)}} \right], \tag {9} +$$ + +where $f(\cdot ,\cdot)$ is a critic function. + +However, directly maximizing the lower bound MI of the generated and source images without leveraging the semantic label may falsely reduce the shared information of same class samples. To alleviate this problem, we employ the supervised contrastive loss [19] to increase the mutual information among samples from the same class, defined as: + +$$ +\begin{array}{l} L _ {s u p c o n} = - \sum_ {i = 0} ^ {N} \frac {1}{| P (i) |} \sum_ {p \in P (i)} \log \frac {e ^ {(z _ {i} \cdot z _ {p} / \tau)}}{\sum_ {a \in A (i)} e ^ {(z _ {i} \cdot z _ {a} / \tau)}} \\ P (i) = \{p \in A (i): y _ {p} = y _ {i} \}, \tag {10} \\ \end{array} +$$ + +where $A(i)$ is the set of the source and generated latent representations $z, z^{+}$ of the same class. $\tau$ is the temperature coefficient. + +To further enhance the semantic consistency, we minimize the cross-entropy loss on both the source images $X$ and the generated images $X^{+}$ : + +$$ +L _ {t a s k} = - \frac {1}{2 N} \left[ \sum_ {i = 0} ^ {N} y _ {i} \log \left(\hat {y} _ {i}\right) + \sum_ {j = 0} ^ {N} y _ {j} ^ {+} \log \left(\hat {y} _ {j} ^ {+}\right) \right], \tag {11} +$$ + +where $\hat{y}$ and $\hat{y}^{+}$ are the prediction of the source and generated images, respectively. + +Objective Function. We adopt a two-step training, in which we optimize the style-complement module $G(\cdot ;\theta_{G})$ and a task model, including $F(\cdot ;\theta_{F}), q(\cdot ;\theta_{q})$ and $H(\cdot ;\theta_{H})$ in an iterative manner. Specifically, we train the task module $F$ with both the source images $X$ and the generated images $X^{+}$ with the weighted combination of Eq. (5), (7), and (11) as follows: + +$$ +\min _ {\theta_ {F}, \theta_ {q}, \theta_ {H}} L = L _ {\text {t a s k}} + \alpha_ {1} L _ {\text {s u p c o n}} + \alpha_ {2} L _ {\text {l i k l i}}. \tag {12} +$$ + +Notably, $\alpha_{1}$ and $\alpha_{2}$ are the hyper-parameters for balancing the losses. To optimize $G$ , we consider solving Eq. (5) and (8) jointly: + +$$ +\min _ {\theta_ {G}} L = \hat {I} (z; z ^ {+}) + \beta L _ {\text {c o n s t}}, \tag {13} +$$ + +with $\beta$ being the balancing weight between the mutual information upper bound estimation $\hat{I}(z;z^{+})$ and semantic consistent loss $L_{const}$ . + +Implementation Notes: To capture multi-scale information from images, we apply different transformations (i.e., kernel sizes) in the convolution and transposed convolution layers. Moreover, to avoid potential distortion of the semantic information, we fix the number of output channels to the number of input color channels (i.e., 3 output channels for RGB images). We re-initialize the weights of the convolutional layer and transposed convolutional layer by sampling from uniform distribution of $\left(-\frac{1}{\sqrt{\text{size}(\text{kernel})}}, \frac{1}{\sqrt{\text{size}(\text{kernel})}}\right)$ in each iteration. + +Table 1: Single domain generalization accuracy (%) comparison on digits dataset. Models are trained on MNIST and evaluated on the rest of the digits datasets. Best performances are highlighted in bold. + +
SVHNMNIST-MSYNUSPSAvg.
ERM27.8352.7239.6576.9449.29
CCSA25.8949.2937.3183.7249.05
d-SNE26.2250.9837.8393.1652.05
JiGen33.8057.8043.7977.1553.14
ADA35.5160.4145.3277.2654.62
M-ADA42.5567.9448.9578.5359.49
ME-ADA42.5663.2750.3981.0459.32
Ours62.8687.3063.7283.9774.46
+ +# 4. Experiments + +Datasets. To evaluate the effectiveness of the proposed method, we conduct experiments over three single-dg benchmark datasets. Digits consists of 5 different datasets, which are MNIST[22], SVHN[35], MNISTM[12], SYN[12] and USPS[9]. Each dataset is considered as a unique domain which may be different from the rest of the domains in font style, background, and stroke color. PACS [23] is a recent proposed DG benchmark dataset that has four domains, including photo, art painting, cartoon, and sketch. Each domain contains $224 \times 224$ images belonging to seven categories, and there are 9,991 images in total. Compared with the digits dataset, PACS is considered as a more challenging dataset due to the large style shift among domains. For fair comparison, we follow the official split of the train, validation, and test. Corrupted CIFAR-10 [16, 20] contains $32 \times 32$ tiny RGB images from CIFAR-10 that are corrupted by different types of noises. There are 15 corruptions from 4 main categories, including weather, blur, noise, and digital. Each of the corruptions has 5 levels serverities and '5' indicates the severest corruption. + +# 4.1. Comparisons on Digits + +Experiment Setup. Following [42, 37, 49], we select 10,000 images from MNIST as the source domain and test the generalization performance of models on the other four digits datasets. We resize all the images to $32 \times 32$ and duplicate their channels to convert all the grayscale images to RGB. We employ the LeNet [22] as the backbone and set the batch size as 32. We use SGD to optimize both the style-complement module and the task model. + +Results. Table 1 shows that our model achieves the highest average accuracy compared to the other baselines. Specifically, we observe clear improvements of $20.3\%$ , $29.36\%$ , $13.33\%$ and $14.9\%$ on SVHN, MNIST-M, SYN, and overall accuracy, respectively. Previous Single-DG methods di + +Table 2: Single domain generalization accuracy (\%). Models are trained on CIFAR-10 dataset and evaluated on CIFAR-10-C dataset with corruption severity level 5. We report the average accuracy over 4 main categories of corruption: Weather, Blur, Noise, and Digital. Best performances are highlighted in bold. * indicates our implementation. + +
WeatherBlurNoiseDigitsAvg.
ERM67.2856.7330.0262.3054.08
CCSA67.6657.8128.7361.9654.04
d-SNE67.9056.5933.9761.8355.07
ADA*72.6767.0439.9766.6261.58
M-ADA75.5463.7654.2165.1064.65
ME-ADA*74.4471.3766.4770.8370.77
Ours75.9869.1673.2972.0272.61
+ +rectly generate the auxiliary training samples by applying the adversarial perturbation. Compared to the adversarial gradient-based methods, L2D creates larger domain shifts between the generated images and the source images by incorporating the style-complement module. The substantial increase of the accuracy over the baselines demonstrates the importance of generating diverse-styled images on improving the generalization power of a model. Moreover, we observe that single-DG methods generally achieve better performance in this task, reflecting the dependency of previous DG methods on multiple source domains to learn a generalizable model. Our method achieves the second best performance on USPS. We infer this might be related to the fact the USPS and the source domain MNIST share very similar stroke styles. In such case, the diverse generated images might not benefit the generalizability of the model as much as the task with a larger domain shift. + +# 4.2. Comparisons on Corrupted CIFAR-10 + +Experiment Setup. We train all models on the training split of CIFAR-10 dataset (50,000 images) and evaluate them on the corrupted test split of CIFAR-10 (10,000 images). Following [37], we select WideResNet (16-4) [48] as the backbone network with a batch size of 256. We optimize the model by using SGD with Nesterov momentum and weight decay rate of 0.0005. The learning rate is initialized to 0.2 which is gradually decreased by using the cosine annealing scheduler. + +Results. We report the average accuracy of four categories under level-5 severity corruption in Table 2. Our method achieves the highest average performance, surpassing the best baseline by approximately $2.6\%$ . Notably, for noise corruptions, accuracy is significantly improved by approximately $13.2\%$ . We also report the performance of methods against all five levels of Noise corruption and Digits corruption in Figure 3. From the figure, we can see that the perfor + +Table 3: Single domain generalization accuracy $(\%)$ on PACS. Models are trained on photo and evaluated on the rest of the target domains (i.e., art painting, cartoon, and sketch). The comparison is based on our implementation. Best performances are highlighted in bold. + +
ACSAvg.
ERM54.4342.7442.0246.39
JiGen54.9842.6240.6246.07
RSC56.2639.5947.1347.66
ADA58.7245.5848.2650.85
ME-ADA58.9644.0949.9651.00
Ours w/o Style-comp.53.2741.0041.9245.39
Ours w/o Mod.58.4848.9653.2053.54
Ours w/o Min. MI56.4948.0856.3253.63
Ours w/o Max. MI56.6447.0849.6851.13
Ours (Full Model)56.2651.0458.4255.24
+ +mance margin between our method and others are relatively small under severity level one, and it is gradually enlarged while the severity level goes up. This further validates that our model not only can achieve the highest average performance, but also is resilient towards the severe corruptions. + +# 4.3. Comparisons on PACS + +Experiment Setup. For the single domain generalization task, we consider a practical case, where we utilize a set of easy-to-collect realistic images (i.e., photo) as the source domain, and evaluate models on the rest of diverse-styled domains (i.e., art painting, cartoon, and sketch). AlexNet [21] is employed as the backbone which is pretrained on ImageNet and finetuned on the source domain. We also evaluate the effectiveness of our approach on PACS under the standard leave-one-domain-out protocol, where one domain is selected as the test domain and the rest are treated as the source domain. We employ pretrained Alexnet and ResNet-18 [15] as the backbone networks for the leave-one-domain-out setting. Please refer to the supplementary material for more implementation details. + +Results. From Table 3, we can see that our method can achieve the best average classification accuracy compared to the baselines. Importantly, our method can achieve a relatively large performance margin over other methods on the sketch domain, which has the largest domain shift from photo due to its highly abstracted shapes. This result verifies that our method takes the advantage of diverse style images that are generated by the style-complement module. + +To further validate the performance of our method, we conduct the leave-one-domain-out domain generalization task on PACS. We compare our approach with the two categories of recent state-of-the-art DG methods. The first category, including DSN [4], Fusion [30], MetaReg [2], Epi + +![](images/f33a96556a2b8367ca59f78e8f8a72d36c94b8940ca285ff4018387958bc5d5e.jpg) +(a) + +![](images/2a37b3a6f06cfaf7622ce4d79aa31ea21d7e6a2a8a881e256c54f766f3a811ad.jpg) +(b) +Figure 2: Sensitivity analysis of L2D with respect to parameters $k$ , $\alpha_{1}$ , and $\alpha_{2}$ on the PACS dataset. The reported accuracy is the averaged over all three unseen target domains. + +![](images/7a8e399db42ef96cf549ed0dd1744c42f0ab279915db445e14707e0eaff340a8.jpg) +(c) + +![](images/94703965e9717b7246cee1cb426cc261ee92a187f935809bd313962bd740456f.jpg) +(a) Noise +Figure 3: Average classification accuracy $(\%)$ of different methods under five levels of severity on Noise and Digital corruptions. + +![](images/2cd79de4c9a96f77c1a5ee48b4ba89f5858b08a3214aed4345b938126666ddda.jpg) +(b) Digital + +FCR [25], MASF [10] and DMG [6], requires domain identifications in the training phase. Methods in the second category are inline with a more realistic mixed latent domain setting [31], where domain identifiers are unavailable in the training phase. AGG [25], HEX [44], PAR [43], JiGen [5], ADA [42], MEADA [49], MMLD [31] and our method belong to the latter category. We report the results with different backbone networks in Table 4. Without leveraging the domain identifier, our method can still achieve the state-of-the-art performance on the leave-one-domain-out generalization task on PACS. In the training stage, the image augmentation module gradually enlarges the domain shift between the generated images and the source images. + +# 4.4. Empirical Analysis + +Ablation Study. We conduct the ablation study on PACS dataset to verify the effectiveness of each component in our framework. Table 3 reports the classification results of the 4 variants of our original framework. We report the baseline result without incorporating the style-complement module as w/o Style-comp.. Without the generated images, the model is degraded to the backbone model with a variational approximation of $z$ in the embedding space. The large performance margin between w/o Style-comp. and + +Table 4: Leave-one-domain-out classification accuracy(%) on PACS. Best performances are highlighted in bold. + +
D_IDPACSAvg.
AlexNet
DSN✓83.3061.1066.5058.6067.40
Fusion✓90.2064.1066.8060.1070.30
MetaReg✓87.4063.5069.5059.1069.90
Epi-FCR✓86.1064.7072.3065.0072.00
MASF✓90.6870.3572.4667.3375.21
DMG✓87.3164.6569.8871.4273.32
HEX✗87.9066.8069.7056.2070.20
PAR✗89.6066.3066.3064.1072.08
JiGen✗89.0067.6371.7165.1873.38
ADA✗85.1064.3069.8060.4069.90
MEADA✗88.6067.1069.9063.0072.20
MMLD✗88.9869.2772.8366.4474.38
Ours✗90.9671.1972.1867.6875.50
ResNet-18
Epi-FCR✓93.9082.1077.0073.0081.50
MASF✓94.9980.2977.1771.6881.03
DMG✓93.5576.9080.3875.2181.46
Jigen✗96.0379.4275.2571.3580.51
ADA✗95.6178.3277.6574.2181.44
MEADA✗95.5778.6178.6575.5982.10
MMLD✗96.0981.2877.1672.2981.83
Ours✗95.5181.4479.5680.5884.27
+ +our full model demonstrates the importance of the style-complement module on improving the generalization ability of the model. w/o Mod. shows the result after removing the style modification from the full model. The removal of the style modification triggers $1.35\%$ absolute performance decline. We infer this relates to the limited style diversity of the generated images. + +To provide an understanding of how mutual information affects the learning framework, in $w / o$ Min. MI and $w / o$ + +![](images/6ad88bf74598a6f3fdbdb37c921f0596294c3a2c6036009323e72fd5af658a91.jpg) +(a) ERM + +![](images/88c8345d5bf45b68a67b348bedc9d243a0a88feb7cdb6424d7accfcb55577d31.jpg) +(b) ADA + +![](images/ba48077f08d05017e77651be5bc8a138afdb0e6bc90c9612be937f5ac33985e5.jpg) +(c) ME-ADA +Figure 4: The t-SNE visualizations of extracted unseen target feature distribution for different methods on digits Single-DG task. Features with the same semantic label are plotted in the same color. + +![](images/7d83f793233e03547d090a85d3f77e8cebfb74a1a024466d81f442e08a6a9d84.jpg) +(d) OURS + +Max. MI, we remove the mutual information minimization and maximization process, respectively. We observe the accuracy of $w / o$ Min. MI is $1.26\%$ lower than the full model which is similar to the results of $w / o$ Mod.. That means, without the mutual information constraint term, the style-complement module tends to generate images by following the source distribution, which limits their diversity. Meanwhile, without the mutual information maximization process, $w / o$ Max. MI a clear performance margin of $3.76\%$ is shown compared to the full model. This indicates that mapping diverse styled images from the same class closer in the embedding space is helpful for improving the generalization power of the model. + +Parameter Sensitivity. To validate the significance of the total number of transformations $k$ , and weighting parameters $\alpha_{1}$ , and $\alpha_{2}$ in the loss, we conduct sensitivity analysis on PACS dataset. In the experiments, we initially set $k = 6$ , $\alpha_{1} = 1$ , and $\alpha_{2} = 1$ . When we analyze the sensitivity to a specific parameter, we fix the values of the other two parameters. Figure 2 shows the results of sensitivity analysis under the Single-DG setting. From Figure 2(a), we can see that the performance is gradually increasing as the style-complement module combines more transformations. Also, the average performance becomes relatively stable after $k = 5$ . The results also indicate that jointly considering multiple transformations increases the diversity of the generated images. Meanwhile, excessive transformations might produce extra noise, which hinders the further performance gain. As can be seen from Figure 2(b) and (c), our method surpasses the state-of-the-art performance in a wide range of $\alpha$ settings, and achieves the best classification accuracy with $\alpha_{1} = \alpha_{2} = 1$ . + +t-SNE Visualizations. To further demonstrate the effectiveness of the proposed method, we use t-SNE [41] to visualize the distribution of the unseen target features in the digits dataset (i.e., SVHN, SYN, USPS and MNIST-M). Specifically, we train different models on MNIST and randomly + +select 1000 samples from each unseen target domains to visualize. As shown in Fig. 4, our method clearly achieve better class-wise separation than the baselines. Moreover, from the distribution of features extracted by ERM, ADA and ME-ADA, we observe that the features within the same class can have multiple sub-clusters. This indicates that it is hard for the methods to learn domain invariant representations and the large intra-class variations may hinder them obtaining a clear decision boundary on the targets. In contrast, it is clearly seen that our approach creates tighter clusters with a good class-wise mix compared to the baselines. This strongly supports the idea of diverse image generation and the maximization of mutual information among the samples from the same class. + +# 5. Conclusion + +This paper presented Learning-to-Diversify (L2D), a novel approach to address single domain generalization. Unlike previous domain generalization methods which exploit multiple source domains to learn domain invariant representations, the proposed approach designs a style-complement module to generate diverse out-of-domain images from single source domain. An iterative min-max mutual information (MI) optimization strategy is used to boost the generalization power of the model. The tractable MI upper bound is minimized to further enhance the diversity of the generated image, while MI among same category samples is maximized to obtain the style-invariant representations in the maximization step. Extensive experiments on three benchmark datasets demonstrate that the proposed method outperforms the state-of-the-art methods on both single domain generalization and the standard leave-one-domain-out domain generalization. + +Acknowledgement This work was supported by Australian Research Council (ARC DP190102353, and CE200100025) + +# References + +[1] Mahsa Baktashmotlagh, Mehrtash Tafazzoli Harandi, Brian C. Lovell, and Mathieu Salzmann. Unsupervised domain adaptation by domain invariant projection. In ICCV, 2013. +[2] Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using metaregularization. In NeurIPS, 2018. +[3] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Mach. Learn., 2010. +[4] Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In NeurlPS, 2016. +[5] Fabio Maria Carlucci, Antonio D'Innocente, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. Domain generalization by solving jigsaw puzzles. In CVPR, 2019. +[6] Prithvijit Chattopadhyay, Yogesh Balaji, and Judy Hoffman. Learning to balance specificity and invariance for in and out of domain generalization. In ECCV, 2020. +[7] Pengyu Cheng, Weituo Hao, Shuyang Dai, Jiachang Liu, Zhe Gan, and Lawrence Carin. CLUB: A contrastive log-ratio upper bound of mutual information. In ICML, 2020. +[8] Gabriela Csurka. A comprehensive survey on domain adaptation for visual applications. In Domain Adaptation in Computer Vision Applications. 2017. +[9] John S. Denker, W. R. Gardner, Hans Peter Graf, Donnie Henderson, Richard E. Howard, Wayne E. Hubbard, Lawrence D. Jackel, Henry S. Baird, and Isabelle Guyon. Neural network recognizer for hand-written zip code digits. In NeurIPS, 1988. +[10] Qi Dou, Daniel Coelho de Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain generalization via model-agnostic learning of semantic features. In NeurIPS, 2019. +[11] Ying-Jun Du, Jun Xu, Huan Xiong, Qiang Qiu, Xiantong Zhen, Cees G. M. Snoek, and Ling Shao. Learning to learn with variational information bottleneck for domain generalization. In ECCV, 2020. +[12] Yaroslav Ganin and Victor S. Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015. +[13] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor S. Lempitsky. Domain-adversarial training of neural networks. J. Mach. Learn. Res., 2016. +[14] Muhammad Ghifary, W. Bastiaan Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for object recognition with multi-task autoencoders. In ICCV, 2015. +[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +[16] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. *ICLR*, 2019. +[17] Zeyi Huang, Haohan Wang, Eric P. Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In ECCV, 2020. + +[18] Hal Daumé III, Abhishek Kumar, and Avishek Saha. Coregularization based semi-supervised domain adaptation. In NeurIPS, 2010. +[19] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In NeurIPS, 2020. +[20] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[21] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012. +[22] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. +[23] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Deeper, broader and artier domain generalization. In ICCV, 2017. +[24] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Learning to generalize: Meta-learning for domain generalization. In AAAI, 2018. +[25] Da Li, Jianshu Zhang, Yongxin Yang, Cong Liu, Yi-Zhe Song, and Timothy M. Hospedales. Episodic training for domain generalization. In ICCV, 2019. +[26] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In ICML, 2015. +[27] Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I. Jordan. Conditional adversarial domain adaptation. In NeurIPS, 2018. +[28] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I. Jordan. Deep transfer learning with joint adaptation networks. In ICML, 2017. +[29] Yadan Luo, Zijian Wang, Zi Huang, and Mahsa Baktashmotlagh. Progressive graph learning for open-set domain adaptation. In ICML, 2020. +[30] Massimiliano Mancini, Samuel Rota Bulò, Barbara Caputo, and Elisa Ricci. Best sources forward: Domain generalization through source-specific nets. In ICIP, 2018. +[31] Toshihiko Matsuura and Tatsuya Harada. Domain generalization using a mixture of multiple latent domains. In AAAI, 2020. +[32] Saeid Motiian, Quinn Jones, Seyed Mehdi Iranmanesh, and Gianfranco Doretto. Few-shot adversarial domain adaptation. In NeurIPS, 2017. +[33] Saeid Motiian, Marco Piccirilli, Donald A. Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In ICCV, 2017. +[34] Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In ICML, 2013. +[35] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011. +[36] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Trans. Knowl. Data Eng., 2010. + +[37] Fengchun Qiao, Long Zhao, and Xi Peng. Learning to learn single domain generalization. In CVPR, 2020. +[38] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, and Kate Saenko. Semi-supervised domain adaptation via minimax entropy. In ICCV, 2019. +[39] Shiv Shankar, Vihari Piratla, Soumen Chakrabarti, Siddhartha Chaudhuri, Preethi Jyothi, and Sunita Sarawagi. Generalizing across domains via cross-gradient training. In ICLR, 2018. +[40] Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018. +[41] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. J. Mach. Learn. Res., 2008. +[42] Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C. Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. In NeurIPS, 2018. +[43] Haohan Wang, Songwei Ge, Zachary C. Lipton, and Eric P. Xing. Learning robust global representations by penalizing local predictive power. In NeurIPS, 2019. + +[44] Haohan Wang, Zexue He, Zachary C. Lipton, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In ICLR, 2019. +[45] Mei Wang and Weihong Deng. Deep visual domain adaptation: A survey. Neurocomputing, 2018. +[46] Zijian Wang, Yadan Luo, Zi Huang, and Mahsa Baktashmotlagh. Prototype-matching graph network for heterogeneous domain adaptation. In MM, 2020. +[47] Zhenlin Xu, Deyi Liu, Junlin Yang, Colin Raffel, and Marc Niethammer. Robust and generalizable visual representation learning via random convolutions. In ICLR, 2021. +[48] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016. +[49] Long Zhao, Ting Liu, Xi Peng, and Dimitris N. Metaxas. Maximum-entropy adversarial data augmentation for improved generalization and robustness. In NeurIPS, 2020. +[50] Kaiyang Zhou, Yongxin Yang, Timothy M. Hospedales, and Tao Xiang. Learning to generate novel domains for domain generalization. In ECCV, 2020. \ No newline at end of file diff --git a/learningtodiversifyforsingledomaingeneralization/images.zip b/learningtodiversifyforsingledomaingeneralization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b129085bdf829204d7aeae91d6ebc0909d4a81cc --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:683c24ec3a9bb1dcdc7f3cbbe5cfdb855fe19264efbb6186a55eceaebb285d97 +size 549671 diff --git a/learningtodiversifyforsingledomaingeneralization/layout.json b/learningtodiversifyforsingledomaingeneralization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5e4ba9bf79d67ecffe9a67bb24256f10e411e584 --- /dev/null +++ b/learningtodiversifyforsingledomaingeneralization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:988e029684c8e8de5f4871efeb1a5147c8cfe6b3c959b2df66b5a73b2da5ece3 +size 410848 diff --git a/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_content_list.json b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2b23e647948ca50e086027b485bf5fe6c3d20284 --- /dev/null +++ b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78e20dbda03c929e573d0b84b62727e2d9e639d14cc51f76a3eac3d353f091ad +size 74500 diff --git a/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_model.json b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5a28ac364531707bb508cec7c7e5e7276b3c0379 --- /dev/null +++ b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c1f0ae23d2eb5736548adcf786acd1e85e8693c4be362ab4d37b1063b7000cc +size 88949 diff --git a/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_origin.pdf b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1b3c1aaaad1c8d509fdfeb79b28cca77abed1b63 --- /dev/null +++ b/learningtodrivefromaworldonrails/d832eaa4-c44d-47ae-b93e-dde57c7bd9f2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7060bfb1790895905086b4e52588920b37e7b5a1679a594427725a77b59d64d +size 2898469 diff --git a/learningtodrivefromaworldonrails/full.md b/learningtodrivefromaworldonrails/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2278933af4ef67b53f3de490e41fea01d75c6c6e --- /dev/null +++ b/learningtodrivefromaworldonrails/full.md @@ -0,0 +1,302 @@ +# Learning to drive from a world on rails + +Dian Chen +UT Austin + +Vladlen Koltun +Intel Labs + +Philipp Krahenbuhl UT Austin + +# Abstract + +We learn an interactive vision-based driving policy from pre-recorded driving logs via a model-based approach. A forward model of the world supervises a driving policy that predicts the outcome of any potential driving trajectory. To support learning from pre-recorded logs, we assume that the world is on rails, meaning neither the agent nor its actions influence the environment. This assumption greatly simplifies the learning problem, factorizing the dynamics into a non-reactive world model and a low-dimensional and compact forward model of the ego-vehicle. Our approach computes action-values for each training trajectory using a tabular dynamic-programming evaluation of the Bellman equations; these action-values in turn supervise the final vision-based driving policy. Despite the world-on-rails assumption, the final driving policy acts well in a dynamic and reactive world. It outperforms imitation learning as well as model-based and model-free reinforcement learning on the challenging CARLA NoCrash benchmark. It is also an order of magnitude more sample-efficient than state-of-the-art model-free reinforcement learning techniques on navigational tasks in the ProcGen benchmark. + +# 1. Introduction + +Vision-based autonomous driving is hard. An agent needs to perceive, understand, and interact with its environment from incomplete and partial experiences. Most successful driving approaches [5, 27, 33, 34] reduce autonomous navigation to imitating an expert, usually a human actor. Expert actions serve as a source of strong supervision, sensory inputs of the expert trajectories explore the world, and policy learning reduces to supervised learning backed by powerful deep networks. However, expert trajectories are often heavily biased, and safety-critical observations are rare. After all, human operators drive hundreds of thousands of miles before observing a traffic incident [39]. This sparsity of safety-critical training data makes it difficult for a behavior-cloning agent to learn and recover from mistakes. Model-free reinforcement learning [25, 40] offers a solution, + +![](images/590efeb59dec81c462f3ee1feb1566102789aaee2f2c0a571809412e691c870f.jpg) + +![](images/eef89e4dea4127783dc30e98169c600c1525626c597d3d35df0da14bbf929980.jpg) +Figure 1: We learn a reactive visuomotor driving policy that gets to explore the effects of its own actions at training time. The policy simulates the effects of its own actions using a forward model in pre-recorded driving logs. It then learns to choose safe actions without explicitly experiencing unsafe driving behavior. Picture selected from the Waymo open dataset [37]. + +![](images/b902020214c2cc8bad4532f4e1d28dc1ad0d91caf36eb87fb40a7ee26aa6f7c2.jpg) + +![](images/cdffcf6abfcd375d80ff42156b027d69a8adf9827334abfa6d8b2d1d616d7761.jpg) + +![](images/6126f2a3538daf55704f31c272912399ba967bac64ef764a1004d1bb65ab05f3.jpg) + +allowing an agent to actively explore its environment and learn from it. However, this exploration is even less data-efficient than behavior cloning, as it needs to experience mistakes to avoid them. For reinforcement learning, the required sample complexity for safe driving is prohibitively large, even in simulation [40]. + +In this paper, we present a method to learn a navigation policy that recovers from mistakes without ever making them, as illustrated in Figure 1. We first learn a world-model on static pre-recorded trajectories. This world model is able to simulate the agent's actions without ever executing them. Next, we estimate action-value functions for all pre-recorded trajectories. Finally, we train a reactive visuomotor policy that gets to observe the impact of all its actions as predicted by the action-value function. The policy learns to avoid costly mistakes, or recover from them. We use driving logs, recorded lane maps and locations of traffic participants, to train the world-model and compute the action-value function. However, our visuomotor policy drives using raw sensor inputs, namely RGB images and speed readings alone. Figure 2 shows an overview. + +The core challenge in our approach is to build a sufficiently expressive and accurate world-model that allows the + +![](images/363bf2a79e0b562df9ce04e0fa0199a1a56f0bc2f359a3fa3606f060d7a934ce.jpg) +Figure 2: Overview of our approach. Given a dataset of offline driving trajectories of sensor readings, driving states, and actions, we first learn a forward model of the ego-vehicle (a). Using the offline driving trajectories, we then compute action-values under a pre-defined reward and learned forward model using dynamic programming and backward induction on the Bellman equation (b). Finally, the action-values then supervise a reactive visuomotor driving policy through policy distillation (c). For a single image, we supervise the policy for all vehicle speeds and actions for a richer supervisory signal. + +agent to explore its environment and the impact of its actions. + +For autonomous driving, this involves modeling the autonomous vehicles and all other traffic participants, i.e. other vehicles, pedestrians, traffic lights, etc. In its raw form, the state space in which the agent operates is too high-dimensional to effectively explore. We thus make a simplifying assumption: The agent's actions only affect its own state, and cannot directly influence the environment around it. In other words: the world is "on rails". This naturally factorizes the world-model into an agent-specific component that reacts to the agent's commands, and a passively moving world. For the agent, we learn an action-conditional forward-model. For the environment, we simply replay pre-recorded trajectories from the training data. + +The factorization of the world model lends itself to a simple evaluation of the Bellman equations through dynamic programming and backward induction. For each driving trajectory, we compute a tabular approximation of the value function over all potential agent states. We use this value function and the agent's forward model to compute action-value functions, which then supervise the visuomotor policy. Action values serve as denser supervisory signals. For a single training example, we supervise the visuomotor policy on all agent states, including variations of the camera viewpoint, vehicle speed, or high level command. + +We evaluate our method in the CARLA simulator [13]. On the CARLA leaderboard $^{1}$ , we achieve a $25\%$ higher driving score than the prior top-ranking entry while using $40 \times$ less training data. Notably, our method uses camera-only sensors, while some prior work relies on LiDAR. We also outperform all prior methods on the NoCrash benchmark [10]. Finally, we show that our method generalizes to other environments using the ProcGen platform [7]. Our method successfully learns navigational policies in the Maze and Heist environments with an order of magnitude fewer observations than baseline algorithms. Code and data are available $^{2}$ . + +# 2. Related Work + +Imitation learning is one of the earliest and most successful approaches to vision-based driving and navigation. Pomerleau [31] pioneered this direction with ALVINN. Recent work extends imitation learning to challenging urban driving and navigation in complicated environments [28, 30, 1, 9, 10, 34, 25]. Imitation learning algorithms train on trajectories collected by human experts [9, 13, 31], or privileged experts constructed with rich sensory data [5, 30]. These approaches are limited to the expert's observations and actions. In contrast, our work learns to drive from passive driving logs and integrates mental exploration into the learning process so as to imagine and learn from scenarios that were not experienced when the logs were collected. + +Model-based reinforcement learning builds a forward model to help train the policy. Sutton [38], Gu et al. [15], Kalweit and Boedecker [21], Kurutach et al. [22] use a forward world model to generate imagined trajectories to improve the sample complexity. World models [29, 16, 18, 35] use the forward model to provide additional context to assist the learning agents' decision making. Feinberg et al. [14], Buckman et al. [3] roll out the forward model for short horizons to improve the fidelity of their Q or value function approximation. In our work, we factorize the forward world model into the controllable ego-agent and a passively moving environment. This factorization significantly simplifies policy learning and allows for a tabular evaluation of the Q and value functions. Our idea of factorizing the agent and the environment is similar to the idea of exogenous events in policy learning [2]. Recently, Dietterich et al. [12], Chitnis and Lozano-Pérez [6] considered finding a minimal factorized MDP. In contrast, we explicitly factorize the environment and focus on leveraging the factorization for planning and supervision of a visuomotor policy. + +Policy distillation remaps the outputs of a privileged agent to a visuomotor agent [5, 24, 30, 23]. Levine et al. [24] use optimal control methods to learn local controllers for robotic manipulation tasks, and use them to supervise a visuomotor policy. Pan et al. [30] train a visuomotor driving + +policy by imitating an MPC controller that has access to expensive sensors. Lee et al. [23] first learn a privileged policy using model-free RL, then distill a visuomotor agent. Chen et al. [5] distill a visuomotor agent from a policy learned by imitation on privileged simulator states. Our approach uses a similar privileged simulator state to infer an action-value function to supervise the final visuomotor policy. While prior work uses one policy to supervise another, in our work a tabular action-value function supervised the policy. A reactive driving policy only exists after distillation. + +Cost volume based planners [41, 33, 4] score and rank select future ego-vehicle trajectories. In tabular form, they closely resemble our action-value estimate. However, our action-value estimate has two advantages. First, it supervises a policy at training time in an offline process, while cost volumes need to be predicted for inference [41, 33, 4]. Second, we make use of ground-truth states, while cost volumes use imitation [41] or affordances [33, 4] from partial observations. + +# 3. Method + +We aim to learn a reactive visuomotor policy $\pi(I)$ that produces an action $a \in \mathcal{A}$ for a sensory input $I$ . At training time, we are given a set of trajectories $\tau \in D$ . Each trajectory $\tau = \{(\hat{I}_1, \hat{L}_1, \hat{a}_1), (\hat{I}_2, \hat{L}_2, \hat{a}_2), \ldots\}$ contains a stream of sensor readings $\hat{I}_t$ , corresponding driving logs $\hat{L}_t$ , and executed actions $\hat{a}_t$ . The hat symbols denote data from driving logs, regular symbols denote free or random variables. The driving logs record the state (position, velocity, and orientation) of the ego-vehicle and all other traffic participants, as well as the environment state (lane information, traffic light state, etc.). We use the driving logs to compute a forward model $\mathcal{T}$ of the world and an action-value function $Q$ from a scalar reward. The forward model $\mathcal{T}$ takes a driving state $L_t$ and an agent's action $a_t$ to predict the next state $L_{t+1}$ . We use a hybrid semi-parametric model to estimate $\mathcal{T}$ , as described in Section 3.1. Specifically, we factorize the forward model into a ego-vehicle component $\mathcal{T}^{ego}$ and a world component $\mathcal{T}^{world}$ . We approximate the ego-vehicle forward model using a simple deep network, while the collected trajectories are used non-parametrically for the world forward model. This factorization allows us to estimate an action-value function using a tabular approximation of the Bellman equation, as described in Section 3.2. Finally, we use the estimated action-values $Q$ to distill a visuomotor policy $\pi$ . This policy $\pi$ maximizes the expected return under our forward model and tabular action-value approximation. At training time, our algorithm uses privileged information, i.e., driving logs, to supervise policy learning, but the final policy $\pi(I_t)$ drives from sensor inputs alone. Algorithm 1 and Figure 2 summarize the entire training process. + +Algorithm 1: Learning in a world-on-rails +Data: Training trajectories D +Result: Policy $\pi (I)\in \mathcal{A}$ +// Forward-model fitting §3.1 +Function FitForward(D) $\rightarrow$ Tego: +Minimize Equation (1); +return ego-vehicle forward model Tego; +end +// Action-value estimate §3.2 +Function EstimateQ(D, Tego) $\rightarrow$ Q: +for $\tau \in D$ do +Initialize $V_{|\tau|+1}(\cdot) = 0$ ; +for $t = |\tau|\ldots 1$ do +Compute $Q_t$ an $V_t$ Equation (2); +Store $Q_t$ ; +end +return stored Q-values; +end +// Policy distillation §3.3 +Function DistillPolicy(D, Q) $\rightarrow$ $\pi$ : +Minimize Equation (3); +return visuomotor policy $\pi$ ; +end +Learn forward-model Tego = FitForward(D); +Estimate Action-Values Q = EstimateQ(D, Tego); +Learn visuomotor policy $\pi =$ DistillPolicy(D, Q); + +# 3.1. A factorized forward model + +In its raw form the forward model $\mathcal{T}$ is too complex to efficiently predict and simulate. After all, entire driving simulators are designed to forecast just one of the many possible future driving states. We thus factorize the driving state $L_{t}$ and forward model $\mathcal{T}$ into two parts: A part considering just the vehicle being controlled $L_{t+1}^{ego} = \mathcal{T}^{ego}(L_{t}^{ego}, L_{t}^{world}, a_{t})$ and a part modeling the rest of the world $L_{t+1}^{world} = \mathcal{T}^{world}(L_{t}^{ego}, L_{t}^{world}, a_{t})$ . Here we consider only deterministic transitions. We furthermore assume that the world is on rails and cannot react to the agents' commands $a$ or the state of the ego-vehicle $L^{ego}$ . Specifically, the transition of the world state only depends on the prior world state itself: $L_{t+1}^{world} = \mathcal{T}^{world}(L_{t}^{world})$ . Thus the initial state of the world $L_{0}^{world}$ determines the entire trajectory of the world: $\{L_{1}^{world}, L_{2}^{world}, \ldots\}$ . This allows us to model the world transition using the collected trajectories $\tau$ directly. We thus only need to model the ego-vehicle's forward-model $\mathcal{T}^{ego}$ for any ego-vehicle state $L_{t}^{ego}$ and action $a_{t}$ . We train $\mathcal{T}^{ego}$ on the collected trajectories using L1 + +regression + +$$ +\left. \right. E _ {\hat {L} _ {t: t + T}, \hat {a} _ {t}} \left[ \sum_ {\Delta = 1} ^ {T} \left| \mathcal {T} ^ {e g o \Delta} \left(\hat {L} _ {t} ^ {e g o}, \hat {a} _ {t + \Delta - 1}\right) - \hat {L} _ {t + \Delta} ^ {e g o} \right|\right], \tag {1} +$$ + +where we roll out the forward model for $T = 10$ steps to obtain a more robust regression target. We use a simple parametric bicycle model that easily generalizes beyond the training states $\hat{L}^{ego}$ , as described in Section 4. + +The world-on-rails assumption clearly does not hold, neither in a simulator nor in the real world. Other agents in the world will react to the ego-vehicle and its actions. However, this does not imply that a world-on-rails cannot provide strong and useful supervision to the agent. Our experiments show that an agent trained in a world-on-rails significantly outperforms agents trained with a full forward model of the world. The world-on-rails assumption significantly simplifies the estimation of an action-value function in Section 3.2 and subsequent policy learning in Section 3.3. + +# 3.2. A factorized Bellman equation + +Our goal is to estimate an action-value function $Q(\hat{L}_t, a)$ for each state $\hat{L}_t$ of the training trajectory and action $a$ . We use the Bellman equation and a tabular discretization of the value function here. Recall the $\gamma$ -discounted Bellman equation: $V(L_t) = \max_a Q(L_t, a)$ and $Q(L_t, a) = \gamma V(\mathcal{T}(L_t, a)) + r(L_t, a)$ for any state $L_t$ , action $a$ , and reward $r$ . Ordinarily, one would need to resort to Bellman iterations to estimate $V$ and $Q$ . However, our factorized forward-model simplifies this: + +$$ +V (L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {w o r l d}) = \max _ {a} Q (L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {w o r l d}, a) +$$ + +$$ +\begin{array}{l} Q \left(L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {w o r l d}, a _ {t}\right) = r \left(L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {w o r l d}, a _ {t}\right) + \\ \gamma V (\mathcal {T} ^ {e g o} (L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {w o l d}, a), \hat {L} _ {t + 1} ^ {w o l d}). \\ \end{array} +$$ + +The action-value function is needed for all ego-vehicle state $L^{ego}$ , but only recorded world states $\hat{L}_t^{world}$ . It is sufficient to evaluate the action-value function on just recorded world states for all ego-vehicle states: $\hat{V}_t(L_t^{ego}) = V(L_t^{ego},\hat{L}_t^{world}),\hat{Q}_t(L_t^{ego},a_t) = V(L_t^{ego},\hat{L}_t^{world},a_t)$ . Furthermore, the world states are strictly ordered in time, hence the Bellman equations simplify to + +$$ +\begin{array}{l} \hat {V} _ {t} \left(L _ {t} ^ {e g o}\right) = \max _ {a} \hat {Q} _ {t} \left(L _ {t} ^ {e g o}, a\right) \tag {2} \\ \hat {Q} _ {t} \left(L _ {t} ^ {e g o}, a _ {t}\right) = r \left(L _ {t} ^ {e g o}, \hat {L} _ {t} ^ {\text {w o r l d}}, a _ {t}\right) + \\ \gamma \hat {V} _ {t + 1} (\mathcal {T} ^ {e g o} (L _ {t} ^ {e g o}, a)). \\ \end{array} +$$ + +Here the value and action-value functions only consider recorded world states, but all possible ego-vehicle states. The model is thus able to "imagine" driving behaviors and their reward without ever executing them. In order to collect rewards from these "imagined" states, we require an explicit + +reward function $r$ , and not just a scalar reward signal provided by the environment. For a detailed discussion of the reward see Section 4. + +We solve Equation (2) using backward induction and dynamic programming. The state of the ego-vehicles $L^{ego}$ is compact (position, orientation, and velocity). This allows us to compute a tabular approximation of the value function $V_{t}(L_{t}^{ego})$ , evaluated in batch operations efficiently. Specifically, we discretize $V_{t}(L_{t}^{ego})$ into bins corresponding to the position, orientation, and velocity of the ego-vehicle. When evaluating, we use linear interpolation if the requested value falls between bins. Furthermore, the action space is also small, allowing for a discretization of the max operator in the value update. During backward induction, we implicitly represent the action-value function $Q_{t}$ using $V_{t+1}$ and the forward model $\mathcal{T}^{ego}$ . We only discretize $Q_{t}(\hat{L}_{t}^{ego}, \cdot)$ to supervise the visuomotor policy at timestep $t$ . Algorithm 1 summarizes our backward induction. More details are provided in the supplementary material for reference. + +# 3.3. Policy Distillation + +We use the action-value functions for the ego-vehicle state $Q_{t}(\hat{L}_{t}^{ego},\cdot)$ to supervise a visuomotor policy $\pi (\hat{I}_t)$ . The action-value $Q_{t}(\hat{L}_{t}^{ego},\cdot)$ represents the expected return of an optimal policy each vehicle state. We directly optimize this expected return in our policy: + +$$ +E _ {\hat {L} _ {t} ^ {w o r l d}, L _ {t} ^ {e g o}, \hat {I} _ {t}} \left[ \sum_ {a} \pi (a | \hat {I} _ {t}) \hat {Q} _ {t} \left(L _ {t} ^ {e g o}, a\right) + \alpha H \left(\pi (\cdot | \hat {I} _ {t})\right) \right]. \tag {3} +$$ + +Since the action-value functions are computed densely, only the environment needs to be recorded, not the ego state. We can therefore supervise with augmented $\hat{I}_t$ representing arbitrary $L_t^{ego}$ . We additionally add an entropy regularizer $H$ [17] to encourage a more diverse output policy, where $\alpha$ is the temperature hyperparameter. In practice, we discretize both the action-values and the visuomotor policy as described in Section 4. + +# 4. Implementation + +We implement our approach in the CARLA simulator [13] in a strictly offline manner. We first collect a static dataset by rolling out a behavior agent $\pi_{b}$ ; we use the CARLA autopilot unless specified otherwise. We use the noisy driving actions of the autopilot to learn a forward model, but do not otherwise use the autopilot as supervision. + +Forward model. We train the ego-vehicle forward model $\mathcal{T}^{ego}$ on a small subset of trajectories. We collect the subset of trajectories to span the entire action space of the ego-vehicle: steering $s\in [-1,1]$ and throttle $t\in [0,1]$ are uniformly sampled, with brake $b\in \{0,1\}$ sampled from a + +Bernoulli distribution. The forward model $\mathcal{T}^{ego}$ takes as inputs the current ego-vehicle state as 2D location $x_{t}, y_{t}$ , orientation $\theta_{t}$ , speed $v_{t}$ , and predicts the next ego-vehicle state $x_{t+1}, y_{t+1}, \theta_{t+1}, v_{t+1}$ . We use a parameterized bicycle model as the structural prior for $\mathcal{T}^{ego}$ . In particular, we only learn the vehicle wheelbases $f_{b}, r_{b}$ , the mapping from user steering $s$ to wheel steering $\phi$ , and the mapping from throttle and braking to acceleration $a$ . The kinematics of the bicycle model are described in the supplementary material for reference. We train $\mathcal{T}^{ego}$ in an auto-regressive manner using L1 loss and stochastic gradient descent. + +Bellman equation evaluation. For each time-step $t$ , we represent the value function $V_{t}$ as a 4D tensor discretized into $N_{H} \times N_{W}$ position bins, $N_{v}$ velocity bins, and $N_{\theta}$ orientation bins. We use $N_{H} = N_{W} = 96$ , $N_{v} = 4$ , and $N_{\theta} = 5$ . Each bin has a physical size of $\frac{1}{3} \times \frac{1}{3} m^{2}$ and corresponds to a $2m / s$ velocity range and a $38^{\circ}$ orientation range. The ego-vehicle state $\hat{L}_{t}^{ego} = (x_{t}, y_{t}, v, \theta)$ is always centered in this discretization. The position of the ego-vehicle $(x_{t}, y_{t})$ is at the center of the spatial discretization. We only represent orientations in the range $[-95^{\circ}, 95^{\circ}]$ relative to the ego-vehicle. When computing the action value function, any value $V_{t}$ that does not lie in the center of a bin is interpolated among its $2^{4}$ neighboring bins using linear interpolation. The linear interpolation is computed over all states at once and is factorized over ego state dimensions (location, speed and orientation), thus it is efficient. Values that fall outside the discretization are 0. We discretize actions into $M_{s} \times M_{t}$ bins for steering and throttle respectively, and one additional bin for braking. We do not steer or throttle while braking. We use $M_{s} = 9$ and $M_{t} = 3$ for a total of $9 \cdot 3 + 1 = 28$ discrete actions. + +Policy network. The policy network uses a ResNet34 [19] backbone to parse the RGB inputs. We use global average pooling to flatten the ResNet features, before concatenating them with the ego-vehicle speed and feeding this to a fully-connected network. The network produces a categorical distribution over the discretized action space. + +In CARLA, the agent receives a high-level navigation command $c_{t}$ for each time-step. We supervise the visuomotor agent simultaneously on all the high-level commands [5]. Additionally, we task the agent to predict semantic segmentation as an auxiliary loss. This consistently improves the agent's driving performance, especially when generalizing to new environments. + +Reward design. The reward function $r(L_{t}^{ego}, L_{t}^{world}, a_{t}, c_{t})$ considers ego-vehicle state, world state, action, and high-level command, and is computed from the driving log at each timestep. We use the lane information of the world and high-level command to first + +compute the target lane of the ego-vehicle. The agent receives a reward of $+1$ for staying in the target lane at the desired position, orientation and speed, and is smoothly penalized for deviating from the lane down to a value of 0. If the agent is located at a "zero-speed" region (e.g. red light, or close to other traffic participants), it is rewarded for zero velocity regardless of orientation, and penalized otherwise except for red light zones. All "zero speed" rewards are scaled by $r_{\mathrm{stop}} = 0.01$ , in order to avoid agents disregarding the target lane. The agents receive a greedy reward of $r_{\mathrm{brake}} = +5$ if it brakes in the zero-speed zone. To avoid agents chasing braking region, the braking reward cannot be accumulated. All rewards are additive. We found that with zero-speed zones and brake rewards, there is no need to explicitly penalize collisions. We compute the action-values over all high-level commands for each timestep, and use multi-branch supervision [5] when distilling the visuomotor agent. + +# 5. Experiments + +Dataset. We evaluate our approach on the open-source CARLA simulator [13]. We train our ego-vehicle forward model on a small subset of trajectories consisting of 2400 collected frames. It learns from random actions. The bulk of our training set uses just passive sensor information $I$ and training logs $L$ . We refer readers to the supplement for additional details. + +Experimental setup. We evaluate our approach on both the CARLA leaderboard and the NoCrash benchmark. For both benchmarks, at each frame, the agent receives RGB camera reading $I$ , speed reading $v$ , and a high-level command $c$ to compute steering $s$ , throttle $t$ , and brake $b$ . NoCrash benchmark consists of three driving conditions; each driving condition contains 50 predefined routes: 25 for the training town (Town01) and 25 for the testing town (Town02). We refer readers to the supplement for additional details. + +Comparison to the state-of-art. Table 1 compares the performance of the presented approach on the CARLA leaderboard. We list the three key metrics from the leaderboard: driving score (primary summary measure used for ranking entries on the leaderboard), route completion, and infraction score. We compare to CILRS [10], LBC [5], Transfuser [32] and IA [40]. LBC is the state of the art on the NoCrash benchmark, and Transfuser is a very recent method utilizing sensor fusion. Both LBC and Transfuser are based on imitation learning. IA is the winning entry in the 2020 CARLA Challenge, and the prior leading entry on the CARLA leaderboard. IA is based on model-free reinforcement learning with Rainbow [20] and IQN [11]. + +![](images/c3bb07bbaba5e9ec2b013d82d54bd7ad3f2b3e6e9d9817694ea8d5f03841a4f0.jpg) + +![](images/88e921736c49628b62edb1b6e3fbeb712d0d99ee4dcdb4e24a74eae602106191.jpg) + +![](images/c81e6d391a27cdc4f6246f9c9aab2ce695ee2e60313c29f7717607ec5cde3803.jpg) +(a) RGB camera + +![](images/fcd1c8cc9b3d3a6ce610fc8a8c6ac94d9b41455766110400aab4f82279148232.jpg) + +![](images/ace965f447998ae2910c5bd23689fc95eb948a0c8b34bd0f01d47bbaebf46356.jpg) + +![](images/fb0021c40b5e23ea4f0e521270391823ebc1f7b2a7979e59843e120a23d3ceaa.jpg) +(b) Map + +![](images/569fa50efcbc1418d2e5c84ee2298ad20b7fe1d561fc539e96ad5992e42399b3.jpg) + +![](images/25e152f671e7f1e6f62e58353c24588e3216f92cb791bbdd8ccfc736f1ceecdc.jpg) + +![](images/baaa185dd0cc50f86009339e57c2114b057690887abd5f3eab8882c0fae307fc.jpg) +(c) Value-map + +![](images/6c28b391252bac4415607b856bd01ac043537b03b01154fad235160541ac2921.jpg) + +![](images/06da5e430bbc9106db88fef8f65b88cd0bb93e6b65e680bf5d40801b6715836a.jpg) + +![](images/ce558c66c8e7b322facb8e16bb0b96fcc4629b88499ec1641e772c937b976718.jpg) +(d) Action-value + +![](images/1120e5d3ff457e915122c66df3c32b03cd11d9cf7ff93a8ca73cb1ba20d05c51.jpg) +Figure 3: Visualization of the computed value function and action-value function for the current frame. The RGB camera image (a) and bird-eye's view maps (b) show the ego-vehicle location in the world. The value-maps (c) show the discretized tabular value estimate for 4 speed bins $\times 5$ orientation bins. The orientation bins are $-95^{\circ}$ to $95^{\circ}$ from left to right, and the speed bins are $0\mathrm{m / s}$ to $8\mathrm{m / s}$ from top to bottom. Each map has a resolution of $96\times 96$ corresponding to a $24\mathrm{m}^2$ area around the vehicle. We crop areas behind the ego-vehicle for visualization. The value-maps use 5 bellman updates and see 1.25s into the future. (d) shows the action-values based on the current ego-vehicle state. Actions with highest values are highlighted with red boxes. These action-values supervise the visuomotor policy that takes as input camera RGB images. More visualizations provided in the supplement. + +
MethodDS ↑RC ↑IS ↑Data LiDAR
CILRS [10]5.3714.400.55- ×
LBC [5]8.9417.540.73- ×
Transfuser [32]16.9351.820.42150K √
IA [40]24.9846.970.5240M ×
Ours31.3757.650.561M ×
+ +Table 1: Comparison of the driving score (DS, main metric), route completion (RC), and infraction score (IS) on the CARLA leaderboard. For all three metrics, higher is better. Our method improves the driving score by $25\%$ relative to the prior state of the art [40] while using $40\times$ less data. + +Table 2 compares the performance on the CARLA NoCrash benchmark. We retrain LBC (the prior state of the art on NoCrash) on CARLA 0.9.10 using the same training data with augmented camera views as in our approach. To help LBC generalize, we found it important to train with additional semantic segmentation supervision. CARLA 0.9.10 features more complex visuals, and generalization to new weather conditions is harder. IA features two models, a published model trained on CARLA 0.9.6 Town1 alone, and a much stronger CARLA Challenge model (trained on CARLA 0.9.10). We compare to the stronger challenge + +model. However, this model was trained on many more towns, and under both training and testing weather conditions. It thus does not have held-out testing weathers. Our method outperforms LBC and IA on all 12 tasks and conditions. Furthermore, our method does not require expert actions anywhere in the training pipeline, unlike LBC. We outperform IA on all traffic scenarios in both towns, even though we train only on Town1. + +Ablation study. Table 3 compares our visuomotor agent with other model-based approaches. All baselines optimize the same reward function described in Section 4. Dreamer (DM) [18] trains a full-fledged embedding-based world model, and uses it to backpropagate analytic gradients to the policy during rollouts. Building a full forward model of our driving scenarios can be challenging. To help this baseline, we give it access to driving logs both during training and testing. We additionally construct a variant, F-DM, which utilizes our factorized world model. F-DM replaces full embedding-based world model with our ego forward model $\mathcal{T}^{ego}$ . Equivalent to our method it observes the pre-recorded world states and thus cannot backpropagate through a forward model of the world. F-DM still trains the policy the same way as DM, using imaginary differentiable rollouts. Since Dreamer is off-policy, we implement both DM and F-DM in an offline RL manner, and train both on the same + +
TaskTownWeatherIALBCOurs
Empty858998
Regulartraintrain8587100
Dense637596
Empty778694
Regulartesttrain667989
Dense335374
Empty-6090
Regulartraintest-6090
Dense-5484
Empty-3678
Regulartesttest-3682
Dense-1266
+ +Table 2: Comparison of the success rate of the presented approach (Ours) to the state of the art on NoCrash (LBC), and the winning entry of the 2020 CARLA Challenge (IA). All three methods are trained and evaluated on CARLA 0.9.10. IA uses all towns and all weathers to train. It thus does not have test weathers. Italic numbers indicate that the policy was trained on the test town. Additional numbers on route completion and random seeds are provided in the supplement. + +
Factorized world× DM✓ F-DM✓ CEM✓ Ours
TaskTown
Straight Turntrain37 044 0100 88100 100
Straight Turntest44 052 0100 97100 100
Empty Regular Densetrain0 00 088 86 7298 100 96
Empty Regular Densetest0 00 097 84 4794 89 74
+ +Table 3: Comparison of the success rate on the CoRL17 and NoCrash benchmark under training weathers. We compare our full visuomotor agent with model-based baselines. Dreamer (DM) [18] trains the full world model, whereas the rest follows our factorization and use the same forward model $\mathcal{T}^{ego}$ as our approach. Numbers in italic indicate agents that use privileged information (such as driving logs) at test time. Our approach uses sensor readings alone. Nevertheless, our approach outperforms all baselines. + +dataset with which we supervise our visuomotor agent. CEM + +is an MPC baseline that factorizes the world and uses the cross-entropy method [26] to search for the best actions. It uses our forward model, but cannot simulate the environment forward at the test time. It assumes a static world. Like Dreamer, CEM has access to the driving log at test time of the current timestep. It replans at every timestep over the most recent driving log. All the baselines use privileged information (driving logs), whereas our method takes sensor inputs alone. + +We evaluate with the training weather for our method, as driving logs for baselines are weather-agnostic3. We found that the NoCrash benchmark is too hard for the Dreamer baseline, and thus additionally test on the much easier CoRL17 benchmark [13]. Akin to NoCrash, each task in the CoRL17 benchmark contains 50 predefined routes: 25 for the training town and 25 for an unseen test town. It runs on empty roads with simpler routes compared to NoCrash. Our method outperforms all other model-based baselines by a margin, despite using sensor inputs instead of driving logs. Dreamer with a factorized world model outperforms the full world model but still fails to generalize beyond straight driving. One reason for the poor performance of Dreamer may be a bias in the training set. Cars mostly drive straight. Dreamer may simply see too few turning scenarios compared to the endless stream of straight driving. + +Traffic light infraction analysis. We additionally analyze traffic light infractions on the NoCrash benchmark. Table 4 compares the average number of traffic light violations per hour on all trials in the NoCrash benchmark. Our method has fewer traffic light infractions than the reinforcement learning baseline (IA) on all six tasks under the training weathers. + +Visualization. Figure 3 shows a visualization of the computed value and action-value functions for various driving scenarios. Each of these action-value functions densely supervises policy for the displayed image. + +ProcGen navigation. To demonstrate the broad applicability of our approach, we additionally evaluate on the navigational tasks (Maze and Heist) in the ProcGen benchmark [7]. In both environments, the agent is rewarded for navigating to the desired locations. Maze features a plain navigation task through a complex environment. Heist additionally requires the agent to collect keys and unlock the doors before navigating to the goal. In ProcGen, the action space is discrete, hence we only discretize the ego-agent's states. We ignore velocity. The agent's forward dynamics model in ProcGen is not location agnostic as in CARLA. To address this, we use a small ConvNet to extract the environment context around + +![](images/d9a7235f74ed49f72cdaf2d29a737fe2358ba0d7de0d786703e592f0c10fa731.jpg) +(a) Maze 2000 training levels + +![](images/4d696ac97a9e1042f6041b0f97b1c2ecf9ba3ef497f7a9d8f987fc09c7298114.jpg) +Figure 4: Comparison of our method to state-of-the-art model-free reinforcement learning on the navigational tasks of the ProcGen benchmark. All plots measure the average episode returns on the testing levels. PPO w/ priv is a customized PPO implementation that during training additionally takes as input the same privileged information that our approach uses to compute rewards and train the agent forward model. The presented approach is an order of magnitude more sample-efficient. + +![](images/ceb716a2ff81a3f72ab47b7a6b8c742799cbde6b900f43d93bb7fe6e95744cf7.jpg) +(b) Maze 10000 training levels + +![](images/88d04a36e620f08964c967f1a4e030ef2b45228a87d4b6accb70284974c3457e.jpg) +(c) Heist 2000 training levels +(d) Heist 10000 training levels + +the ego-agent forward model $\mathcal{T}^{ego}$ . In order to evaluate sample efficiency, we implement our method on ProcGen in an off-policy reinforcement learning manner. We alternate between training or fine-tuning a policy and forward model, and rolling out new trajectories under the current policy. Compared to model-free baselines, our approach needs access to a dense reward function, instead of just the scalar reward signal of the environment. We compute this reward function using semantic labels obtained via the ProcGen renderer. For Maze, the reward function awards $+1$ for goal location regardless of orientation. For Heist, the reward function awards $+1$ for key and unlockable door locations regardless of orientation. In addition, we mask all unachievable ego-state values to 0 during the Bellman equation evaluation. We use this privileged information in the action-value + +
Oracle actions× IA✓ LBC× Ours
TaskTownWeather
Empty3.341.350.00
Regulartraintrain6.711.890.43
Dense15.413.272.61
Empty62.188.4510.68
Regulartesttrain53.288.226.95
Dense54.947.2612.90
Empty-0.360.00
Regulartraintest-0.810.00
Dense-0.524.29
Empty-8.1714.46
Regulartesttest-8.6111.30
Dense-4.8713.28
+ +Table 4: Comparison of the average number of traffic light violations per hour of trials on the NoCrash benchmark. We compare our approach to LBC (prior state of the art on NoCrash) and IA (the winning entry of the 2020 CARLA challenge). LBC trains from oracle trajectories, whereas IA and ours do not. + +computation only, and in no other place in our algorithm. Figure 4 compares the performance and sample-efficiency of our method with model-free reinforcement learning baselines PPO [36] and PPG [8]. PPG is the current state of the art on the ProcGen benchmark. In addition, we compare to a customized PPO implementation which during training also takes as input the same privileged information used in our method. Our method converges within 3M frames, while model-free baselines take up to 25M frames. For both Maze and Heist environments, we train all agents on two different conditions: 2000 and 10000 (procedurally generated) training levels. For both environments, agents are tested on completely randomized procedurally-generated levels. The comparison of average episode returns on the training levels is in the supplement for reference. Our method is an order of magnitude more sample-efficient than all the model-free RL baselines even when those methods are given the same privileged information used by our reward computation. + +# 6. Conclusion + +We show that assuming independence between the agent and the environment, which we refer to as a world on rails, significantly simplifies modern reinforcement learning. While true independence rarely holds, the gains in training efficacy outweigh the modeling constraints. Even with a simple reward function, an agent trained in a world-on-rails learns to drive better than state-of-the-art imitation learning agents on standard benchmarks. In addition, the presented policy learning framework is an order of magnitude more sample-efficient than state-of-the-art reinforcement learning on challenging ProcGen navigation tasks. + +# Acknowledgements + +We thank Yuke Zhu for his valuable feedback. We thank Tianwei Yin for his help on figure 1. This work was supported by the NSF Institute for Foundations of Machine Learning and NSF award #1845485. + +# References + +[1] Mayank Bansal, Alex Krizhevsky, and Abhijit Ogale. Chauffeurnet: Learning to drive by imitating the best and synthesizing the worst. In RSS, 2019. 2 +[2] Craig Boutilier, Thomas Dean, and Steve Hanks. Decision-theoretic planning: Structural assumptions and computational leverage. In JAIR, 1999. 2 +[3] Jacob Buckman, Danijar Hafner, George Tucker, Eugene Brevdo, and Honglak Lee. Sample-efficient reinforcement learning with stochastic ensemble value expansion. In NeurIPS, 2018. 2 +[4] Sergio Casas, Abbas Sadat, and Raquel Urtasun. Mp3: A unified model to map, perceive, predict and plan. Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 3 +[5] Dian Chen, Brady Zhou, Vladlen Koltun, and Philipp Krahenbihl. Learning by cheating. In CoRL, 2019. 1, 2, 3, 5, 6 +[6] Rohan Chitnis and Tomás Lozano-Pérez. Learning compact models for planning with exogenous processes. In CoRL, 2020. 2 +[7] Karl Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. In arXiv preprint, 2019. 2, 7 +[8] Karl Cobbe, Jacob Hilton, Oleg Klimov, and John Schulman. Phasic policy gradient. In arXiv preprint, 2020. 8 +[9] Felipe Codevilla, Matthias Müller, Antonio López, Vladlen Koltun, and Alexey Dosovitskiy. End-to-end driving via conditional imitation learning. In ICRA, 2018. 2 +[10] Felipe Codevilla, Eder Santana, Antonio M López, and Adrien Gaidon. Exploring the limitations of behavior cloning for autonomous driving. In ICCV, 2019. 2, 5, 6 +[11] Will Dabney, Georg Ostrovski, David Silver, and Rémi Munos. Implicit quantile networks for distributional reinforcement learning. In ICML, 2018. 5 +[12] Thomas Dietterich, George Trimponias, and Zhitang Chen. Discovering and removing exogenous state variables and rewards for reinforcement learning. In ICML, 2018. 2 +[13] Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. CARLA: An open urban driving simulator. In CoRL, 2017. 2, 4, 5, 7 +[14] Vladimir Feinberg, Alvin Wan, Ion Stoica, Michael I Jordan, Joseph E Gonzalez, and Sergey Levine. Model-based value estimation for efficient model-free reinforcement learning. In arXiv preprint, 2018. 2 +[15] Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In ICML, 2016. 2 +[16] David Ha and Jürgen Schmidhuber. Recurrent world models facilitate policy evolution. In NeurIPS, 2018. 2 +[17] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In ICML, 2018. 4 +[18] Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. In ICLR, 2019. 2, 6, 7 +[19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. + +5 + +[20] Matteo Hessel, Joseph Modayil, Hado Van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In AAAI, 2018. 5 +[21] Gabriel Kalweit and Joschka Boedecker. Uncertainty-driven imagination for continuous deep reinforcement learning. In CoRL, 2017. 2 +[22] Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. In ICLR, 2018. 2 +[23] Joonho Lee, Jemin Hwangbo, Lorenz Wellhausen, Vladlen Koltun, and Marco Hutter. Learning quadrupedal locomotion over challenging terrain. In Science robotics, 2020. 2, 3 +[24] Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. In JMLR, 2016. 2 +[25] Xiaodan Liang, Tairui Wang, Luona Yang, and Eric Xing. Cirl: Controllable imitative reinforcement learning for vision-based self-driving. In ECCV, 2018. 1, 2 +[26] Shie Mannor, Reuven Y Rubinstein, and Yohai Gat. The cross entropy method for fast policy search. In ICML, 2003. 7 +[27] Matthias Mueller, Alexey Dosovitskiy, Bernard Ghanem, and Vladlen Koltun. Driving policy transfer via modularity and abstraction. In CoRL, 2018. 1 +[28] Urs Muller, Jan Ben, Eric Cosatto, Beat Flepp, and Yann L Cun. Off-road obstacle avoidance through end-to-end learning. In NeurIPS, 2006. 2 +[29] Junhyuk Oh, Satinder Singh, and Honglak Lee. Value prediction network. In NeurIPS, 2017. 2 +[30] Yunpeng Pan, Ching-An Cheng, Kamil Saigol, Keuntak Lee, Xinyan Yan, Evangelos Theodorou, and Byron Boots. Agile autonomous driving using end-to-end deep imitation learning. In RSS, 2018. 2 +[31] Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In NeurIPS, 1989. 2 +[32] Aditya Prakash, Kashyap Chitta, and Andreas Geiger. Multimodal fusion transformer for end-to-end autonomous driving. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 5, 6 +[33] Abbas Sadat, Sergio Casas, Mengye Ren, Xinyu Wu, Pranaab Dhawan, and Raquel Urtasun. Perceive, predict, and plan: Safe motion planning through interpretable semantic representations. In ECCV, 2020. 1, 3 +[34] A Sauer, N Savinov, and A Geiger. Conditional affordance learning for driving in urban environments. In CoRL, 2018. 1, 2 +[35] Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. Mastering atari, go, chess and shogi by planning with a learned model. In Nature, 2020. 2 +[36] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. In arXiv preprint, 2017. 8 +[37] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al. Scalability in perception for autonomous driving: Waymo open dataset. In CVPR, + +2020.1 + +[38] Richard S Sutton. Planning by incremental dynamic programming. In PMLR, 1991. 2 +[39] Brian Tefft. Rates of motor vehicle crashes, injuries and deaths in relation to driver age, united states, 2014-2015. In AAA Foundation for Traffic Safety., 2017. 1 +[40] Marin Toromanoff, Emilie Wirbel, and Fabien Moutarde. End-to-end model-free reinforcement learning for urban driving using implicit affordances. In CVPR, 2020. 1, 5, 6 +[41] Wenyuan Zeng, Wenjie Luo, Simon Suo, Abbas Sadat, Bin Yang, Sergio Casas, and Raquel Urtasun. End-to-end interpretable neural motion planner. In CVPR, 2019. 3 \ No newline at end of file diff --git a/learningtodrivefromaworldonrails/images.zip b/learningtodrivefromaworldonrails/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..828922781d1645c0efd1f5d31cbb2ef5b1203096 --- /dev/null +++ b/learningtodrivefromaworldonrails/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31986966de8207479ab49b11f27472577b87214617b407a3be279fe05edb2bd6 +size 359131 diff --git a/learningtodrivefromaworldonrails/layout.json b/learningtodrivefromaworldonrails/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d1eb344da70ffb95abc0b3aa448593065c849190 --- /dev/null +++ b/learningtodrivefromaworldonrails/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a144d3995f79c326e9b764ffcdb26d135c62ab50bfe4fae6f7080912a00e53a +size 414022 diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_content_list.json b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1c31f44734eef51c75d1c1ab45a936ad43019c71 --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a08594c0c035183c469a655fb0b8552c4a249c78f44cddf0782bca06ecf4019 +size 75734 diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_model.json b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_model.json new file mode 100644 index 0000000000000000000000000000000000000000..80e2f3f5c89b8d7cfc09e2e627c08c96170ce45a --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:804760a78cbf34e5b6c343c2ff6d97370a8b95b715a3d20dcdaacbc1c8925b4b +size 91749 diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_origin.pdf b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..585bbbaf90a533086a18ede2ddc4297d019ba23e --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/2ea49324-ce28-4a83-b0e3-990f40f42b55_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4af07969e3139b20c9b969e849a5f73d47a04344d9b5219c742ac2030665a33 +size 1798585 diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/full.md b/learningtoestimatehiddenmotionswithglobalmotionaggregation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..349b2174bce4738dcc57943b2cb2cb04ae9f6eb8 --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/full.md @@ -0,0 +1,298 @@ +# Learning to Estimate Hidden Motions with Global Motion Aggregation + +Shihao Jiang $^{1,2}$ + +Dylan Campbell3 + +Yao Lu1,2 + +Hongdong Li1,2 + +Richard Hartley1,2 + +$^{1}$ Australian National University + +$^{2}$ ACRV + +$^{3}$ University of Oxford + +![](images/532fa2268fe146d8c9f9ca600f0ec1ca9f0a141026fa8d96fe42189b9633f8a4.jpg) +Figure 1. Global motion aggregation helps resolve ambiguities caused by occlusions. Occlusions—a term we extend to include any parts of a scene that disappear in the next frame—cause large ambiguities in the optical flow estimation problem that cannot be resolved by local approaches. Based on the assumption that points on an object have homogeneous motions, which often hold approximately, we propose to globally aggregate motion features of pixels that are likely to belong to the same object. In this example, most pixels on the blade move out-of-frame from frame 2 to frame 3. When only these two frames are provided, global aggregation allows motion information to be passed from non-occluded pixels to occluded pixels, which helps resolve ambiguities caused by occlusions. + +![](images/ab0a4a3f954776ff6250867d49aea71fc2a5d4cf178a1e8bafd6d4c7a1c032ca.jpg) + +![](images/5c0d7d4e8262af1773321776a98c8485ec584f9d46528d04e233469cc1b5a17e.jpg) + +# Abstract + +Occlusions pose a significant challenge to optical flow algorithms that rely on local evidences. We consider an occluded point to be one that is imaged in the reference frame but not in the next, a slight overloading of the standard definition since it also includes points that move out-of-frame. Estimating the motion of these points is extremely difficult, particularly in the two-frame setting. Previous work relies on CNNs to learn occlusions, without much success, or requires multiple frames to reason about occlusions using temporal smoothness. In this paper, we argue that the occlusion problem can be better solved in the two-frame case by modelling image self-similarities. We introduce a global motion aggregation module, a transformer-based approach to find long-range dependencies between pixels in the first image, and perform global aggregation on the corresponding motion features. We demonstrate that the optical flow estimates in the occluded regions can be significantly improved without damaging the performance in non-occluded regions. This approach obtains new state-of-the-art results on the challenging Sintel dataset, improving the average end-point error by $13.6\%$ on Sintel Final and $13.7\%$ on Sintel Clean. At the time of submission, our method ranks first on these benchmarks among all published and unpublished approaches. Code is available at https://github.com/zacjiang/GMA. + +# 1. Introduction + +How can we estimate the 2D motion of a point we only see once? This is the problem faced by optical flow algorithms for points that become occluded between frames. Estimating the optical flow, that is, the apparent motion of pixels in an image as the camera and scene move, is a classic problem in computer vision studied since the seminal work of Horn and Schunck [14]. There are many factors that make optical flow prediction a hard problem, including large motions, motion and defocus blur, and featureless regions. Among these challenges, occlusion is one of the most difficult and under-explored. In this paper, we propose an approach that specifically targets the occlusion problem in the case of two-frame optical flow prediction. + +We first define what we mean by occlusion in the context of optical flow estimation. In this paper, an occluded point is defined as a 3D point that is imaged in the reference frame but is not visible in the matching frame. This definition incorporates several different scenarios, such as the query point moving out-of-frame or behind another object (or itself), or another object moving in front of the query point, in the active sense. One particular case of occlusion is shown in Figure 1, where part of the blade moves out-of-frame. + +The challenge posed by occlusions can be understood by looking at the underlying assumptions of optical flow algorithms. Traditional optical flow algorithms apply the bright- + +![](images/4d720788ecae26dfb4fb67fe03c1f212fc2dc67372eac6fb34d3576df3de2596.jpg) +Figure 2. Recovering hidden motions. In row 1, the bottom left corner of the ground moves out-of-frame, but reasoning that it belongs to the background allows the motion to be recovered from other parts of the image. In row 2, the girl's staff is mostly occluded in the second frame, but strong cues from the visible parts can resolve its motion. Our approach can estimate many hidden motions despite the presence of occlusions. The flow maps and the error maps have been fetched from the Sintel server [8]. Best viewed in colour on a screen. + +![](images/27e112da90cc4904c4c5b045086630c7a8a35ff4cd5b254f6e13e856d8c5b51a.jpg) + +![](images/2f804de4fcd2bc51fd85118bd695c9169382b7d81016331341b400248502717b.jpg) + +![](images/808641b10b3a798e246ed66500e923c968b7117fd68578e44390e71b20837302.jpg) + +![](images/32617848bd6da1b94e4a8c6f38bee980a65092c7ece278693f2db945ac18bc30.jpg) + +![](images/47b0478b03948ed9917bb0822cf1cbe0511d498b3867fba77b3dd51e8b8a310a.jpg) + +![](images/72f96eb14423b2bf9ef33f7a60705c306a80b3a1a2347cceb27fb4fc4ebb442e.jpg) + +ness constancy constraint [14], where pixels related by the flow field are assumed to have the same intensities. It is clear that occlusions are a direct violation of such a constraint. In the deep learning era, correlation (cost) volumes [15] are used to give a matching cost for each potential displacement of a pixel. However, correlations of appearance features are unable to give meaningful guidance for learning the motion of occluded regions. Most existing approaches use smoothness terms in an MRF to interpolate occluded motions [9] or use CNNs to directly learn the neighbouring relationships, hoping to learn to estimate occluded motions based on the neighbouring pixels [38, 36]. However, state-of-the-art methods still fail to estimate occluded motions correctly when occlusions are more significant and local evidence is insufficient to resolve the ambiguity. + +In contrast, humans are able to synthesise information from across the image and apply plausible motion models to accurately estimate occluded motions. This capability is valuable to emulate, because we fundamentally care about recovering the real 3D motion of objects in a scene, for which estimating occluded motion is necessary. Downstream applications, including tracking and activity detection [23], can also benefit from short-term predictions of the motion of occluded points, particularly if they reappear later or exhibit some characteristic of interest (e.g., high-velocity out-of-frame motions). + +Let us consider how to estimate these hidden motions for the two-frame case. When direct (local) matching information is absent, the motion information has to be propagated from other pixels. Using convolutions to propagate this information has the drawback of limited range since convolution is a local operation. We propose to aggregate the motion features with a non-local approach. Our design is based on the assumption that the motions of a single object (in the foreground or background) are often homogeneous. One source of information that is overlooked by existing works is self-similarities in the reference frame. For each pixel, understanding which other pixels are related to it, or which object it belongs to, is an important cue for accu + +rate optical flow predictions. That is, the motion information of non-occluded self-similar points can be propagated to the occluded points. Inspired by the recent success of transformers [39], we introduce a global motion aggregation (GMA) module, where we first compute an attention matrix based on the self-similarities of the reference frame, then use that attention matrix to aggregate motion features. We use these globally aggregated motion features to augment the successful RAFT [38] framework and demonstrate new state-of-the-art results in optical flow estimation, such as those examples in Figure 2. + +The key contributions of our paper are as follows. We show that long-range connections, implemented using the attention mechanism of transformer networks, are highly beneficial for optical flow estimation, particularly for resolving the motion of occluded pixels where local information is insufficient. We show that self-similarities in the reference frame provide an important cue for selecting the long-range connections to prioritise. We demonstrate that our global motion feature aggregation strategy leads to a significant improvement in optical flow accuracy in occluded regions, without damaging the performance in non-occluded regions, and analyse this extensively. We improve the average end-point error (EPE) by $13.6\%$ $(2.86\rightarrow 2.47)$ on Sintel Final and $13.7\%$ $(1.61\rightarrow 1.39)$ on Sintel Clean, compared to the strong baseline of RAFT [38]. Our approach ranks first on both datasets at the time of submission. + +# 2. Related Work + +Occlusions in optical flow. Occlusion poses a key challenge in optical flow estimation due to its violation of the brightness constancy constraint [14]. Most traditional optical flow algorithms treat occlusions as outliers and so develop and optimise robust objective functions. In continuous optimisation for optical flow, Brox et al. [6] used the $L^1$ norm due to its robustness to outliers caused by occlusions or large brightness variations. Zach et al. [46] added total variation regularisation and proposed an efficient numerical scheme to optimise the energy functional. This formulation + +![](images/359e6a37f63805ecd1accf17e7ee407133c61631e4f059c3fdb90b5fc0bb472e.jpg) +Figure 3. Proposed architecture. Our network is based on the successful RAFT [38] architecture. The proposed global motion aggregation (GMA) module is contained inside the shaded box, a self-contained addition to RAFT with low computational overhead that significantly improves performance. It takes the visual context features and the motion features as input and outputs aggregated motion features that share information across the image. These aggregated global motion features are then concatenated with the local motion features and the visual context features to be decoded by the GRU into residual flow. This gives the network the flexibility to choose between or combine the local and global motion features, depending on the needs of the specific pixel location. For example, a location with poor local image evidence, caused by occlusion for instance, could preference the global motion features. + +was later improved by Wedel et al. [42]. Later work introduced additional robust optimisation terms, including the Charbonnier potential [7] and the Lorentzian potential [4]. + +More recently, discrete optimisation approaches, especially Markov Random Fields (MRFs) [5], have been used to estimate optical flow. These algorithms [27, 9, 43] first estimate the forward and backward flows separately using a robust, truncated data term. They then conduct a forward-backward consistency check to determine the occluded regions. Lastly, as a post-processing step, they use interpolation methods [31] to fill in the optical flow of the occluded regions. + +Other work incorporates occlusion estimation as a joint objective together with optical flow estimation. Alvarez et al. [1] use forward-backward consistency as an optimisation objective, thus estimating time-symmetric optical flow. In addition to forward-backward consistency, MirrorFlow [18] incorporates occlusion-disocclusion symmetry in the energy function and achieves performance improvements. Since occlusions are caused by 3D motions, other works [35, 33] explicitly model local depth relationships into layers and reason about occlusions. + +Contrary to the above approaches, we do not overload the loss function with explicit occlusion reasoning. Instead, we adopt a learning approach, similar to other supervised deep optical flow learning approaches [36, 45, 17, 19, 44, 2, 47, 38, 22]. Rather than estimating an occlusion map explicitly, our goal is to improve the optical flow accuracy at occluded regions. We take an implicit approach to globally aggregate motion features, which provides extra information to correctly predict flow at occluded regions. Our approach can be thought of as a non-local interpolation approach [34], in contrast to local interpolation approaches [31]. In the deep learning literature, the occlusion problem has been addressed in an unsupervised learning set- + +ting [41, 21, 25], however, existing supervised learning approaches all rely on convolutions to interpolate in occluded regions, which are prone to failure for more significant occlusions. + +Self-attention and transformers. Our design principle is inspired by the recent successes of the transformer literature [39]. The transformer architecture was first successful in natural language processing (NLP), due to its ability to model long-range dependencies and its scalability for GPU parallel processing. Among various modules in the transformer architecture, self-attention is the key design feature that make transformers work. Recently, researchers have introduced the transformer and related attention ideas to the vision community, mostly in high-level tasks such as image classification [30, 10] and semantic segmentation [12, 40, 16]. To the best of our knowledge, we are the first to use the idea of attention to solve the optical flow problem. Different from many existing works in the transformer literature, we do not use self-attention in our work. Self-attention refers to the query, key and value vectors coming from the same features. In our case, query and key vectors come from the context features modelling the appearance of the image while value vectors come from the motion features, which is an encoding of the correlation volume. + +# 3. Method + +# 3.1. Background + +We base our network design on the successful RAFT architecture [38]. Our overall network diagram is shown in Figure 3. For completeness, we briefly describe the main contributions of RAFT from which our model benefits. The first contribution is the introduction of an all-pairs correlation volume, which explicitly models matching correlations + +![](images/671c022fe97ba3c96b8c3e64b24bce82fa559c65d467b6d753037a9744344718.jpg) +Figure 4. Details of the GMA module. To model the self-similarity of the first frame, we project the context feature map to a query feature map and a key feature map. We then take the dot product of the two feature maps and a softmax to obtain an attention matrix, which encodes self-similarity in appearance feature space. Similar to transformer networks [39], we also take the dot product between the query feature map and a set of positional embedding vectors which augments the attention matrix with positional information. Separately, the motion feature map encoded from the correlation volume is projected using the learned value projector. Its weighted sum, using the obtained attention matrix, produces the aggregated global motion features. + +for all possible displacements. The benefit of using all-pairs correlations is its ability to handle large motions. The second major contribution is the use of a gated recurrent unit (GRU) decoder for iterative residual refinement [19]. The constructed 4D correlation volumes are encoded to 2D motion features, which are iteratively decoded to predict the residual flow. The final flow prediction is a sum of the sequence of residual flows. The benefit of using a GRU to perform iterative refinement lies in the reduction of the search space. In RAFT, convolutions are used in the GRU decoder, which learn to model spatial smoothness. Due to the local nature of convolutions, they can learn to handle small occlusions but tend to fail when these become more significant and local evidence is insufficient to resolve the motion. + +# 3.2. Overview + +In his first paper from 1976, Geoffrey Hinton wrote that "local ambiguities have to be resolved by finding the best global interpretation" [13]. This idea still holds true in the modern deep learning era. To resolve ambiguities caused by occlusions, our core idea is to allow the network to reason at a higher level, that is, to globally aggregate the motion features of similar pixels, having implicitly reasoned about which pixels are similar in appearance feature space. We hypothesise that the network will be able to find points with similar motions by looking for points with similar appearance in the reference frame. This is motivated by the observation that the motions of points on a single object are often homogeneous. For example, the motion vectors of a person running to the right have a bias towards the right, which holds even if we do not see where a large part of the person ends up in the matching frame due to occlusion. We can use this statistical bias to propagate motion information from non-occluded pixels, with high (implicit) confidence, to occluded pixels, with low confidence. Here, confidence + +can be interpreted as whether there exists a distinct matching, i.e., a high correlation value at the correct displacement. + +With these ideas, we take inspiration from transformer networks [39], which are known for their ability to model long-range dependencies. Different from the self-attention mechanism in transformers, where query, key and value come from the same feature vectors, we use a generalized variant of attention. Our query and key features are projections of the context feature map, which are used to model the appearance self-similarities in frame 1. The value features are projections of the motion features, which themselves are an encoding of the 4D correlation volume. The attention matrix computed from the query and key features is used to aggregate the value features which are hidden representations of motions. We name this a Global Motion Aggregation (GMA) module. The aggregated motion features are concatenated with the local motion features as well as the context features, which is to be decoded by the GRU. A detailed diagram of GMA is shown in Figure 4. + +# 3.3. Mathematical Formulation + +Let $\mathbf{x} \in \mathbb{R}^{N \times D_{\mathrm{c}}}$ denote the context (appearance) features and $\mathbf{y} \in \mathbb{R}^{N \times D_{\mathrm{m}}}$ denote the motion features, where $N = HW$ and $H$ and $W$ are the height and width of the feature map, $D$ refers to the channel dimension of the feature map. The $i^{\text{th}}$ feature vector is denoted $\mathbf{x}_i \in \mathbb{R}^{D_{\mathrm{c}}}$ . Our GMA module computes the feature vector update as an attention-weighted sum of the projected motion features. The aggregated motion features are given by + +$$ +\hat {\mathbf {y}} _ {i} = \mathbf {y} _ {i} + \alpha \sum_ {j = 1} ^ {N} f (\theta (\mathbf {x} _ {i}), \phi (\mathbf {x} _ {j})) \sigma (\mathbf {y} _ {j}), \tag {1} +$$ + +where $\alpha$ is a learned scalar parameter initialised to zero, $\theta$ , $\phi$ and $\sigma$ are the projection functions for the query, key, and + +![](images/62c417308d66b7bfca5f0557fd3091c21bc82508d2a5bdb1be09a92e8fc93678.jpg) +(a) Reference Frame + +![](images/20bfd06ce5135fb06d7b93f156fdeb1fe4b3dfc6fbff9c230d02016bcc033709.jpg) +(b) Matching Frame +Figure 5. Examples of the Sintel Albedo dataset and occlusion maps. The Albedo dataset is rendered without the illumination effects. The occlusion map in this example contains mostly foreground objects occluding the background scene as well as the background on the left moving out of the field-of-view. Figure 5(c) is the occlusion map (Occ) for this example. Figure 5(d) and Figure 5(e) are the in-frame (Occ-in) and out-of-frame (Occ-out) occlusion maps respectively. + +![](images/49337d0b818a4644addf24c4b8f795703582633c1f9bdb0586e45904eda1c150.jpg) +(c) Occ + +![](images/b68b6b7cb8f420154335f6867f65d9c06c4ef5bdb1fc6e778063eac5df3cd153.jpg) +(d) Occ-in + +![](images/933370c4cd7dbbbae890280598c2f1e6de1a5e70dff50979a8ef178d375b3b39.jpg) +(e) Occ-out + +value vectors, and $f$ is a similarity attention function given by + +$$ +f \left(\mathbf {a} _ {i}, \mathbf {b} _ {j}\right) = \frac {\exp \left(\mathbf {a} _ {i} ^ {\top} \mathbf {b} _ {j} / \sqrt {D}\right)}{\sum_ {j = 1} ^ {N} \exp \left(\mathbf {a} _ {i} ^ {\top} \mathbf {b} _ {j} / \sqrt {D}\right)}. \tag {2} +$$ + +The projection functions for the query, key and value vectors are given by + +$$ +\theta \left(\mathbf {x} _ {i}\right) = \mathbf {W} _ {\text {q r y}} \mathbf {x} _ {i}, \tag {3} +$$ + +$$ +\phi \left(\mathbf {x} _ {i}\right) = \mathbf {W} _ {\text {k e y}} \mathbf {x} _ {i}, \tag {4} +$$ + +$$ +\sigma \left(\mathbf {y} _ {i}\right) = \mathbf {W} _ {\text {v a l}} \mathbf {y} _ {i}, \tag {5} +$$ + +where $\mathbf{W}_{\mathrm{qry}}, \mathbf{W}_{\mathrm{key}} \in \mathbb{R}^{D_{\mathrm{in}} \times D_{\mathrm{c}}}$ and $\mathbf{W}_{\mathrm{val}} \in \mathbb{R}^{D_{\mathrm{m}} \times D_{\mathrm{m}}}$ . The learnable parameters in our GMA module include $\mathbf{W}_{\mathrm{qry}}, \mathbf{W}_{\mathrm{key}}, \mathbf{W}_{\mathrm{val}}$ and $\alpha$ . + +The final output is $[\mathbf{y}|\hat{\mathbf{y}} |\mathbf{x}]$ , a concatenation of the three feature maps. The GRU decodes this to obtain the residual flow. Concatenation allows the network to intelligently select from or combine the motion vectors, modulated by the global context feature, without prescribing exactly how it is to do this. It is plausible that the network learns to encode some notion of uncertainty, and decodes the aggregated motion vector only when the model cannot be certain of the flow from the local evidence. + +We also explore the use of a 2D relative positional embedding [3], allowing the attention map to depend on both the feature self-similarity and the relative position from the query point. For this, we compute the aggregated motion vector as + +$$ +\hat {\mathbf {y}} _ {i} = \mathbf {y} _ {i} + \alpha \sum_ {j = 1} ^ {N} f (\theta (\mathbf {x} _ {i}), \phi (\mathbf {x} _ {j}) + \mathbf {p} _ {j - i}) \sigma (\mathbf {y} _ {j}), \tag {6} +$$ + +where $\mathbf{p}_{j - i}$ denotes the relative positional embedding vector indexed by the pixel offset $j - i$ . Separate embedding vectors are learned for the vertical and horizontal offsets and are summed to obtain $\mathbf{p}_{j - i}$ . If it is useful to suppress pixels that are very close or very far from the query point when aggregating the motion vectors, then this positional embedding has the capacity to learn this behaviour. + +We also investigated computing the attention map from only the query vectors and positional embedding vectors, + +without any notion of self-similarity. That is, + +$$ +\hat {\mathbf {y}} _ {i} = \mathbf {y} _ {i} + \alpha \sum_ {j = 1} ^ {N} f (\theta (\mathbf {x} _ {i}), \mathbf {p} _ {j - i}) \sigma (\mathbf {y} _ {j}). \tag {7} +$$ + +This can be regarded as learning long-range aggregation without reasoning about the image content. It is plausible that positional biases in the dataset could be exploited by such a scheme. In Table 2, the results for (6) and (7) are denoted as Ours $(+p)$ and Ours (p only). + +# 4. Experiments + +# 4.1. Experimental Setup + +We follow the standard optical flow training procedure [20, 36, 38] of first pre-training our model on FlyingChairs [11] for $120\mathrm{k}$ iterations with a batch size of 8 and then on FlyingThings [26] for another $120\mathrm{k}$ iterations with a batch size of 6. We then fine-tune on a combination of FlyingThings, Sintel [8], KITTI 2015 [28] and HD1K [24] for $120\mathrm{k}$ iterations for Sintel evaluation and $50\mathrm{k}$ on KITTI 2015 [28] for KITTI evaluation. A batch size of 6 is set for finetuning. We train our model on two 2080Ti GPUs with the PyTorch library [29] using the mixed precision strategy. We adopt the same hyperparameters as RAFT [38] for the base network. We adopt the one-cycle learning rate policy [32] with the highest learning rate set to $2.5 \times 10^{-4}$ for FlyingChairs then $1.25 \times 10^{-4}$ for the rest. For GMA, we choose channel dimensions $D_{\mathrm{in}} = D_{\mathrm{c}} = D_{\mathrm{m}} = 128$ . + +The main evaluation metric we use is average end-point error (AEPE), which refers to the mean pixelwise flow error. KITTI also uses the Fl-All (\%) metric which refers to the percentage of optical flow vectors whose end-point error is larger than 3 pixels or over $5\%$ of ground truth. + +The Sintel dataset has been created with different rendering passes that have different levels of complexity. For training and test evaluation on the Sintel server, we used the Clean and Final passes. The Clean pass is rendered with illumination including smooth shading and specular reflections. The Final pass is created with full rendering, which includes motion blur, camera depth-of-field blur, and atmospheric effects. + +In the Sintel training set, they also provided the Albedo pass, which is rendered without illumination effects and has + +
Sintel DatasetTypeRAFT (AEPE)Ours (AEPE)Rel. Impr. (%)
Clean (train)Noc0.320.299.3
Occ5.364.2520.7
Occ-in4.453.8114.4
Occ-out7.015.0328.2
All0.740.6216.2
Final (train)Noc0.660.5910.6
Occ7.096.2212.2
Occ-in6.215.3014.6
Occ-out8.717.909.3
All1.191.0610.9
Albedo (test)Noc0.340.325.9
Occ6.355.5812.1
Occ-in5.835.2310.3
Occ-out7.296.2015.0
All0.840.769.5
+ +Table 1. Optical flow error for different Sintel datasets, partitioned into occluded ('Occ') and non-occluded ('Noc') regions. In-frame and out-of-frame occlusions are further split and denoted as 'Occ-in' and 'Occ-out'. The best results and the largest relative improvement in each dataset are styled in bold. + +roughly piecewise-constant colours. An example is shown in Figure 5. We do not use this set for training, but reserve it as an evaluation dataset. The motivation for doing so is that the Albedo set adheres to brightness constancy everywhere apart from occluded regions. By evaluating and analysing on the occluded regions and non-occluded regions separately, we can clearly see how well our method performs when addressing the occlusion problem. + +# 4.2. Occlusion Analysis + +To verify the effectiveness of our proposed GMA module at estimating the motion of occluded points, we make use of the occlusion maps provided in the Sintel training set, which partition the pixels into non-occluded (Noc) and occluded (Occ) pixels. We further divide the occluded pixels into in-frame ('Occ-in') and out-of-frame ('Occ-out') occlusions, depending on whether the ground-truth flow vector points inside or outside the image frame. An example is shown in Figure 5. + +We evaluated on all three rendering passes of Sintel, where the results for Clean and Final are training set errors and those for Albedo are test set errors. We evaluated the AEPE for different regions, results of which are shown in Table 1. We observe that the relative improvement of our method compared to RAFT is predominantly attributable to better predictions of the flow for occluded points. This is reinforced by the results on the Albedo dataset where the brightness constancy assumption holds exactly for non + +occluded points, removing confounding factors. Finally, out-of-frame occlusions are more challenging than in-frame occlusions for both models, but we still observe a significant improvement for these pixels. We hypothesise that the improvement in non-occluded regions is due to GMA's ability to resolve ambiguities caused by other brightness variations, for example specular reflections, blurs, and other sources. This result strongly supports our claim that global aggregation can help resolve ambiguities caused by occlusion. + +# 4.3. Comparison with Prior Works + +Having shown that our approach can improve optical flow estimates for occluded regions, we compare against prior works on the overall performance. We evaluate our approach on the Sintel dataset [8] and the KITTI 2015 optical flow dataset [28]. At the time of submission, we have obtained the best results on both the Sintel Final and Clean benchmarks among all submitted results published and unpublished. Compared with our baseline approach RAFT [38], we have improved the AEPE from 2.86 to 2.47 (13.6% improvement) on Sintel Final and 1.61 to 1.39 (13.7% improvement) on Sintel Clean. This significant improvement over RAFT validates our claim that our approach can improve flow prediction for occluded regions without damaging the performance of non-occluded regions. The Sintel server also reports the metric 'EPE unmatched', which measures the endpoint error over regions that are visible only in one frame, predominantly caused by occlusion. Our approach also ranks first under this metric in both Clean and Final, with a margin of 0.9 EPE on Clean (2.2 w.r.t. RAFT) and 1.3 EPE on Final (1.7 w.r.t. RAFT). Overall, our model achieves a new state-of-the-art result in optical flow estimation, which demonstrates the usefulness of addressing the occlusion problem in optical flow. + +On the KITTI 2015 test set, our results are on par with RAFT. 'Ours (p only), which uses positional attention only, outperforms RAFT, while 'Ours', which uses content self-similarity attention, slightly underperforms. It is likely that the lack of improvement on this dataset is due to having insufficient training data (only 200 pairs of images) for the network to learn high-level appearance feature similarities. + +# 4.4. Qualitative Results + +Qualitative results are shown in Figure 2 for two examples in the Sintel Clean dataset. The optical flow error in regions of the image that move out-of-frame or behind another object is significantly reduced compared to RAFT. These scenes are highly challenging with lots of motion and occlusion. For example, it is not unreasonable that RAFT is unable to keep track of the wooden staff that becomes partially occluded in the second image, given that it is well-camouflaged in a forest, fast-moving, and very thin. However, our model is able to very accurately predict the staff's + +
Training DataMethodSintel (train)KITTI-15 (train)Sintel (test)KITTI-15 (test)
CleanFinalAEPEFl-all (%)CleanFinalFl-all (%)
C + TVCN[44]2.213.688.3625.1---
MaskFlowNet[47]2.253.61-23.1---
FlowNet2[20]2.023.5410.0830.03.966.02-
RAFT[38]1.432.715.0417.4---
Ours (p only)1.482.885.0116.9---
Ours (+p)1.332.874.8316.6---
Ours1.302.744.6917.1---
C + TFlowNet2 [20](1.45)(2.01)(2.30)(6.8)4.165.7411.48
PWC-Net+ [37](1.71)(2.34)(1.50)(5.3)3.454.607.72
VCN [44](1.66)(2.24)(1.16)(4.1)2.814.406.30
MaskFlowNet[47]----2.524.176.10
RAFT[38](0.76)(1.22)(0.63)(1.5)1.61*2.86*5.10
C + T + S/K (+ H)Ours (p only)(0.64)(1.08)(0.56)(1.2)1.48*2.56*4.93
Ours (+p)(0.65)(1.11)(0.58)(1.3)1.54*2.63*5.08
Ours(0.62)(1.06)(0.57)(1.2)1.39*2.47*5.15
+ +Table 2. Quantitative results on Sintel and KITTI 2015 datasets. We report the average end-point error (AEPE) where not otherwise stated, as well as the F1-all measure for the KITTI dataset, which is the percentage of optical flow outliers with an error larger than 3 pixels. “C + T” refers to results that are pre-trained on the Chairs and Things datasets. “S/K (+H)” refers to methods that are fine-tuned on the Sintel and KITTI datasets, with some also fine-tuned on the HD1K dataset. Parentheses denote training set results and bold font denotes the best result. “Ours (p only)” denotes the position-only attention model defined in (7). “Ours (+p)” denotes the joint position and content-wise attention model defined in (6). “Ours” denotes our main content-only self-similarity attention model defined in (1). *Results evaluated with the “warm-start” strategy detailed in the RAFT paper [38]. + +![](images/0b9146aa0d5cfc8435810bc51d093d0124d809f559d2eb55f84b06a747bc1bad.jpg) +Figure 6. Attention map visualisations. For each row, we show the first frame and three query points. Then we show the three attention maps corresponding to these query points (brighter colours mean higher attention weights). We also give a visualisation of the predicted optical flow for comparison. Best viewed on screen. + +motion, despite these challenges. + +We also present visualisations of the learned attention maps for two examples in Figure 6. To train effectively, the network should learn to attend to pixels that share similar motion vectors. For foreground points, we expect this to be most easily achieved by attending to points on the same object, while for background points it may be sufficient to attend to any other background point. These examples justify this expectation and provide support for the argument that appearance (and higher-order) self-similarity is being learned by the network, and that this is helpful for estimating the flow of the occluded points. + +# 4.5. Ablation Results + +To verify our design, we conducted the following ablation experiments. We first compare the performance of the tested variants of the model, where positional attention replaces (p only) or adds to $(+p)$ the self-similarity attention, as presented in Table 2. We find that self-similarity is sufficient to achieve the performance improvements, with the positional encoding only helping for the KITTI dataset. This coincides with our intuition that long-range connections are helpful and that distance-based suppression is unnecessary. In addition, we ablate over three design choices: (1) learning the scalar parameter $\alpha$ vs fixing it at 1, (2) concatenating with local motion features vs replacing local mo + +
ComponentChairs (val)ThingsSintel
Clean (test)Final (test)Clean (train)Final (train)
10.823.102.781.352.82
α0.793.142.801.302.74
replace0.883.162.941.412.79
concatenate0.793.142.801.302.74
w/o residual0.883.132.831.402.75
w/ residual0.793.142.801.302.74
+ +Table 3. Ablation experiment results. Settings used in our final model are underlined. + +
MetricRAFT [38]Ours
Parameters5.3M5.9M
Timing60ms72ms
GPU Memory16.0GB17.7GB
+ +Table 4. Timing, parameters and memory. The GMA module has a modest computational overhead. + +tion features, and (3) using a residual connection (adding the output of the aggregator to the local motion features) vs not using residual connection (directly concatenating the output of the aggregator with the motion features and context features). The results are shown in Table 3. + +The key experiment here is showing that concatenation is an important part of the network design. The hypothesis was that the network should learn how to select or combine the local and globally-aggregated features, based on some implicit measure of uncertainty. That is, it is not helpful to replace local features in most non-occluded regions, where they may be more reliable and precise than the aggregated features. While the residual connection may also be able to handle this, using both mechanisms leads to the best performance. + +# 4.6. Timing, Parameter Counts and Memory + +We demonstrate that the computational overhead of GMA is low relative to the performance improvement, as shown in Table 4. The parameter count for our model is $5.9\mathrm{M}$ compared to RAFT which is $5.3\mathrm{M}$ . We tested the inference time on a single RTX 3090 GPU, with RAFT taking $60\mathrm{ms}$ on average and ours taking $72\mathrm{ms}$ for a single pair of image in the Sintel dataset. The image size is $436\times 1024$ . The GRU iteration number is set to 12. We also tested the GPU memory consumption for training. When training on FlyingChairs on a single 3090 card, with a random crop of $368\times 496$ and batch size of 8, RAFT takes 16.0GB memory while our network takes 17.2GB memory. We can see that overall the computational overhead is modest while the improvement in results is significant. + +# 5. Discussion + +We have demonstrated empirically that long-range connections, weighted by image self-similarities, are very effective at resolving the optical flow of occluded 3D points. The intuition is that if the network can determine which non-occluded points are moving in the same way, this information can be transmitted to 'in-paint' the motion of the occluded points. Determining which points have similar motion characteristics is a non-trivial task and relies on the exploitation of statistical biases. Similar flow vectors are frequently observed for points belonging to the same class, due to the homogeneous motion in 3D. This suggests that we should enable the network to aggregate over motions of the same scene objects, which motivates our choice to explicitly expose the self-similarity of image features to our GMA module. However, additive aggregation of this kind is only helpful when the flow field of the attended locations is approximately homogeneous. This does not hold exactly for general object and camera motions, where the flow fields may be far from homogeneous, even on the same rigid object. An example is an object that is directly in front of the camera and rotating about the optical axis, where the flow vectors are in opposite directions. To deal with such scenarios, one possible future work is to first transform the motion features based on the relative positions and perform aggregation afterwards. + +# 6. Conclusion + +Occlusions have long been considered a significant challenge and a major source of error in optical flow estimation. Inspired by the recent success of transformers, we introduce a global motion aggregation module to globally aggregate motion features based on appearance self-similarity of the first image. This has been validated by experiments that show significantly improved optical flow predictions for occluded regions, particularly the large reduction of EPE on Sintel Clean and Final. Our approach of aggregating information over long-range connections using self-similarity is a simple and effective way to introduce higher-order reasoning into the optical flow problem and is applicable to any supervised flow network. We expect that further development of aggregation mechanisms or alternatives would lead to additional performance improvements. + +# Acknowledgements + +This research is funded in part by the ARC Centre of Excellence for Robotic Vision (CE140100016), ARC Discovery Project grant (DP200102274) and (DP190102261), and Continental AG (D.C.). S.J. would like to thank Jing Zhang and Yujiao Shi for helpful discussions. We thank the anonymous reviewers for their valuable comments. + +# References + +[1] Luis Alvarez, Rachid Deriche, Théo Papadopoulos, and Javier Sánchez. Symmetrical dense optical flow estimation with occlusions detection. *IJCV*, 2007. +[2] Aviram Bar-Haim and Lior Wolf. Scopeflow: Dynamic scene scoping for optical flow. CVPR, 2020. +[3] Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. ICCV, 2019. +[4] Michael J Black and Paul Anandan. The robust estimation of multiple motions: Parametric and piecewise-smooth flow fields. CVIU, 1996. +[5] Yuri Boykov and Vladimir Kolmogorov. An experimental comparison of min-cut/max-flow algorithms for energy minimization in vision. TPAMI, 2004. +[6] Thomas Brox, Andres Bruhn, Nils Papenberg, and Joachim Weickert. High accuracy optical flow estimation based on a theory for warping. ECCV, 2004. +[7] Andres Bruhn, Joachim Weickert, and Christoph Schnorr. Lucas/kanade meets horn/schunck: Combining local and global optic flow methods. IJCV, 2005. +[8] D. J. Butler, J. Wulff, G. B. Stanley, and M. J. Black. A naturalistic open source movie for optical flow evaluation. ECCV, 2012. +[9] Qifeng Chen and Vladlen Koltun. Full flow: Optical flow estimation by global optimization over regular grids. CVPR, 2016. +[10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. ICLR, 2020. +[11] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. ICCV, 2015. +[12] Jun Fu, Jing Liu, Hajie Tian, Yong Li, Yongjun Bao, Zhiwei Fang, and Hanqing Lu. Dual attention network for scene segmentation. CVPR, 2019. +[13] G Hinton. Using relaxation to find a puppet. Proceedings of the 2nd Summer Conference on Artificial Intelligence and Simulation of Behaviour, 1976. +[14] Berthold KP Horn and Brian G Schunck. Determining optical flow. Techniques and Applications of Image Understanding, 1981. +[15] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. TPAMI, 2012. +[16] Zilong Huang, Xinggang Wang, Lichao Huang, Chang Huang, Yunchao Wei, and Wenyu Liu. Ccnet: Criss-cross attention for semantic segmentation. ICCV, 2019. +[17] Tak-Wai Hui, Xiaou Tang, and Chen Change Loy. Liteflownet: A lightweight convolutional neural network for optical flow estimation. CVPR, 2018. + +[18] Junhwa Hur and Stefan Roth. Mirrorflow: Exploiting symmetries in joint optical flow and occlusion estimation. ICCV, 2017. +[19] Junhwa Hur and Stefan Roth. Iterative residual refinement for joint optical flow and occlusion estimation. CVPR, 2019. +[20] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. CVPR, 2017. +[21] Joel Janai, Fatma Guney, Anurag Ranjan, Michael Black, and Andreas Geiger. Unsupervised learning of multi-frame optical flow with occlusions. ECCV, 2018. +[22] Shihao Jiang, Yao Lu, Hongdong Li, and Richard Hartley. Learning optical flow from a few matches. CVPR, 2021. +[23] Dieter Koller, Joseph Weber, and Jitendra Malik. Robust multiple car tracking with occlusion reasoning. ECCV, 1994. +[24] Daniel Kondermann, Rahul Nair, Katrin Honauer, Karsten Krispin, Jonas Andrulis, Alexander Brock, Burkhard Gussefeld, Mohsen Rahimimoghaddam, Sabine Hofmann, Claus Brenner, et al. The hci benchmark suite: Stereo and flow ground truth with uncertainties for urban autonomous driving. CVPR Workshop, 2016. +[25] Pengpeng Liu, Michael Lyu, Irwin King, and Jia Xu. Selfflow: Self-supervised learning of optical flow. CVPR, 2019. +[26] N. Mayer, E. Ilg, P. Häusser, P. Fischer, D. Cremers, A. Dosovitskiy, and T. Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. CVPR, 2016. +[27] Moritz Menze, Christian Heipke, and Andreas Geiger. Discrete optimization for optical flow. *GCR*, 2015. +[28] Moritz Menze, Christian Heipke, and Andreas Geiger. Joint 3d estimation of vehicles and scene flow. ISPRS Workshop on Image Sequence Analysis, 2015. +[29] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. NIPS Workshop, 2017. +[30] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. NeurIPS, 2019. +[31] Jerome Revaud, Philippe Weinzaepfel, Zaid Harchaoui, and Cordelia Schmid. Epicflow: Edge-preserving interpolation of correspondences for optical flow. CVPR, 2015. +[32] Leslie N Smith and Nicholay Topin. Super-convergence: Very fast training of neural networks using large learning rates. Artificial Intelligence and Machine Learning for Multi-Domain Operations Applications, 2019. +[33] Deqing Sun, Ce Liu, and Hanspeter Pfister. Local layering for joint motion estimation and occlusion detection. CVPR, 2014. +[34] Deqing Sun, Stefan Roth, and Michael J Black. Secrets of optical flow estimation and their principles. 2010. +[35] Deqing Sun, Erik B Sudderth, and Michael J Black. Layered image motion with explicit occlusions, temporal consistency, and depth ordering. NIPS, 2010. +[36] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. CVPR, 2018. + +[37] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Models matter, so does training: An empirical study of cnns for optical flow estimation. TPAMI, 2019. +[38] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. ECCV, 2020. +[39] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. NIPS, 2017. +[40] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. CVPR, 2018. +[41] Yang Wang, Yi Yang, Zhenheng Yang, Liang Zhao, Peng Wang, and Wei Xu. Occlusion aware unsupervised learning of optical flow. CVPR, 2018. +[42] Andreas Wedel, Thomas Pock, Christopher Zach, Horst Bischof, and Daniel Cremers. An improved algorithm for tv-1 1 optical flow. Statistical and Geometrical Approaches to Visual Motion Analysis, 2009. +[43] Jia Xu, René Ranftl, and Vladlen Koltun. Accurate optical flow via direct cost volume processing. CVPR, 2017. +[44] Gengshan Yang and Deva Ramanan. Volumetric correspondence networks for optical flow. NeurIPS, 2019. +[45] Zhichao Yin, Trevor Darrell, and Fisher Yu. Hierarchical discrete distribution decomposition for match density estimation. CVPR, 2019. +[46] Christopher Zach, Thomas Pock, and Horst Bischof. A duality based approach for realtime tv-1 optical flow. *Joint Pattern Recognition Symposium*, 2007. +[47] Shengyu Zhao, Yilun Sheng, Yue Dong, Eric I Chang, Yan Xu, et al. Maskflownet: Asymmetric feature matching with learnable occlusion mask. CVPR, 2020. \ No newline at end of file diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/images.zip b/learningtoestimatehiddenmotionswithglobalmotionaggregation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8bf016de8a320e53cc440dfcb0b4ccac77dec3db --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1723b502540b11e771e79f96074bbc7e6212d04ef1b8ef64567b3d15c0c96980 +size 469795 diff --git a/learningtoestimatehiddenmotionswithglobalmotionaggregation/layout.json b/learningtoestimatehiddenmotionswithglobalmotionaggregation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6c1c54f1abf62e83e3f41ab8f85b39a3190be8bb --- /dev/null +++ b/learningtoestimatehiddenmotionswithglobalmotionaggregation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a53be6a25817ae5a0b9316e48bfe69ed46a712da346c8b79275eeed177361768 +size 336593 diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_content_list.json b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e10632bb22a99a520e29f2b490ffec4aea8e18fa --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6863e8588f7f00b52196e3eece6034539737b5f0d4388da184dc0761a026c43 +size 96553 diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_model.json b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cd9f29cad2afc6e9abe1757968362414638445b1 --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e6c53033743f6bc1317bbcd5b021ee7b3677c7294b9fb8e929b37ffed04129d +size 117095 diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_origin.pdf b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..57b67e308a6a516d9de6bb6350ea88d7b411cdd9 --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/c3574bed-8d48-40d1-9efc-43b23c6f6460_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b60872ad241a18f07347c754b79501a5669d64025b32a083bf9acabf1b10a6f +size 1203009 diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/full.md b/learningtogeneratescenegraphfromnaturallanguagesupervision/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fce95b66395d05589a3489e2db621f95d283707e --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/full.md @@ -0,0 +1,363 @@ +# Learning to Generate Scene Graph from Natural Language Supervision + +Yiwu Zhong $^{1}$ , Jing Shi $^{2}$ , Jianwei Yang $^{3}$ , Chenliang Xu $^{2}$ , Yin Li $^{1}$ $^{1}$ University of Wisconsin-Madison $^{2}$ University of Rochester $^{3}$ Microsoft Research + +# Abstract + +Learning from image-text data has demonstrated recent success for many recognition tasks, yet is currently limited to visual features or individual visual concepts such as objects. In this paper, we propose one of the first methods that learn from image-sentence pairs to extract a graphical representation of localized objects and their relationships within an image, known as scene graph. To bridge the gap between images and texts, we leverage an off-the-shelf object detector to identify and localize object instances, match labels of detected regions to concepts parsed from captions, and thus create "pseudo" labels for learning scene graph. Further, we design a Transformer-based model to predict these "pseudo" labels via a masked token prediction task. Learning from only image-sentence pairs, our model achieves $30\%$ relative gain over a latest method trained with human-annotated unlocalized scene graphs. Our model also shows strong results for weakly and fully supervised scene graph generation. In addition, we explore an open-vocabulary setting for detecting scene graphs, and present the first result for open-set scene graph generation. + +# 1. Introduction + +An image might have millions of pixels, yet its visual content can be often summarized using dozens of words. Images and their text descriptions (i.e. captions) are available in great abundance from the Internet [40], and offer a unique opportunity of image understanding aided by natural language. Learning visual knowledge from image-text pairs has been a long-standing problem [50, 8, 14, 7, 22, 54, 58, 16, 61, 37, 11, 35], with recent success on learning deep models for visual representation [7, 22, 37, 11, 35], and for recognizing and detecting individual visual concepts (e.g. objects) [54, 58, 61, 35, 16]. In this paper, we ask the question: can we learn to detect visual relationships beyond individual concepts from image-text pairs? Fig. 1 (a) illustrates an example of such relationships ("man drive boat"). + +As a first step, we focus on learning scene graph generation (SGG) from image-sentence pairs. A scene graph is a symbolic and graphical representation of an image, + +![](images/cd30c7adb063088c618eae3ba49aeb58ba7663b4908a5b4b727d72794c4252f2.jpg) +Figure 1. Top (our setting): Our goal is learning to generate localized scene graphs from image-text pairs. Once trained, our model takes an image and its detected objects as inputs and outputs the image scene graph. Bottom (our results): A comparison of results from our method and [60] with varying levels of supervision. + +with each graph node as a localized object and each edge as a relationship (e.g. a predicate) between a pair of objects. Scene graph has emerged as a structured representation for many vision tasks, including action recognition [19], 3D scene understanding [1, 49], image generation and editing [21, 13], and vision-language tasks (e.g. image captioning [55, 56, 66] and visual question answering [41, 47, 17, 17]). Most previous scene graph methods [52, 28, 62, 27, 53, 4, 46, 45, 65] follow a fully supervised approach, relying on human annotations of object bounding boxes, object categories and their relationships. These annotations are very costly and difficult to scale. Recently, Zareian et al. [60] considered weakly supervised learning of scene graphs from image-level labels of unlocalized scene graphs. Nonetheless, learning scene graphs from images and their text descriptions remains unexplored. + +A major challenge of learning scene graphs from image-sentence pairs is the missing link between many candidate image regions and a few concepts (e.g. nouns and predicates) parsed from an image caption. To this end, we propose to leverage off-the-shelf object detectors, capable of identifying and localizing object instances from hundreds of common categories. Our key idea is that object labels + +of detected image regions can be further matched to sentence concepts, and thus provide "pseudo" labels for learning scene graphs, thereby bridging the gap between region-concept pairs. Our hypothesis is that these "pseudo" labels, coupled with a large-scale dataset, can be used for training a deep model to detect scene graph of an input image. Our language supervised setting is shown in Fig. 1 (a). + +Inspired by the recent success of vision-language pretraining [9, 26, 67, 31, 43, 44, 30], we develop a Transformer-based model for learning to generate scene graphs supervised by image-sentence pairs. Specifically, our model takes inputs of visual features from a pair of detected object regions, text embeddings of their predicted categorical labels, and contextual features from other object regions, all provided by an off-the-shelf detector [36]. Our model then learns to recognize the visual relationship between the input object pair, represented as a localized subject-predicate-object (SPO) triplet. A scene graph can thus be generated by enumerating all pairs from a small set of detected objects. During training, our model learns from only image-sentence pairs using "pseudo" labels produced by matching the detected object labels to the parsed sentence concepts. During inference, our model generates a scene graph given an input image with its detection results. + +Our model is trained on captioning datasets including COCO Caption [6] and Conceptual Caption [40], and evaluated on Visual Genome [23] — a widely used scene graph benchmark. Our results, summarized in Fig. 1 (b), significantly outperform the state of the art [60] on weakly supervised SGG by a relative margin of $30\%$ , despite that our model only requires image-sentence pairs for training while [60] is trained using human-annotated unlocalized scene graphs. With the same supervision as [60], our model achieves a relative gain of $112\%$ in recall. Further, our model also demonstrates strong results on fully supervised SGG. While these results are reported on closed-set setting with known target concepts during training, we also present promising results on open-set SGG where the concept vocabulary is crafted from image captions. Our work is among the first methods for learning to detect scene graphs from only image-sentence pairs, and presents the first result for open-set SGG. We believe our work provides a solid step towards structured image understanding. + +# 2. Related Work + +We briefly review recent works on learning visual knowledge from natural language and scene graph generation, with a focus on the development of deep models. + +Learning Visual Knowledge from Language. The availability of images and their text descriptions on the Internet has spurred a surge of interest in learning from image-text pairs. Early works focused on learning from image-hastag pairs for visual representation learning [7, 22] and for rec + +ognizing objects, scenes, and actions [8, 14, 15, 25]. More recent works have shifted attention to learning from images and their sentence descriptions. For example, image-sentence pairs were used for visual representation learning via image captioning [11], image-text matching [35], or image-conditioned language modeling [37], and for visual and textual representation learning using context prediction tasks [9, 26, 67, 31, 43, 44, 30]. Image captions were exploited for object recognition [50] and object detection [58, 18, 54, 61]. Unlike these previous works, our work learns to detect localized scene graphs that encode objects and their relationships in an input image. Inspired by previous works on visual and textual representation learning, we propose a Transformer-based model for scene graph generation and formulate the problem as predicting masked tokens of subject, predicate and object. + +Fully Supervised Scene Graph Generation. An image scene graph represents localized object instances as nodes and their relationships as edges on the graph. Scene graph generation (SGG) aims to extract this graphical representation from an input image. A related problem is visual relationship detection (VRD) [59, 29, 63, 10] that also localizes objects and recognizes their relationships yet without the notation of a graph. Thanks to the development of largescale densely annotated image scene graph datasets, such as Visual Genome (VG) dataset [23], a large array of methods have been proposed for scene graph generation. Several different models have been explored, including iterative message passing [52, 28], recurrent network [62], tree structure encoding [46, 51], graph convolution and pruning [27, 53], casual reasoning [4, 45] and contrastive learning [65]. A major drawback of these approaches is the requirement of human-annotated, localized scene graphs with categorical labels and locations of all nodes and edges. Our work seeks to address this drawback by learning to detect scene graphs from only image-sentence pairs. + +Weakly-supervised Scene Graph Generation. Several recent works have explored weakly supervised settings for VRD [34, 3, 64] and SGG [64, 60, 42]. Most of them addressed the task of VRD and seeks to learn from unlocalized SPO triplets. For example, Peyre et al. [34] proposed to assign image-level labels to pairs of detected objects via discriminative clustering. Baldassarre et al. [3] first predicted visual predicates given the detected objects, and then retrieved the subjects and objects using backward explanation techniques. Zhang et al. [64] designed a fully convolutional network to jointly learn object detection and predicate prediction from image-level labels, using object proposals as model inputs. They reported results on both VRD and SGG. The most relevant work is from Zareian et al. [60]. They proposed learning from unlocalized scene graphs for SGG, and developed a message passing mechanism to update features of detected objects and to gradually refine la + +bels of objects and predicates. Our recent work [42] presented a simple baseline for weakly supervised SGG using first-order graph matching. A concurrent work from Ye et al. [57] also explored learning scene graph with linguistic structures as supervision. Similar to these approaches, our method explores learning using less labels for SGG. Unlike previous approaches, our method leverages image captions — a different type of labels that are easier to obtain than unlocalized SPO triplets or scene graphs. Our work is thus among the first methods to detect scene graphs by learning from only image-sentence pairs. + +# 3. Scene Graph from Language Supervision + +With a large collection of paired images $\{I\}$ and captions $\{S\}$ , our goal is learning to detect an image scene graph $\mathcal{G} = (\mathcal{V}, \mathcal{E})$ from an input image $I$ . $\mathcal{G}$ is a directed graph with nodes $\mathcal{V}$ and edges $\mathcal{E}$ . Each node $v_i \in \mathcal{V}$ denotes a localized object in $I$ , represented by its bounding box $b_i$ and object label $o_i$ within a vocabulary $\mathcal{C}_o^g$ . Each edge $e_{ij} \in \mathcal{E}$ denotes a predicate (e.g. "drive") from a vocabulary $\mathcal{C}_p^g$ pointing from node $v_i$ to node $v_j$ , where $T_{ij} = (v_i, e_{ij}, v_j)$ defines a triplet of subject-predict-object (SPO). Scene graph generation is thus a challenging structured output prediction problem. + +Similar to previous SGG methods [52, 63, 46, 62, 60], we assume a set of object regions $R = \{r_n\}$ provided by an detector. Each region $r_n = (\bar{b}_n, \bar{o}_n)$ consists of a bounding box $\bar{b}_n$ and a predicted object category $\bar{o}_n$ from a vocabulary $\mathcal{C}_o^d$ given by the detector. $r_n$ thus defines a candidate node of the target scene graph $\mathcal{G}$ . It is worth noting that the vocabulary of the detector $\mathcal{C}_o^d$ is different from the vocabulary of the scene graph $\mathcal{C}_o^g$ (i.e. $\mathcal{C}_o^d \neq \mathcal{C}_o^g$ ). With object regions $R = \{r_n\}$ , SGG is reduced to classify $r_n$ into object categories $(\mathcal{C}_o^g \cup \{\text{background}\})$ , and infer the predicate label $(\mathcal{C}_p^g \cup \{\text{background}\})$ between each subject-object region pair $(r_k, r_l)$ . A main innovation of our model is to learn from only image-sentence pairs for SGG, without the need of ground-truth object labels nor their relationships. + +Learning from Language Supervision. Our key idea is to extract SPO triplets from an image caption, and match these triplets to object categories of image regions given by the detector, thereby creating "pseudo" labels for these regions and their relationships. Specifically, we adopt a language parser to extract a set of triplets $\{T'\}$ from the caption $S$ . We further link object region pairs $\{r_k, r_l\}$ in the image $I$ provided by the detector to the parsed sentence triplets $T'$ . This is done by matching detected object categories $\bar{o}_k$ and $\bar{o}_l$ from every region pair to the subject and object in each $T'$ , respectively. If matched, the sentence triplet $T'$ will define a "pseudo" label for the region pair $(r_k, r_l)$ (subject, object) and their relationship $e_{kl}$ (predicate). These "pseudo" labels can then be used to train our model. + +Comparison to Fully and Weakly Supervised Settings. + +
Scene Graph Generation SettingsRequired Annotation during Training
Image DescriptionObject&Predicate Category LabelsObject Boxes
Fully Supervised [52]✓✓
Weakly Supervised [60]✓
Language Supervised (ours)✓
+ +Table 1. Our language supervised setting vs. fully supervised and weakly supervised settings. Our method learns from only image-sentence pairs to generate localized image scene graphs. + +Our setting of learning to generate scene graphs from image-sentence pairs is different from previous fully and weakly supervised settings, as shown in Table 1. Our setting provides a new opportunity of learning structured visual knowledge from natural language supervision. + +Overview of Our Model. Our model, inspired by recent works in vision-language pretraining [9, 26, 67, 31, 43, 44, 30], seeks to label the SPO triplet given a pair of regions. Specifically, we design a Transformer-based model with its inputs as a region pair $(r_k, r_l)$ and the contextual features from other regions $\{r_n\} - \{r_k, r_l\}$ . Our model then predicts the category labels $(o_k, e_{kl}, o_l)$ of a SPO triplet $T_{kl}$ for the input region pair $(r_k, r_l)$ . During training, our model is supervised by the "pseudo" labels $T'$ parsed from caption $S$ . During inference, our model takes inputs of the image $I$ and its detection results $R = \{r_n\}$ , labels every region pair $(r_k, r_l)$ , and aggregates the SPO triplets into a full scene graph. Fig. 2 illustrates our model. + +# 3.1. Triplet Transformer + +Our proposed Triplet Transformer is a triplet labeling model based on an input region pair and its contextual features. Specifically, for each region $r_n = (\bar{b}_n,\bar{o}_n)$ , we denote its visual, positional, and textual features as $\mathbf{x}_n^r$ , $\mathbf{x}_n^p$ , and $\mathbf{x}_n^o$ , respectively. $\mathbf{x}_n^r$ is the visual feature (ROI) pooled from the region $\bar{b}_n$ . $\mathbf{x}_n^p$ is a feature encoding the position of the bounding box, i.e., a 7-D vector with the normalized top/left/bottom/right coordinates, width, height and area for the region box $\bar{b}_n$ . $\mathbf{x}_n^o$ is the word embedding of the region object label $\bar{o}_n$ . Given an input region pair $(r_k,r_l)$ and all other detected regions, our model builds a composition function $f = g\circ h$ to predict the labels $(o_k,e_{kl},o_l)$ of a SPO triplet, given by + +$$ +o _ {k}, e _ {k l}, o _ {l} = g \circ h \left(\underbrace {\mathbf {x} _ {k} ^ {o} , \mathbf {x} _ {l} ^ {o}} _ {\text {T e x t u a l E m b e d d e r}}, \underbrace {\mathbf {x} _ {k} ^ {r} , \mathbf {x} _ {l} ^ {r} , \mathbf {x} _ {k} ^ {p} , \mathbf {x} _ {l} ^ {p}} _ {\text {V i s u a l E m b e d d e r}}, \overbrace {\{\mathbf {x} _ {u} ^ {r} , \mathbf {x} _ {u} ^ {p} \} _ {u \neq k , l}} ^ {\text {C o n t e x u a l F e a t u r e s}}\right) +$$ + +where $u$ indexes all regions except $r_k$ and $r_l$ . + +Our model thus consists of: (1) a visual embedder that encodes visual and positional region features; (2) a textual embedder that embeds textual region features (from object labels); (3) a multi-layer Transformer $h$ that conducts message passing among the input visual and textual embeddings; and (4) classification heads $g$ that predict the labels of a triplet. We now present details for each component. + +![](images/6fc3baaf60c254b5ac132ff58b4067452a0a0e270151833baabceaf3dbcc5681.jpg) +Figure 2. Overview of our proposed model for language supervised scene graph generation. Given an image, an object detector is first applied with the detected objects as the inputs to our model. Our model further embeds the detected region features and textual object categories (e.g., the tags of a pair of subject-object, the MASK representing the predicate) into token embeddings, followed by a multi-layer Transformer encoder. Finally, our model predicts the labels of the subject region, the object region and the predicate. + +Visual Embedder. Our visual embedder transforms visual and positional features $(\mathbf{x}_n^r$ and $\mathbf{x}_n^p)$ of region $r_n$ into an embedding $\mathbf{v}_n$ , where $n$ indexes all region features including $k$ (subject), $l$ (object) and $u$ (context). This is given by + +$$ +\mathbf {v} _ {n} = \mathrm {L N} \left(\mathrm {L N} \left(\mathbf {W} _ {r} \mathbf {x} _ {n} ^ {r}\right) + \mathrm {L N} \left(\mathbf {W} _ {p} \mathbf {x} _ {n} ^ {p}\right) + \mathbf {e} _ {n} ^ {t}\right), \tag {1} +$$ + +where $\mathbf{W}_r$ and $\mathbf{W}_p$ are trainable weights that project the features into the same dimension $d$ . $\mathbf{e}_n^t \in \mathbb{R}^d$ is the type embedding of a region (subject vs. object vs. context). LN denotes Layer Normalization [2]. + +Textual Embedder. Our textual embedder accepts two inputs: (1) the word embeddings $\mathbf{x}_k^o$ and $\mathbf{x}_l^o$ of region labels for subject and object region, respectively; and (2) the word embedding of a special word "MASK", denoted as $\mathbf{x}_p^o$ , representing the missing predicate. The embedder encodes the input word embedding and the positional embedding into a textual embedding $\mathbf{t}_m$ , given by + +$$ +\mathbf {t} _ {m} = \mathrm {L N} \left(\mathbf {W} _ {e} \mathbf {x} _ {m} ^ {o} + \mathbf {e} _ {m} ^ {p}\right), \tag {2} +$$ + +where $m$ indexes $k$ (subject), $p$ (predicate) or $l$ (object). $\mathbf{e}_m^p\in \mathbb{R}^d$ is the positional embedding [12] of the current token. $\mathbf{W}_e$ represents the trainable weights projecting the word embedding into the dimension of $d$ . + +Transformer Encoder. The visual and textual embeddings $(\mathbf{v}_n$ and $\mathbf{t}_m)$ are further fed into a multi-layer Transformer encoder [48]. This encoder uses multi-head self-attention, coupled with multilayer perceptron (MLP) and layer normalization, to output a contextualized embedding $(\hat{\mathbf{v}}_n\in \mathbb{R}^d$ or $\hat{\mathbf{t}}_m\in \mathbb{R}^d)$ for each input $\mathbf{v}_n$ or $\mathbf{t}_m$ . This Transformer encoder can be considered as conducting message passing across all input tokens. Among all the outputs, the embeddings corresponding to the subject, predicate, object tokens will be further used for triplet label prediction, as shown in Fig. 2. For a region pair $(r_k,r_l)$ , the embeddings $\hat{\mathbf{v}}_k / \hat{\mathbf{t}}_k$ correspond to the visual / textual feature of the subject region (i.e. the first input region), the predicate embedding $\hat{\mathbf{t}}_p$ is from the special word "MASK", and the embeddings $\hat{\mathbf{v}}_l$ + +/ $\hat{\mathbf{t}}_l$ represent the visual / textual feature of the object region (i.e. the second input region). + +Classification Heads. Our model further fuses the encoder outputs, and predicts labels of a SPO triplet (subject-predicate-object) for the input region pair $(r_k, r_l)$ . The feature fusion is given by + +$$ +\mathbf {s} = \hat {\mathbf {v}} _ {k} + \mathbf {W} _ {v} \mathbf {x} _ {k} ^ {o}, \quad \mathbf {o} = \hat {\mathbf {v}} _ {l} + \mathbf {W} _ {v} \mathbf {x} _ {l} ^ {o}, +$$ + +$$ +\mathbf {p} = \hat {\mathbf {t}} _ {p} + \mathbf {W} _ {t s} \hat {\mathbf {t}} _ {k} + \mathbf {W} _ {t o} \hat {\mathbf {t}} _ {l} + \mathbf {W} _ {v s} \hat {\mathbf {v}} _ {k} + \mathbf {W} _ {v o} \hat {\mathbf {v}} _ {l}, \tag {3} +$$ + +where $\mathbf{W}_v, \mathbf{W}_{ts}, \mathbf{W}_{to}, \mathbf{W}_{vs}, \mathbf{W}_{vo}$ are learnable weights. The outputs $\mathbf{s} \in \mathbb{R}^d$ , $\mathbf{o} \in \mathbb{R}^d$ , $\mathbf{p} \in \mathbb{R}^d$ are further used to classify subject, predicate, and object labels, respectively. This is done using a two-layer MLP followed by softmax. + +# 3.2. Learning from Language Supervision + +Our key innovation is the use of image captions as the only supervisory signal for training our model. This is done by constructing "pseudo" labels of triplets from image captions. Concretely, we first parse a caption into a set of SPO triplets. Each triplet is further matched to every pair of regions, by comparing subject and object tokens in the sentence triplet to the predicted categories of a region pair. Our model is then trained on the matched pairs of regions to predict their corresponding sentence triplets. We point out that our approach of learning from image-sentence pairs can be easily adapted by different SGG models. + +Closed-Set vs. Open-Set. In this paper, we primarily consider a closed-set setting — the vocabulary of the subject, predicate, and object during evaluation is known in prior. In this setting, our learning is focused on the concepts of interest and our model only considers sentence triplets within the vocabulary. Nonetheless, our method does support the open-set setting, where there are no limits on the vocabulary. In this case, our model learns from all frequently appearing subject, predicate, and object tokens in the captions. Additional matching step is needed at inference time to identify concepts in the target vocabulary. We will explore this setting in our experiment. + +Triplet Parsing and Filtering. We use an off-the-shelf rule-based language parser [20] based on Schuster et al. [38] to parse the triplets in the image captions. After parsing, the triplets with the lemmatized words for subject, predicate and object are obtained. We further perform an optional filtering step on the initial collection of triplets. For the closed-set setting, we only keep concepts that can be matched to the categories in the target vocabulary. Two concepts are matched if (1) there is overlapping between their synsets, lemmas or hybernyms in WordNet [32] (e.g. "tortoise" $\rightarrow$ "animal"), or (2) if their root forms can be matched (e.g. "baseball player" $\rightarrow$ "player"). + +Pseudo Label Assignment. With the filtered triplets, our next step is to match sentence triplets to pairs of regions provided by the object detector. This is done by a greedy matching between every triplet from the caption and each region pair from the image. Specifically, we match the corresponding subject and object tokens between a triplet and a region pair, again using a token's synsets, the synsets' lemmas and hybernyms in WordNet [32] and its root form. If multiple triplets are matched to the same region pair, we randomly select one of them. We also filter out region pairs that does not overlap and far away from each other, following [62], as these pairs are less likely to contain a relationship. Once matched, the triplet is considered as the pseudo label of the region pair for training our model. + +Model Training. Our model is trained by predicting the pseudo labels of the region pairs. We apply a multi-class cross-entropy loss for the subject, predicate, and object, respectively. Our final loss function is given by + +$$ +\mathcal {L} = \lambda_ {s} \mathcal {L} _ {s} + \lambda_ {p} \mathcal {L} _ {p} + \lambda_ {o} \mathcal {L} _ {o} \tag {4} +$$ + +where $\mathcal{L}_s, \mathcal{L}_p$ , and $\mathcal{L}_o$ is the loss for subject, predicate, and object respectively. And $\lambda_s, \lambda_p$ , and $\lambda_o$ are their corresponding loss weights. We set $\lambda_s = \lambda_o = 0.5$ and $\lambda_p = 1$ following previous work [62, 60]. + +Weighted Loss. One challenge for learning is the domain gap between (a) image-sentence pairs used for training and (b) images and their target scene graphs during inference. For example, the distributions of concepts might be quite different in image-sentence pairs vs. image scene graphs. In the closed-set setting, we might have an estimated frequency of the concepts on scene graphs. In this case, we apply a weighted loss during training, where the weight for each category is set to the ratio between the frequency of the token in image-sentence pairs and the estimated frequency of the matched tokens in scene graphs. If a category is not matched to any target category, no loss weight will be applied. This weighted loss function only requires an estimated frequency of concepts on the target dataset, and can be considered as a simple approach for domain adaption. + +Model Inference. Once trained, our model takes a region pair and its contextual features, and predicts a SPO triplet. + +To obtain a scene graph, we enumerate all possible region pairs and feed them into our model. The predicted probabilities are further averaged for each region and thus each region is predicted to single category. In the open-set setting, an additional matching step is needed to infer the probability of target categories based on the predicted categories from image-sentence pairs. In this case, we apply the same matching step in our label assignment step. + +Extension to Weakly and Fully Supervised Settings. Our model can be easily extended to weakly and fully supervised settings. In weakly supervised setting, we replace triplets parsed from captions with those from unlocalized scene graphs [60], and follow the same label assignment of our setting. For fully supervised setting, we simply replace our pseudo labels with ground-truth scene graph labels. + +# 4. Experiments and Results + +We now present our experiments and results. We start with our main results on learning SGG from image-sentence pairs, followed by our ablation studies. Further, we present results on fully supervised SGG, and explore open-set SGG. Datasets. To evaluate our model, we used the standard split [52] of Visual Genome (VG) [23] (150 objects, 50 predicates, $75\mathrm{K} / 32\mathrm{K}$ images for train/test). VG comes with human-annotated image captions and localized scene graphs, and is a widely used benchmark for SGG. We also considered image captions on VG for our ablation study, and localized scene graphs on VG for fully supervised SGG. + +For training, we considered image captions from VG, COCO Caption (COCO) [6], and Conceptual Caption (CC) [40]. COCO contains 123K images with each labeled by 5 human-annotated captions. We selected 106k images in COCO for training by filtering out images that exist in the test set of VG. CC contains 3.3M image-caption pairs automatically collected from alt-text enabled images on the web. For the closed-set setting where the target categories are known, we matched the parsed tokens from each dataset to target categories, and kept 148-52, 143-56, 148-64 object-predicate categories for VG, COCO and CC, respectively, leading to 673K/75K (triplets/images) on VG, 154K/64K on COCO, and 159K/145K on CC. + +Evaluation Protocol and Metrics. For the majority of our experiments, we evaluate Scene Graph Detection (SGDet) following the protocol from [52]. SGDet captures both the localization and classification performance using metrics of Recall@K (R@K) [29, 52] and mean Recall@K (mR@K) [5, 46]. R@K computes the recall between the top K predicted triplets and ground-truth ones. A predicted triplet is considered as correct only when all requirements are met: (1) the predicted triplet labels match one of the ground-truth triplet, (2) the detected subject-object regions match the ground-truth subject-object regions with an IoU $\geq 0.5$ , respectively. mR@K averages R@K across all predicate + +
MethodTraining SettingSGDet
SupervisionLevelSource#Triplets#ImagesR@50R@100
Ours+FullLocalized Scene GraphFullVisual Genome406K58K13.815.3
VSPNet [60]Unlocalized Scene GraphWeakVisual Genome406K58K4.75.4
VSPNet†6.77.4
Ours+Weak10.011.5
Ours+MotifNetImage DescriptionWeakerCC + COCO313K210K5.66.7
Ours5.97.0
+ +categories. We also included Scene Graph Classification (SGCls) and Predicate Classification (PredCls) in our experiment on fully SGG. Importantly, all experiments were conducted with graph constraint that limits each subject-object pair to have only one predicate prediction. + +Implementation Details. We used a Faster R-CNN [36] detector pre-trained on OpenImages [24], capable of detecting 601 object categories. We kept the top 36 objects per image and extracted the 1536-D region features from the detector. The object tags were represented by the 300-D GloVe embeddings [33]. We adopted the Transformer implementation from UNITER [9] with 2 self-attention layers, 12 attention heads in each layer and hidden size $d = 768$ . SGD optimizer was used in training with the image batch of 32, 16 sampled triplets per image, and the initial learning rate of 0.0032. We used the benchmark implementation provided by Tang et al. [45] for evaluation. + +# 4.1. Language Supervised Scene Graph Generation + +We now present our main results on learning to generate scene graphs from image-sentence pairs. + +Setup and Baselines. Our model is trained using only image-sentence pairs from CC and COCO datasets. We compare to the following baselines: + +- VSPNet [60] is designed for weakly supervised SGG and learns from unlocalized scene graph. As our close competitor, VSPNet takes the inputs of object proposals from the same OpenImage detector used by our model. +- VSPNet† further augments VSPNet with object box predictions from the detector. VSPNet† thus has the same input image regions as our model. +- Ours+Weak is our model trained using unlocalized scene graphs, same as the setting of VSPNet. +- Ours+MotifNet combines our pseudo label assignment with a supervised SGG model (MotifNet [62]). This model is thus trained using only image-sentence pairs. +- Ours+Full is our model trained with full supervision and using ground-truth scene graph labels. This should be considered as an upper bound of our model. + +Results. Table 2 presents our results. With image description (CC + COCO) as only supervision, our models (Ours/Ours+MotifNet) significantly outperform VSP-Net trained using unlocalized scene graphs (7.0/6.7 vs. + +Table 2. Results of language supervised SGG. Different from all previous approaches, our model can learn from image-sentence pairs for SGG. With only image-sentence pairs as the supervisory signal, our model outperforms VSPNet — a latest method of weakly supervised SGG trained using human-annotated, unlocalized scene graphs. + +
Source of Image DescriptionWeighted Loss#Triplets#ImagesSGDet
CCCOCOVGR@50R@100
✓159K145K3.44.1
✓154K64K3.84.5
✓✓159K145K5.36.4
✓✓✓313K210K5.97.0
✓-673K75K9.210.3
+ +Table 3. Ablation study on different sources of image descriptions and weight loss for training our model. + +5.4 R@100), despite that image-sentence pairs are much weaker supervisory signals. Our Transformer-based model also beats Ours+MotifNet, and performs on par with the improved version of VSPNet (VSPNet†) (7.0 vs. 7.4 R@100). When trained using unlocalized scene graphs, our model (Ours+Weak) again outperforms VSPNet variants by a large margin (11.5 vs. 5.4/7.4 R@100). These results provide convincing evidence that our model can learn from only image-sentence pairs to detect scene graph in an image with high quality. Finally, there is a noticeable gap between Ours and Ours+Weak (7.0 vs. 11.5 R@100), and between Ours+Weak and Ours+Full (11.5 vs. 15.3 R@100), suggesting ample room for future work. + +Fig. 3 further visualizes output scene graphs from our models, including Ours+Full (left), Ours+Weak (middle) and Ours (right) in Table 2. Our model trained by image-sentence pairs produces scene graphs with a comparable quality as those trained using strong supervision. + +# 4.2. Ablation Studies + +We now present ablation studies of our method. + +Sources of Image Descriptions. Table 3 presents results of our model trained using different sources of captions. Not surprisingly, the model trained on VG performs better (10.3 R@100) than the model trained on CC (4.1 R@100) or COCO (4.5 R@100), since the evaluation dataset is also VG. Interestingly, the model trained on CC performs on par with the model trained on COCO with similar number of triplets, despite that captions on COCO are manually annotated and has higher quality than those harvested from the Internet on CC. We thus conjecture that the performance of our model is minorly influenced by the caption quality. + +Effects of Weighted Loss. Table 3 also compares the use of different loss functions. Adding weighted loss improves the recall from $4.1\mathrm{R}@$ 100 to $6.4\mathrm{R}@$ 100 when using CC as the training data. This result indicates that using weighted + +![](images/2e9e3024f14e942338422dc95117cef3d79af81b1eae3fdc86372aa99a42d5ec.jpg) + +![](images/8698c2238f290ac1e93ef2f62fa30873133002d17873268e94257d26e99c529a.jpg) + +![](images/34edac319c1c251fd234a84bdcd551d753d7a49164418ce4ea06a82b197250cc.jpg) + +![](images/7b65006fbfd7ae52edc11a60fedbfa65069cc161a90e35e9e49a2540e921b359.jpg) +(a). Trained by Localized Scene Graphs + +![](images/631c415bb951b9a89fe481be69761a2965a33f18f4145fc1d6d4ad900422a009.jpg) + +![](images/a21696f3a1f084b5fb7834e73655d659c42ce8e48ca057ab3f9af54cfc748caa.jpg) + +![](images/e0bcf80cc39e918fa8b616e8e561abfd885d4e4a2a8ac7631abc945739ace1c7.jpg) + +![](images/9d0c3cc421160475e99287c140df5a25c4beaf36493af62313c516ed0244fd79.jpg) + +![](images/6299061d3a426c76c05a9694b880aefa9da3a6a6d0814cc30f806f2cd0daf16b.jpg) + +![](images/9464908c42bd7d6ffa35139ab261678d6672be04160079decd07fecf200317f0.jpg) + +![](images/677f5e3340c2ca40e5be1486614db2a69ce35a8a51ec9e26771be6b52df777f5.jpg) + +![](images/5af4e188008e79bf96750ab8fd39e5f60a8a534c8c8d534d8f471db9780bb06e.jpg) +(b). Trained by Unlocalized Scene Graphs +Figure 3. Qualitative results of our models on VG test set for SGG. All models take the same detected regions and predict the scene graph labels. In each row, we show 3 identical images and the corresponding scene graphs generated from the models trained by different levels of supervision. The visualized relationships are picked from the top 30 predicted triplets. + +![](images/dd38a8e80761bf37f4543d0166e1a1baea3c9a2f28825b977d6caae198de42a7.jpg) + +![](images/5e2ab865caa4ed9655735e0470bdece12a9b387c2b42cf36f6d71a37a4d93b9a.jpg) + +![](images/3f41d305c0469a5dcdaf66d42c4bd5dd67367d8dc84960c2e8aee901ca509433.jpg) + +![](images/4a9be7754a1a8aa76405f124b01c67d662de02490cfa455f2e6e5d7e8f1c61cc.jpg) + +Alized Scene Graphs + +![](images/c01479675d80e7e7f374155eeb474264ac843348e592a6e6f1da3ed4b038b11b.jpg) + +![](images/346f85dfd5be9bf9f61c9e14268b0611c44ab4027c64ef4bf7f51fbc4c393380.jpg) + +![](images/d04d0e911bd930d8e2da1ddca8dd584a8a135eefa3bb131cea4e2c6ee8493521.jpg) + +![](images/986bf3675c79c910c13d49f40097bce807f17d08136972838730f5d2dc372f1e.jpg) +(c). Trained by Image Descriptions + +![](images/02caadf775813cf26e273a8b915fc99f0c3ec7006d1f1638efe617bfa4d52d6d.jpg) + +![](images/f38634c34c096484729a4d52c504e0d29bae0f8c3da6748f2fbe7b224edff166.jpg) + +![](images/7cb728d0f73c1363011ce681750c37247d7e325de77bce53bb956757a123d534.jpg) + +![](images/807efe3a861c2be2cc3bb0006fedac5bb5228b799df665aa6beaa8c5c97900a9.jpg) + +
ModelObject DetectorLable AssignmentSGDet
R@50R@100
VSPNet [60]OpenImagesIterative Alignment4.75.4
VSPNet†OpenImagesIterative Alignment6.77.4
MotifNetOpenImagesDetection Tags (Ours)9.310.7
OursOpenImagesDetection Tags (Ours)10.011.5
OursObjects365Detection Tags (Ours)6.16.4
+ +loss can effectively close the domain gap between datasets. For example, the predicate "wear" appears frequently in VG yet occurs rarely in CC and COCO. With weighted loss, the recall of "wear" is improved by 22.1 R@100. + +Effects of Label Assignment. We evaluate our label assignment scheme in Table 4. Specifically, we consider the weakly supervised setting of learning from unlocalized scene graphs, apply our method to MotifNet [62], and present the results in 3rd row. With our scheme, MotifNet beats the latest VSPNet (10.7 vs. 7.4 R@100), suggesting the effectiveness of our label assignment scheme. + +Effects of Object Detector. We additionally consider another object detector trained on Object365 dataset [39]. In Table 4, our model with the Objects365 detector has lower recall (6.4 R@100) than our model with the OpenImages detector (11.5 R@100). Upon a close inspection, we conclude that the recall drop is mainly caused by the mismatch between the object categories of the detector and those in VG. Particularly, we find only 94 (out of 150) VG objects can be matched to Objects365 categories while 123 VG objects can be matched to OpenImages categories. For example, "shirt" and "building" are most frequent objects in VG. Objects365 detector cannot detect them while OpenImages + +Table 4. Ablation study on object detectors and label assignment schemes. Results are reported using unlocalized scene graphs as supervision. Our proposed label assignment scheme provides consistent performance boost across methods, while the choice of object detectors has a major impact on the performance. + +
Model InputsObject Detection +mAPSGDet
Text InputVisual InputR@50R@100
✓✓10.710.011.5
✓10.63.94.7
✓6.96.27.7
+ +Table 5. Ablation study on different model inputs. Results are reported using unlocalized scene graphs as supervision. Visual and textual features complement to each other for SGG. + +detector can. As a result, the triplets involving these objects will not be used to train the model, and the trained model fails to detect these concepts. + +Textual vs. Visual Inputs. Finally, We study the contribution of model inputs. This is done by probing our trained model during inference and masking out one input at a time. For textual input, we substitute subject and object embeddings for a random vector. For visual input, we replace the original region features with the averaged region features in the current image. The results are presented in Table 5. Using only visual input leads to a minor drop in detection mAP (10.6 vs. 10.7) and a large drop in scene graph recall (4.7 vs. 11.5 R@100), indicating a major performance drop in predicate prediction. In contrast, using only text input has a large drop mAP (6.9 vs. 10.7) and a moderate drop in scene graph recall (7.7 vs. 11.5 R@100). These results suggest that visual and textual inputs compliment to each other — predicate prediction primarily relies on textual inputs while object prediction mainly depends on visual inputs. + +# 4.3. Fully-supervised Scene Graph Generation + +We further evaluate our model for fully supervised SGG. Setup and Baselines. To demonstrate the strength of our Transformer-based model, we present results on fully supervised SGG and compare to several latest methods [52, 63, 46, 62], following the standard protocol of training and + +
ModelRecallMean Recall
SGDetSGClsPredClsSGDetSGClsPredCls
@20@50@100@20@50@100@20@50@100@20@50@100@20@50@100@20@50@100
IMP [52]18.125.931.234.037.538.554.361.163.12.84.25.35.26.26.58.911.011.8
VTransE [63]23.029.734.335.438.639.459.065.767.63.75.06.06.78.28.711.614.715.8
VCTree [46]24.731.536.237.040.541.459.866.268.14.25.76.96.27.57.911.714.916.1
MotifNet [62]25.132.136.935.839.139.959.566.067.94.15.56.86.58.08.511.514.615.8
Ours24.631.836.336.540.040.858.765.667.45.37.38.78.310.411.113.317.719.5
+ +testing on VG. Note that all models used the same object detector trained on VG and the same benchmark implementation provided by Tang et al. [45]. + +Results. We report recall and mean recall for SGDet, SGCls, and PredCls in Table 6. The recalls of our model compare favorably to previous best results (SGDet: 36.3 vs. 36.9 R@100, SGCls: 40.8 vs. 41.4 R@100, PredCls: 67.4 vs. 68.1). More importantly, the mean recalls of our model are significantly higher than previous models across all evaluation protocols (SGDet: 8.7 vs. 6.9 R@100, SGCls: 11.1 vs. 8.7 R@100, PredCls: 19.5 vs. 16.1). Compared to recall, mean recall [5, 46] better characterizes the performance on categories with fewer samples. These results suggest that our model is better at capturing those tail categories. + +# 4.4. Open-set Scene Graph Generation + +Moving forward, we consider a challenging open-set setting for SGG, where the categories of target concepts (objects and predicates) are unknown during training. We believe this is the first result for open-set SGG. + +Setup. In this experiment, our model is trained on COCO Caption and evaluated on VG. During training, we parsed concept categories from captions, remove the low-frequency categories, and formed a vocabulary of 4273 objects and 677 predicates. This vocabulary was then used to train our model. At inference time, we first generated scene graphs using our vocabulary, and then matched the detected categories in our vocabulary to target concepts on VG (150 objects and 50 predicates) for evaluation. + +Results. Table 7 compares the results of our models trained in closed-set and open-set settings using the same COCO caption dataset. The model trained in open-set setting has slightly better recall (4.8 vs. $4.5\mathrm{R}@\mathbf{100}$ ). Our open-set results are also comparable to VSPNet (supervised by unlocalized scene graphs on VG in a closed-set setting). We hypothesis that the open-set setting allows the model to learn from more concepts and thus benefits SGG. To verify this hypothesis, we plot the output scene graph from our models trained on closed-set and open-set settings in Fig. 4. Compared to our closed-set model, our open-set model detects more concepts outside VG (e.g. "swing", "mouse", "keyboard"). Our results suggest an exciting avenue of large-scale training of open-set SGG using image captioning dataset such as CC. + +Table 6. Results of fully supervised SGG. All models use the same object detector pre-trained on the VG dataset, and the same codebase provided by Tang et al. [45] for evaluation. Results of previous models come from Tang et al. [45]. + +
Model#Objects#Predicates#Triplets#ImagesSGDet
R@50R@100
Ours14356154K64K3.84.5
Ours4273677758K105K4.14.8
+ +Table 7. Results of open-set SGG. Evaluation is performed on VG with the vocabulary and model learned from COCO. + +![](images/1876c148cfe34c8401870507cd2e8283ebe6e361487caf408435d7094e2b2a32.jpg) +Figure 4. Qualitative results of our models (trained in open-set and closed-set settings) on VG test set for SGG. + +# 5. Conclusion + +We proposed one of the first methods of learning to generate scene graphs from image-sentence pairs. Our key idea is to use off-the-shelf object detectors, so as to match detected object tags to parsed tokens from captions, thus creating "pseudo" labels for training. Further, we designed a Transformer-based model and demonstrated strong results across different levels of supervision. Our model learned from only image-sentence pairs, outperformed a state-of-the-art weakly supervised model trained by human-annotated unlocalized scene graphs. More importantly, we presented the first result for open-set scene graph generation. We hope our work points to exciting avenues of learning structured visual representation from natural language. + +Limitation and Future Work. A main limitation of our method is the dependency on an object detector covering many concepts. We anticipate that our method will benefit from the development of open-vocabulary detectors [58, 61]. A future direction is to address the ambiguity in learning from image-sentence pairs when multiple object instances of the same category presents in an image. We also plan to explore using scene graphs learned from image-sentence pairs for vision and language tasks (e.g. VQA). + +Acknowledgement: YZ and YL acknowledge the support provided by the UW-Madison OVCRGE with funding from WARF. JS and CX were supported by the National Science Foundation (NSF) under Grant RI:1813709. The article solely reflects the opinions and conclusions of its authors but not the funding agency. + +# References + +[1] Iro Armeni, Zhi-Yang He, JunYoung Gwak, Amir R Zamir, Martin Fischer, Jitendra Malik, and Silvio Savarese. 3D scene graph: A structure for unified semantics, 3d space, and camera. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 5664-5673, 2019. 1 +[2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 4 +[3] Federico Baldassarre, Kevin Smith, Josephine Sullivan, and Hossein Azizpour. Explanation-based weakly-supervised learning of visual relations with graph networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 612-630. Springer, 2020. 2 +[4] Long Chen, Hanwang Zhang, Jun Xiao, Xiangnan He, Shiliang Pu, and Shih-Fu Chang. Counterfactual critic multi-agent training for scene graph generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 4613-4623, 2019. 1, 2 +[5] Tianshui Chen, Weihao Yu, Riquan Chen, and Liang Lin. Knowledge-embedded routing network for scene graph generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6163–6171, 2019. 5, 8 +[6] Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dolkar, and C Lawrence Zitnick. Microsoft COCO captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015. 2, 5 +[7] Xinlei Chen and Abhinav Gupta. Webly supervised learning of convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1431-1439, 2015. 1, 2 +[8] Xinlei Chen, Abhinav Shrivastava, and Abhinav Gupta. NEIL: Extracting visual knowledge from web data. In Proceedings of the IEEE international conference on computer vision (ICCV), pages 1409-1416, 2013. 1, 2 +[9] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In Proceedings of the European Conference on Computer Vision (ECCV), pages 104-120. Springer, 2020. 2, 3, 6 +[10] Bo Dai, Yuqi Zhang, and Dahua Lin. Detecting visual relationships with deep relational networks. In Proceedings of the IEEE conference on computer vision + +and Pattern recognition (CVPR), pages 3076-3086, 2017. 2 +[11] Karan Desai and Justin Johnson. VirTex: Learning visual representations from textual annotations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 1, 2 +[12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. 4 +[13] Helisa Dhamo, Azade Farshad, Iro Laina, Nassir Navab, Gregory D. Hager, Federico Tombari, and Christian Rupprecht. Semantic image manipulation using scene graphs. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1 +[14] Santosh K. Divvala, Ali Farhadi, and Carlos Guestrin. Learning everything about anything: Webly-supervised visual concept learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3270-3277, 2014. 1, 2 +[15] Ali Farhadi, Ian Endres, Derek Hoiem, and David Forsyth. Describing objects by their attributes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1778-1785. IEEE, 2009. 2 +[16] Tanmay Gupta, Arash Vahdat, Gal Chechik, Xiaodong Yang, Jan Kautz, and Derek Hoiem. Contrastive learning for weakly supervised phrase grounding. In Proceedings of the European Conference on Computer Vision (ECCV), 2019. 1 +[17] Drew Hudson and Christopher D Manning. Learning by abstraction: The neural state machine. In Advances in Neural Information Processing Systems (NeurIPS), volume 32. Curran Associates, Inc., 2019. 1 +[18] Achiya Jerbi, Roei Herzig, Jonathan Berant, Gal Chechik, and Amir Globerson. Learning object detection from captions via textual scene attributes. arXiv preprint arXiv:2009.14558, 2020. 2 +[19] Jingwei Ji, Ranjay Krishna, Li Fei-Fei, and Juan Carlos Niebles. Action Genome: Actions as compositions of spatio-temporal scene graphs. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10236–10247, 2020. 1 + +[20] Mao Jiayuan and Kasai Seito. Scene graph parser. https://github.com/vacancy/SceneGraphParser, 2018. 5 +[21] Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[22] Armand Joulin, Laurens Van Der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In Proceedings of the European Conference on Computer Vision (ECCV), pages 67-84. Springer, 2016. 1, 2 +[23] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual Genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision (IJCV), 123(1):32-73, 2017. 2, 5 +[24] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4. International Journal of Computer Vision (IJCV), pages 1-26, 2020. 6 +[25] Christoph H Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 951-958. IEEE, 2009. 2 +[26] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 121-137. Springer, 2020. 2, 3 +[27] Yikang Li, Wanli Ouyang, Bolei Zhou, Jianping Shi, Chao Zhang, and Xiaogang Wang. Factorizable net: an efficient subgraph-based framework for scene graph generation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 335-351, 2018. 1, 2 +[28] Yikang Li, Wanli Ouyang, Bolei Zhou, Kun Wang, and Xiaogang Wang. Scene graph generation from objects, phrases and region captions. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1261-1270, 2017. 1, 2 +[29] Cewu Lu, Ranjay Krishna, Michael Bernstein, and Li Fei-Fei. Visual relationship detection with language priors. In Proceedings of the European conference on computer vision (ECCV), pages 852–869. Springer, 2016. 2, 5 + +[30] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems (NeurIPS), pages 13–23, 2019. 2, 3 +[31] Jiasen Lu, Vedanuj Goswami, Marcus Rohrbach, Devi Parikh, and Stefan Lee. 12-in-1: Multi-task vision and language representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 3 +[32] George A Miller. WordNet: a lexical database for english. Communications of the ACM, 38(11):39-41, 1995. 5 +[33] Jeffrey Pennington, Richard Socher, and Christopher D Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, 2014. 6 +[34] Julia Peyre, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Weakly-supervised learning of visual relations. In Proceedings of the IEEE international conference on computer vision (ICCV), pages 5179-5188, 2017. 2 +[35] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning (ICML), 2021. 1, 2 +[36] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems (NeurIPS), volume 28. Curran Associates, Inc., 2015. 2, 6 +[37] Mert Bulent Sariyildiz, Julien Perez, and Diane Larlus. Learning visual representations with caption annotations. In Proceedings of the European Conference on Computer Vision (ECCV), 2020. 1, 2 +[38] Sebastian Schuster, Ranjay Krishna, Angel Chang, Li Fei-Fei, and Christopher D. Manning. Generating semantically precise scene graphs from textual descriptions for improved image retrieval. In Proceedings of the Fourth Workshop on Vision and Language, pages 70–80, Lisbon, Portugal, Sept. 2015. Association for Computational Linguistics (ACL). 5 +[39] Shuai Shao, Zeming Li, Tianyuan Zhang, Chao Peng, Gang Yu, Xiangyu Zhang, Jing Li, and Jian Sun. Objects365: A large-scale, high-quality dataset for object + +detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 7 +[40] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL), pages 2556-2565, 2018. 1, 2, 5 +[41] Jiaxin Shi, Hanwang Zhang, and Juanzi Li. Explainable and explicit visual reasoning over scene graphs. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8376-8384, 2019. 1 +[42] Jing Shi, Yiwu Zhong, Ning Xu, Yin Li, and Chen-liang Xu. A simple baseline for weakly-supervised scene graph generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2021. 2, 3 +[43] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. VL-BERT: Pre-training of generic visual-linguistic representations. In International Conference on Learning Representations (ICLR), 2020. 2, 3 +[44] Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019. 2, 3 +[45] Kaihua Tang, Yulei Niu, Jianqiang Huang, Jiaxin Shi, and Hanwang Zhang. Unbiased scene graph generation from biased training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3716-3725, 2020. 1, 2, 6, 8 +[46] Kaihua Tang, Hanwang Zhang, Baoyuan Wu, Wenhan Luo, and Wei Liu. Learning to compose dynamic tree structures for visual contexts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6619-6628, 2019. 1, 2, 3, 5, 7, 8 +[47] Damien Teney, Lingqiao Liu, and Anton van Den Hengel. Graph-structured representations for visual question answering. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (CVPR), pages 1–9, 2017. 1 +[48] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017. 4 + +[49] Johanna Wald, Helisa Dhamo, Nassir Navab, and Federico Tombari. Learning 3D semantic scene graphs from 3d indoor reconstructions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1 +[50] Josiah Wang, Katja Markert, and Mark Everingham. Learning models for object recognition from natural language descriptions. In The British Machine Vision Conference (BMVC), volume 1, page 2, 2009. 1, 2 +[51] Wenbin Wang, Ruiping Wang, Shiguang Shan, and Xilin Chen. Sketching image gist: Human-mimetic hierarchical scene graph generation. In European conference on computer vision (ECCV). Springer, 2020. 2 +[52] Danfei Xu, Yuke Zhu, Christopher B Choy, and Li Fei-Fei. Scene graph generation by iterative message passing. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pages 5410–5419, 2017. 1, 2, 3, 5, 7, 8 +[53] Jianwei Yang, Jiasen Lu, Stefan Lee, Dhruv Batra, and Devi Parikh. Graph R-CNN for scene graph generation. In Proceedings of the European conference on computer vision (ECCV), pages 670-685, 2018. 1, 2 +[54] Jianwei Yang, Jiasen Lu, Stefan Lee, Dhruv Batra, and Devi Parikh. Visual curiosity: Learning to ask questions to learn visual recognition. In Conference on Robot Learning (CoRL), 2018. 1, 2 +[55] Xu Yang, Kaihua Tang, Hanwang Zhang, and Jianfei Cai. Auto-encoding scene graphs for image captioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10685–10694, 2019. 1 +[56] Ting Yao, Yingwei Pan, Yehao Li, and Tao Mei. Exploring visual relationship for image captioning. In Proceedings of the European conference on computer vision (ECCV), pages 684-699, 2018. 1 +[57] Keren Ye and Adriana Kovashka. Linguistic structures as weak supervision for visual scene graph generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8289-8299, 2021. 3 +[58] Keren Ye, Mingda Zhang, Adriana Kovashka, Wei Li, Danfeng Qin, and Jesse Berent. Cap2Det: Learning to amplify weak caption supervision for object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 9686-9695, 2019. 1, 2, 8 +[59] Ruichi Yu, Ang Li, Vlad I Morariu, and Larry S Davis. Visual relationship detection with internal and external linguistic knowledge distillation. In Proceedings of the IEEE international conference on computer vision (ICCV), pages 1974-1982, 2017. 2 + +[60] Alireza Zareian, Svebor Karaman, and Shih-Fu Chang. Weakly supervised visual semantic parsing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3736-3745, 2020. 1, 2, 3, 5, 6, 7 +[61] Alireza Zareian, Kevin Dela Rosa, Derek Hao Hu, and Shih-Fu Chang. Open-vocabulary object detection using captions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 1, 2, 8 +[62] Rowan Zellers, Mark Yatskar, Sam Thomson, and Yejin Choi. Neural motifs: Scene graph parsing with global context. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5831-5840, 2018. 1, 2, 3, 5, 6, 7, 8 +[63] Hanwang Zhang, Zawlin Kyaw, Shih-Fu Chang, and Tat-Seng Chua. Visual translation embedding network for visual relation detection. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pages 5532-5540, 2017. 2, 3, 7, 8 +[64] Hanwang Zhang, Zawlin Kyaw, Jinyang Yu, and Shih-Fu Chang. PPR-FCN: Weakly supervised visual relation detection via parallel pairwise R-FCN. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 4233–4241, 2017. 2 +[65] Ji Zhang, Kevin J Shih, Ahmed Elgammal, Andrew Tao, and Bryan Catanzaro. Graphical contrastive losses for scene graph parsing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 11535–11543, 2019. 1, 2 +[66] Yiwu Zhong, Liwei Wang, Jianshu Chen, Dong Yu, and Yin Li. Comprehensive image captioning via scene graph decomposition. In European Conference on Computer Vision (ECCV), pages 211-229. Springer, 2020. 1 +[67] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason Corso, and Jianfeng Gao. Unified vision-language pre-training for image captioning and vqa. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), volume 34, pages 13041-13049, 2020. 2, 3 \ No newline at end of file diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/images.zip b/learningtogeneratescenegraphfromnaturallanguagesupervision/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ac1feb4d7e80b2ba569050bee099f9fc24d273ae --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7a7c886819f3065411e116f3c0d5d0c79eb57896690e5a6fb8db4c1a19ad2c8 +size 489909 diff --git a/learningtogeneratescenegraphfromnaturallanguagesupervision/layout.json b/learningtogeneratescenegraphfromnaturallanguagesupervision/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9528f0de61a858b8445c7b1de81733788f02ec85 --- /dev/null +++ b/learningtogeneratescenegraphfromnaturallanguagesupervision/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd42b79f536eb37ad64213bc6a45535dc655077e4ff0a6ccfde8d88002dc75d3 +size 487776 diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_content_list.json b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..86bcc855c2dbebe219b3751ebe62102af501d6e5 --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:976b217080b8e084d41cd8efec4a06d65eff6cfeeb6cc1a0685a43d4bda67c3a +size 88509 diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_model.json b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c75c91b34e05624af0e0490fc098e8a4d5a4daac --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c12c68becce2c20f81d0af9e17ceb9d0654b7f2165b3f461edc56fdec3592956 +size 115862 diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_origin.pdf b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a91b6062f8a3baf9cfb5b794ea6065b98404b580 --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/05053a5c-0d91-4530-b07d-d5c171ed2822_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00c167347cd2e0f2fc1e73af59ea82dc12c91b6f181973ed1c42f055cfc78051 +size 6788543 diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/full.md b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7c8c8ecd6016c8db52896d843ddcd020be339824 --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/full.md @@ -0,0 +1,306 @@ +# Learning to Hallucinate Examples from Extrinsic and Intrinsic Supervision + +Liangke Gui $^{1*}$ Adrien Bardes $^{2*†}$ Ruslan Salakhutdinov $^{1}$ Alexander Hauptmann $^{1}$ Martial Hebert $^{1}$ Yu-Xiong Wang $^{3}$ CMU $^{2}$ Facebook AI Research, Inria $^{3}$ UIUC + +{liangkeg, rsalakhu, alex, hebert}@cs.cmu.edu adrien.bardes@inria.fr yxw@illinois.edu + +# Abstract + +Learning to hallucinate additional examples has recently been shown as a promising direction to address few-shot learning tasks. This work investigates two important yet overlooked natural supervision signals for guiding the hallucination process - (i) extrinsic: classifiers trained on hallucinated examples should be close to strong classifiers that would be learned from a large amount of real examples; and (ii) intrinsic: clusters of hallucinated and real examples belonging to the same class should be pulled together, while simultaneously pushing apart clusters of hallucinated and real examples from different classes. We achieve (i) by introducing an additional mentor model on data-abundant base classes for directing the hallucinator, and achieve (ii) by performing contrastive learning between hallucinated and real examples. As a general, model-agnostic framework, our dual mentor- and self-directed (DMAS) hallucinator significantly improves few-shot learning performance on widely-used benchmarks in various scenarios. + +# 1. Introduction + +To alleviate the reliance on large, labeled datasets for learning deep models, few-shot learning has attracted increasing attention, with the goal of learning novel concepts from one, or only a few, annotated examples [20, 68, 71, 59, 21]. Existing work tries to solve this problem from the perspective of meta-learning [55, 7, 64], which is motivated by the human ability to leverage prior experiences when tackling a new task. Unlike the standard machine learning paradigm, where a model is trained on a set of examples, meta-learning is performed on a set of "simulated" tasks, each consisting of its own support and query sets [68]. The support set is used as the few-shot training data for the leaner, and the query set is used as the test data to evaluate the leaner's quality. By sampling small support and query sets from a large col + +![](images/0097b692c10ec5aaeceac506dbe3a477707773f96e2eed6cf6675dc3e180d0c9.jpg) +(a) + +![](images/5a203608ff6672e8df5b4beed94b289f1f43446dbc6f5a4cfa52b41c689bfb52.jpg) +(b) +Figure 1: Learning a hallucinator to generate useful examples for few-shot learning through extrinsic and intrinsic supervision. During meta-training, we sample a few-shot task (e.g., 2-way 2-shot classification) on base classes (Fig. 1a). Extrinsic supervision: The desired classifier for this task is the (dashed) one that would be learned from a large set of real examples (Fig. 1b). We explicitly introduce this strong classifier as "mentor" (abundant examples are available for base classes). We then learn the hallucinator in a way that minimizes the discrepancy between the (solid) "student" classifier (trained on hallucinated examples together with the few real examples) and the (dashed) mentor classifier (Fig. 1c). Intrinsic supervision: Through contrastive learning, clusters of hallucinated and real examples belonging to the same class are pulled together $(\rightarrow \leftarrow)$ , while simultaneously pushing apart $(\leftrightarrow)$ clusters of hallucinated and real examples from different classes (Fig. 1c). During meta-testing, we use the meta-trained, fixed hallucinator to generate additional examples as augmentation for learning classifiers on novel classes. Real examples as light diamonds, hallucinated examples as dark triangles, and classifiers as solid or dashed lines. + +![](images/27eba741a8cb841e3426c54200bc32844e3ffe92efd439632b22f22d5fff0581.jpg) +(c) + +lection of labeled examples of base classes, meta-learning based approaches learn to extract task-agnostic knowledge, and apply it to a new few-shot learning task of novel classes. + +One notable type of task-agnostic (or meta) knowledge comes from the shared mechanism of data augmentation or hallucination across categories [70, 22, 56, 84]. Since synthesizing raw images is often challenging or sometimes unnecessary, recent work has instead focused on hallucinating examples in a learned feature space [70, 22, 56, 84, 76, 83, 87]. This can be achieved by, for example, integrating a "hallucinator" module into a meta-learning framework, where it generates hallucinated examples guided by real ones from the support set [70]. The hallucinator captures the intra-class variation shared across categories, which generalizes to unseen classes. The learner then uses an augmented training set, which includes both the real and the hallucinated examples to + +learn classifiers. The hallucinator is meta-trained end-to-end with the learner, through back-propagating a classification loss based on ground-truth labels of query data. + +Despite the success of prior approaches, we argue that solely using the classification loss on the small query set as supervision is insufficient to adjust the hallucinator to produce effective samples in the few-shot regime. Therefore, the performance of the classifiers trained on hallucinated examples is still substantially inferior to that of the classifiers trained on real examples [16, 58]. To overcome this challenge, our key insight is that there are two important yet under-explored natural signals for guiding the data generation process – extrinsic and intrinsic supervision. This work explores how to leverage such supervision to enable hallucinating examples in a way that helps the classification algorithm learn better classifiers. + +The first source of supervision is an extrinsic signal from large-sample learning. As illustrated in Figure 1, to be most helpful as a hallucinator, a classifier trained on the hallucinated examples (which are generated from a small support set of real samples) is expected to be close to a strong classifier that would be trained on a large amount of real examples. This extrinsic signal from large-sample learning is a natural source of supervision for few-shot learning, but it has been largely overlooked in prior work. While we have very little data on novel classes, we do have a large number of real examples on base classes. Therefore, on base classes we introduce a "mentor" model, which is a strong classifier pre-trained on all the available large amount of real examples. Correspondingly, the classifier trained on hallucinated examples along with few real support examples becomes the "student." + +We now minimize the discrepancy between the student and mentor classifiers. A straightforward approach would be minimizing the distance between the two classifiers in the parameter space [71, 72, 11], which tends to be difficult and noisy due to the lack of suitable metrics. Hence, we instead encourage the output predictions from the student classifier (e.g., the distribution of class probabilities) to be similar to those predicted by the mentor on the query set. This way of learning is reminiscent of knowledge distillation [29]. By doing so, the hallucinator explicitly learns how to produce examples that enable the student classifier to mimic the behavior of the mentor. Note that the student-mentor pairs are only used for meta-training on base classes; there are no mentor classifiers for meta-testing on novel classes. + +In practice, the student and mentor classifiers could be quite different from each other at the beginning of the training, if the mentor is produced by a large amount of real examples while the student has access to only few real examples. To address this issue, we propose a progressive guidance scheme inspired by curriculum learning [8], and explore two dual directions - (1) we start with a mentor and + +a student, both trained on a small number of real examples, and we gradually strengthen the mentor by re-training it with increasing number of real examples; and (2) we start with a mentor and a student, both trained on a large number of real examples, and we gradually weaken the student by removing its real examples. During both of the processes, the hallucinator is also trained progressively. + +The second source of supervision is the intrinsic label consistency between hallucinated and real examples. As illustrated in Figure 1, hallucinated and real examples belonging to the same class should be pulled together, while simultaneously pushing apart clusters of hallucinated and real examples from different classes. However, without appropriate constraints, the hallucinated examples might be noisy and spread over across class boundaries (e.g., a hallucinated dog example resides within the cat cluster). To this end, we formulate the problem as supervised contrastive learning, inspired by recent progress on self-supervised learning [74, 28, 12, 30]. We treat hallucinated and real examples as different views of the data, and generate the positive and negative pairs correspondingly. For example, the positives are drawn from both hallucinated and real samples of the same class. Note that different from conventional contrastive learning that learns an embedding space (where the data augmentation is pre-defined), we use the contrastive loss to self-direct the hallucinated examples in the right class cluster or manifold (where is the feature space is pre-trained). + +Our contributions are three-fold. (1) By jointly leveraging the complementary extrinsic and intrinsic supervision, we develop a general meta-learning with hallucination framework. (2) We not only extract shared knowledge across a collection of few-shot learning tasks, similar to most existing meta-learning methods, but also progressively exploit extrinsic knowledge in large-sample models trained on base classes as mentor to guide hallucination and few-shot learning. (3) Through a contrastive learning process, the hallucinated examples are self-directed to maintain the intrinsic label consistency with real examples. Our dual mentor- and self-directed (DMAS) hallucinator is model-agnostic, which can generate data in different feature spaces and can be combined with different classification models to consistently boost their few-shot learning performance on a variety of benchmarks, including ImageNet1K [27, 70], miniImageNet [68, 49], tieredImageNet [51], and CUB [69]. + +# 2. Related Work + +Generative Models. Generative models have recently shown great potential as a way of data augmentation for few-shot learning [5, 70, 84, 22] and semi-supervised learning [16], but the improvement of recognition performance is still limited [58]. The generation can be performed either in image space [15] or in a pre-trained feature space [27], by using an auto-encoder architecture [56], GAN + +like generator [70], or the combination of GANs and autoencoders [75, 76]. Our work is independent of these different types of generators, and we focus primarily on how to train the generator to improve its use for recognition tasks by leveraging large amounts of auxiliary data and self-supervision. + +Few-Shot Learning and Meta-Learning. Meta-learning, or the ability to learn to learn [64], is a powerful framework for tackling the problem of learning with limited data. Most of modern approaches fall into one of the categories between optimization and metric learning based methods. Optimization based methods learn how to do fast adaptation to novel tasks, by learning appropriate parameter updates [49] or a general initialization [21]. Adaptation could be done in the original feature space [21, 4, 6] or in an embedded space [52]. Prior work on few-shot domain adaptation [53, 31] learns how to balance cross-domain clustering that is domain invariant. Metric learning methods focus on learning a similarity metric [33]. Several distance functions have been explored, from the Euclidean distance [59, 2] and the cosine distance [13, 23, 19] to more complex parametric functions and metrics [68, 62, 37, 82], or using an additional task-specific metric [46]. Most methods often treat each category separately without considering the relations between them. Graph neural networks are thus introduced to leverage those relations [54, 32, 24]. To conduct meta-learning more effectively, recent approaches often first compute a set of features of the images using a trained feature extractor network. Given that high-dimensional features have better modeling capacity but are computationally expensive to work with, each meta-learning task is then formulated as a convex optimization problem and solved in its low-dimensional dual space [9, 34]. Our hallucinator component is generic and can be integrated into different meta-learning methods. + +Teacher-Student Networks. Learning a model under the guidance of a teacher or mentor model has been widely used for model compression. Compressing one cumbersome or several models into a smaller model is a classic idea [18, 10] and has been popularized by the distillation formulation in [29]. Recent work focuses on advanced techniques to guide the distillation process [42, 78, 1] and its applications to practical problems, such as object detection [77, 73] and distributed machine learning [3]. In addition, knowledge distillation has been extended to address other tasks, including multi-task learning [63] and continual learning [38, 57]. To the best of our knowledge, our work is the first to introduce a mentor network for learning recognition task oriented generative models. Importantly, different from existing work that addresses models of different capacity, we consider models of the same capacity but trained on real or synthetic data. + +Contrastive Learning. Powerful self-supervised representation learning approaches have recently been developed in image domain via manually specified pretext tasks. Examples include auto-encoding methods which leverage con + +texts [47], channels [86], and colors [85] to recover the input under some corruption. Some pretext tasks form pseudo-labels by relative patch locations [17], image rotations [25], and jigsaw puzzles [44]. These pretext tasks are collected under the umbrella of the contrastive learning framework, which maintains the relative consistency between the representations of an image and its augmented views [45, 74, 80, 28, 12, 65, 26, 14, 81]. In our work, we treat hallucinated and real examples as different views of the data and use the contrastive loss to self-direct the hallucinated examples in the right class cluster or manifold. + +# 3. Dual Mentor- and Self-Directed Hallucinator + +Few-Shot Learning Setting. We are given a set of base categories $\mathcal{C}_{\mathrm{base}}$ and a set of novel categories $\mathcal{C}_{\mathrm{novel}}$ , where $\mathcal{C}_{\mathrm{base}} \cap \mathcal{C}_{\mathrm{novel}} = \emptyset$ . We have a base dataset $\mathcal{D}_{\mathrm{base}}$ with a large amount of annotated training examples per class and a novel dataset $\mathcal{D}_{\mathrm{novel}}$ with only few annotated training examples per class. Few-shot learning aims to learn a good classification model $h$ for $\mathcal{C}_{\mathrm{novel}}$ based on the small dataset $\mathcal{D}_{\mathrm{novel}}$ . Recent work achieves this through a meta-learning procedure [68], which learns from a collection of sampled few-shot classification tasks on $\mathcal{C}_{\mathrm{base}}$ . Given a set of categories $\mathcal{C}$ and a set of data $\mathcal{D}$ , an $m$ -way $k$ -shot task is composed of a subset $\mathcal{C}_{\mathrm{sub}}$ of $m$ categories from $\mathcal{C}$ , a support (training) set $S_{\mathrm{supp}}$ of $k$ examples from $\mathcal{D}$ for each class in $\mathcal{C}_{\mathrm{sub}}$ , and a query (test) set $S_{\mathrm{query}}$ of one or few examples from $\mathcal{D}$ for each class in $\mathcal{C}_{\mathrm{sub}}$ . Meta-learning is performed in two phases as follows. + +During meta-training, a classifier learns from a collection of $m$ -way $k$ -shot tasks sampled from $\mathcal{C}_{\mathrm{base}}$ and $\mathcal{D}_{\mathrm{base}}$ . While our work is agnostic to different classification models, here we take a simple cosine classifier [13] as an example - a variant of prototypical networks [59] which uses the cosine instead of the standard Euclidean distance function. In each iteration, we compute a prototype representation for each class in $\mathcal{C}_{\mathrm{sub}}$ . Each example is fed to an embedding function $f_{\theta}$ with learnable parameters $\theta$ . The prototype of class $c$ is the mean of the outputs through $f_{\theta}$ of examples from $c$ in $S_{\mathrm{supp}}$ . We then feed the examples in $S_{\mathrm{query}}$ to the classifier and update the parameters $\theta$ . During meta-testing, we use the same approach and build our previously meta-learned classifier with one unique $m$ -way $k$ -shot task, using $\mathcal{C}_{\mathrm{novel}}$ instead of $\mathcal{C}_{\mathrm{base}}$ and $\mathcal{D}_{\mathrm{novel}}$ instead of $\mathcal{D}_{\mathrm{base}}$ . We evaluate the final classifier on unseen examples with labels from $\mathcal{C}_{\mathrm{novel}}$ . + +Meta-Learning with Hallucination. Incorporating a generative model which produces additional examples for data augmentation has been shown to facilitate meta-learning [70, 22, 56]. While our approach does not rely on specific types of generative models, here we focus on the feature hallucinator in [70], due to its simplicity and state-of-the-art performance, which is implemented as a light-weight multi-layer perceptron (MLP) module. The hallucinator is a + +![](images/2f97de79d34baa8877a7ea7eb43dc8724bb7b403e4b6201fa36fef912374559d.jpg) +(a) Meta-training on base classes +Figure 2: Overview of our dual mentor- and self-directed hallucinator "DMAS," learned through extrinsic and intrinsic supervision. During each iteration of meta-training, a small support set $S_{\mathrm{supp}}$ is augmented with a set of examples $S_{\mathrm{supp}}^{G}$ produced by a hallucinator $G$ . Examples from the resulting set $S_{\mathrm{supp}}^{\mathrm{aug}}$ are used to build a student classifier model $S$ . A mentor model $M$ is built from a set $S_{\mathrm{large}}$ containing a large amount of real examples on base classes. The hallucinator $G$ is trained by jointly leveraging the extrinsic supervision from $\mathcal{L}_{\mathrm{ex}}$ and the intrinsic supervision from $\mathcal{L}_{\mathrm{in}}$ . That is, $\mathcal{L}_{\mathrm{ex}}$ enforces the student classifier to mimic the distribution of class probabilities predicted by the mentor model on the query set $S_{\mathrm{query}}$ ; meanwhile, $\mathcal{L}_{\mathrm{in}}$ enforces the intrinsic label consistency between hallucinated and real examples from $S_{\mathrm{supp}}^{\mathrm{aug}}$ through contrastive learning. During meta-testing, we use the meta-trained, fixed $G$ to generate additional examples as augmentation for learning classifiers $h$ on novel classes; there are no mentor classifiers. Real examples as diamonds, hallucinated examples as triangles. + +![](images/170b94d78757b5abeb75bd06a7a56186b49005defed8d585f4536435e9b00dc1.jpg) +(b) Meta-testing on novel classes + +function $G(x,z;w): \mathcal{R}^{d + d_{\mathrm{noise}}} \to \mathcal{R}^d$ that produces examples in a pre-trained feature space of dimension $d$ , where $x$ is the feature vector of a real example, $z$ is a random noise vector of dimension $d_{\mathrm{noise}}$ sampled from a Gaussian distribution, and $w$ is the parameters of $G$ . The hallucinated example $G(x,z;w)$ is of the same category as $x$ . + +Now the procedure of meta-learning integrated with the hallucinator $G$ is illustrated in Figure 2. During each iteration of meta-training, the support set $S_{\mathrm{supp}}$ is first augmented by a generated set $S_{\mathrm{supp}}^{G}$ . Specifically, for each class $y$ , we sample $k_{\mathrm{train}}^{\mathrm{gen}}$ examples $(x,y)$ in $S_{\mathrm{supp}}$ , sample associated random noise vectors $z$ , and then add $(x',y)$ to $S_{\mathrm{supp}}^{G}$ , where $x' = G(x,z;w)$ . Our final support training set is $S_{\mathrm{supp}}^{\mathrm{aug}} = S_{\mathrm{supp}} \cup S_{\mathrm{supp}}^{G}$ . As long as $G$ is differentiable with respect to the generated set $S_{\mathrm{supp}}^{G}$ , the gradients of the final classification loss on $S_{\mathrm{query}}$ can be back-propagated into $G$ to produce useful hallucinated examples. Through metatraining over a large amount of iterations, the hallucinator learns to capture shared modes of variation across different classes and can thus generalize to unseen classes. During meta-testing, we use the learned $G$ to generate additional examples for recognizing categories in $C_{\mathrm{novel}}$ . + +Hallucination with Extrinsic Guidance from Mentor. The end-to-end optimization of the classification loss enables the hallucinator to produce useful examples in the few-shot regime. However, since the classification loss is computed on small query sets, such supervision solely is insufficient to adjust the hallucinator to produce discriminative examples that most contribute to formulating classifier decision boundaries. Hence, the resulting classifier trained on the hallucinated examples could be still far away from the desired classifier that would be learned from a large set of real + +examples. This makes it critical to close the gap between these two classifiers. In fact, during meta-training, a large amount of annotated examples are already available for the base categories $\mathcal{C}_{\mathrm{base}}$ , which allows us to explicitly obtain the classifier trained on a large set of examples and use it to guide the learning of the hallucinator. + +Formally, we treat the classifier trained on the augmented set of the hallucinated examples and the few support examples as a student model, and we treat the classifier trained on a large set of real base examples as a mentor model. Our goal then is to learn the hallucinator by minimizing the discrepancy between the student classifier and its mentor model. While a naive approach would be to directly characterize the difference between their model parameters, it turns out to be challenging due to the high dimensionality of the parameter space. Inspired by the teacher-student network [29], we instead enforce the student to mimic the distribution of class probabilities predicted by the mentor network, which can be viewed as a way of regularization to improve the generalization performance of the student model [43]. + +As shown in Figure 2, meta-training the hallucinator $G$ is conducted in the following way. We first sample a large set of examples $S_{\text{large}}$ with $k_{\text{large}}$ examples per class in $C_{\text{base}}$ and train a mentor classifier using all the examples in $S_{\text{large}}$ . During each iteration of meta-training, we augment $S_{\text{supp}}$ by generating new examples using the hallucinator $G$ . We train the student classifier on $S_{\text{supp}}^{\text{aug}}$ through the knowledge distillation loss function in [29]: + +$$ +\mathcal {L} _ {\mathrm {e x}} (s, m, y) = \mathcal {L} _ {\mathrm {C E}} (\sigma (s), e _ {y}) + \alpha \tau_ {1} ^ {2} \mathcal {L} _ {\mathrm {C E}} (\sigma (\frac {s}{\tau_ {1}}), \sigma (\frac {m}{\tau_ {1}})), \tag {1} +$$ + +which consists of a standard cross-entropy loss (the first term) and an additional component that measures the difference between student and mentor outputs (the second + +term). $s$ and $m$ are the logits produced by the student and the mentor, respectively, for a test example of label $y$ in $S_{\mathrm{query}}$ . $\sigma$ denotes the softmax function, $\mathcal{L}_{\mathrm{CE}}$ denotes the cross-entropy loss, $e_y$ is the one-hot encoding of $y$ , and $\alpha$ is a trade-off hyper-parameter that balances the two terms. Note that $\tau_1 > 0$ is a critical learnable parameter called temperature, which smoothes the probability distribution produced by the mentor and makes the corresponding decision boundary easier to learn for the student than the original one. + +Self-Directed Learning with Intrinsic Label Consistency. While the hallucinated examples directed by the extrinsic mentor are useful, without other constraints they might spread over across class boundaries and thus be noisy. Inspired by supervised contrastive learning [30], we enforce intrinsic label consistency between hallucinated examples and real examples. + +Formally, suppose we sample $N$ real examples per minibatch and generate $M$ hallucinated examples, resulting in a batch $\mathcal{I}$ of $M + N$ examples. Given an anchor example $x_{i}$ , $P(i)$ is the set of indices of all positives in the batch distinct from $i$ and $A(i) \equiv I \setminus \{i\}$ . The supervised contrastive loss is defined as $\mathcal{L}_{\mathrm{in}} = \frac{1}{M + N} \sum_{i=1}^{M + N} \mathcal{L}_i$ and + +$$ +\mathcal {L} _ {i} = - \frac {1}{| P (i) |} \sum_ {p \in P (i)} \log \frac {\exp \left(x _ {i} \cdot x _ {p} / \tau_ {2}\right)}{\sum_ {a \in A (i)} \exp \left(x _ {i} \cdot x _ {a} / \tau_ {2}\right)}, \tag {2} +$$ + +where $\tau_{2} > 0$ is a temperature parameter and $|P(i)|$ is its cardinality. This loss allows the real and hallucinated examples from the same classes to attract mutually, while they repel the other examples from different classes in the mini-batch. + +Thus, our dual mentor- and self-directed hallucinator can be derived from Eqn. 1 and Eqn. 2 as + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {e x}} + \beta \mathcal {L} _ {\mathrm {i n}}, \tag {3} +$$ + +where $\beta$ is a trade-off hyper-parameter that balances the two terms. Minimizing Eqn. 3 over $S_{\mathrm{query}}$ thus guides the hallucinator towards producing useful examples that help the student classifier recover the decision boundary from the mentor model. + +# 4. Progressive Guidance from Mentor Model + +Under the framework of meta-learning with extrinsic guidance, a straightforward way is to build the mentor model by using $k_{\text{large}}$ as large as possible (potentially the full set of $\mathcal{D}_{\text{base}}$ ) and keep it fixed, and to train the hallucinator and student classifier using only few real examples. By doing so, however, we face the problem that the decision boundaries obtained by those two models could be very far from each other at the beginning of the training, making the learning of the hallucinator difficult. To address this issue, we perform the learning process in a progressive manner with varied number of real examples. We start with a mentor and a student which have access to a not too different number of real examples, and then progressively change the number of examples, so that the decision boundaries transform in + +![](images/72c5768f37f81a718f407d23e4ac87b128392c405a2c3a29464f59682fcfea14.jpg) +Figure 3: Illustration of progressive guidance by weakening the student classifier in the case of recognizing two classes. We start with a large number of real examples for both the student and the mentor, and learn the corresponding mentor model (the leftmost image). We then gradually remove the real examples for the student over the training. The hallucinator learns to generate additional examples based on the remaining real examples to preserve the mentor decision boundary (the middle two and rightmost images). + +a smooth manner. Concretely, this can be achieved in the following two dual directions. + +Progressive Guidance by Strengthening the Mentor. In this setting, both the student and the mentor start with a small number of real examples. However, the number of real examples for the mentor gradually increases over the training. The objective for the hallucinator then is to learn to generate additional examples so that its corresponding student can always match the performance of the mentor, whenever the mentor is re-trained with more samples and becomes stronger. More specifically, during meta-training, the support set $S_{\mathrm{supp}}$ of each few-shot task is composed of very few examples per class, $k_{\mathrm{train}}$ , as in regular meta-training. At the beginning, we sample $S_{\mathrm{large}}$ , with $k_{\mathrm{large}}$ being set to the value of $k_{\mathrm{train}}$ . We then progressively sample new real examples in the same amount for each class and add them into $S_{\mathrm{large}}$ . $k_{\mathrm{large}}$ grows from $k_{\mathrm{train}}$ to $k_{\mathrm{max}}$ in a linear or logarithmic scale, where $k_{\mathrm{max}}$ is the maximum available number of examples per class in $D_{\mathrm{base}}$ . We re-train the mentor model every time we add new examples. + +Progressive Guidance by Weakening the Student. In this setting, both the student and the mentor start with a large number of real examples. However, we gradually remove the real examples for the student over the training. The objective for the hallucinator then is to learn to generate the missing examples based on the remaining real examples. This allows the student to preserve or stabilize the original decision boundary formulated by the large set of examples (i.e., the mentor boundary), when the student has access to less real examples and becomes weaker. More specifically, during meta-training, the support set $S_{\mathrm{supp}}$ of each "few-shot" task is composed of a large number of examples per class, unlike regular meta-training. This number of examples per class in $S_{\mathrm{supp}}$ , $k_{\mathrm{train}}$ , decreases in a linear or logarithmic scale, until it reaches a small value. + +# 5. Evaluation + +We now present experiments to evaluate our dual mentor- and self-directed (DMAS) hallucinator on few-shot classification, and study the effect of progressive guidance from extrinsic and intrinsic supervision. Since DMAS is agnos + +
MethodBackboneminiImageNettieredImageNet
k=15k=15
Cosine Classifier [13]ResNet1255.43 ± 0.8177.18 ± 0.6161.49 ± 0.9182.37 ± 0.67
TADAM [46]ResNet1258.50 ± 0.3076.70 ± 0.30--
ECM [50]ResNet1259.00 ± -77.46 ± -63.99 ± -81.97 ± -
TPN [40]ResNet1259.46 ± -75.65 ± -59.91 ± 0.9473.30 ± 0.75
PPA [48]WRN-28-1059.60 ± 0.4173.74 ± 0.19--
ProtoNet [59]ResNet1260.37 ± 0.8378.02 ± 0.5765.65 ± 0.9283.40 ± 0.65
wDAE-GNN [24]WRN-28-1061.07 ± 0.1576.75 ± 0.1168.18 ± 0.1683.09 ± 0.12
MTL [61]ResNet1261.20 ± 1.8075.50 ± 0.80--
LEO [52]WRN-28-1061.76 ± 0.0877.59 ± 0.1266.33 ± 0.0581.44 ± 0.09
DC [39]ResNet1262.53 ± 0.1979.77 ± 0.19--
MetaOptNet [34]ResNet1262.64 ± 0.8278.63 ± 0.4665.99 ± 0.7281.56 ± 0.53
FEAT [79]ResNet2462.96 ± 0.2078.49 ± 0.15--
MatchingNet [68]ResNet1263.08 ± 0.8075.99 ± 0.6068.50 ± 0.9280.60 ± 0.71
CTM [35]ResNet1864.12 ± 0.8280.51 ± 0.1368.41 ± 0.3984.28 ± 1.73
RFS [66]ResNet1264.82 ± 0.6082.14 ± 0.4371.52 ± 0.6986.03 ± 0.49
DeepEMD [82]ResNet1265.91 ± 0.8282.41 ± 0.5671.16 ± 0.8786.03 ± 0.58
DMAS (Ours)ResNet1267.42 ± 0.2883.74 ± 0.2073.54 ± 0.7386.27 ± 0.47
+ +(a) Test accuracy $(\%)$ on the novel classes for miniImageNet and tieredImageNet. $\pm$ indicates $95\%$ confidence intervals over tasks. + +
MethodBackbonek=15
ProtoNet [59]ResNet1266.09 ± 0.9282.50 ± 0.58
RelationNet [13, 62]ResNet3466.20 ± 0.9982.30 ± 0.58
DEML [88]ResNet5066.95 ± 1.0677.11 ± 0.78
MAML [13]ResNet3467.28 ± 1.0883.47 ± 0.59
Cosine Classifier [13]ResNet1267.30 ± 0.8684.75 ± 0.60
MatchingNet [68]ResNet1271.87 ± 0.8585.08 ± 0.57
DeepEMD [82]ResNet1275.65 ± 0.8388.69 ± 0.50
DMAS (Ours)ResNet1278.47 ± 0.6290.67 ± 0.39
+ +(b) Test accuracy $(\%)$ on the novel classes for CUB. $\pm$ indicates $95\%$ confidence intervals over tasks. + +
MethodBackbonek=12510
ProtoNet [59]ResNet1039.354.466.371.2
ProtoNet Gen [70]ResNet1045.055.967.373.0
MatchingNet [68]ResNet1043.654.066.072.5
Logistic regression [27]ResNet1038.451.164.871.6
Logistic regression Analogies [27]ResNet1040.750.862.069.3
Prototype Matching Net Gen [70]ResNet1045.857.869.074.3
Cosine Att. Weight [23]ResNet1046.057.569.174.8
DMAS (Ours)ResNet1046.558.369.775.1
+ +(c) Top-5 accuracy $(\%)$ for 311-way novel-class classification on ImageNet1K. The $95\%$ confidence intervals for all number are of the order of $0.2\%$ . + +Table 1: Comparisons with state of the art on four widely-benchmarked few-shot classification datasets. With simple cosine classifiers, our DMAS significantly and consistently outperforms all the baselines (including sophisticated classification models) across the board. + +tic to the choice of classification models, we validate its generalizability to different types of features and various meta-learning models. In particular, we focus on simple cosine classifiers, which have been recently shown to achieve very competitive few-shot performance [13]. + +Datasets. We evaluate on four widely-used datasets: (1) miniImageNet [68, 49], with 64, 16, and 20 classes for meta-training, meta-validation, and meta-testing, respectively; (2) tieredImageNet [51], with 20, 6, and 8 super-classes for meta-training, meta-validation, and meta-testing, respectively; (3) ImageNet1K [27, 70], with 193 base and 300 novel classes for cross-validation and 196 base and 311 novel classes for evaluation; (4) Caltech-UCSD Birds-200-2011 (CUB) [69, 79], with 100, 50, and 50 classes for meta-training, meta-validation, and meta-testing, respectively. + +Implementation Details. For a fair comparison with previous work, we employ ResNet10 as our model backbone for ImageNet1K [70] and ResNet12 as our model backbone for the other three datasets [82]. As is commonly implemented in the state-of-the-art work, we follow the feature pre-training step [82]. We first train a convolutional network based feature extractor on the base classes. Then we extract and save these features to disk, and use these pre-computed features as inputs for meta-learning. We follow the feature hallucinator architecture in [70] and use a three layer MLP with ReLU as the activation. The embedding function $f_{\theta}$ of our cosine classifier is a two layer MLP. + +During progressive guidance by weakening the student, we start training the mentor with $k_{\mathrm{large}} = 256$ , and we decrease the number to 1 in a logarithmic scale over 12,000 iterations. We initialize the learnable parameters including the temperature $\tau_{1}$ to 7, the scale factor of the cosine distance + +to 75, and the temperature $\tau_{2}$ to 0.07. As the performance is not sensitive to trade-off hyper-parameters $\alpha$ and $\beta$ , we empirically set them to 5 and 1, respectively. The number of hallucinated examples is a hype-parameter ranging from $2 - 10$ . The saturation point of hallucinated examples on improving performance is typically 6. For ImageNet1K, we follow the settings in [70] and average over 5 pre-determined $k$ -shot (i.e., $k = 1, 2, 5, 10$ ) tasks. We report the mean top-5 accuracy and the $95\%$ confidence intervals for all number are of the order of $0.2\%$ . For the other datasets, we average over 1,000 randomly sampled tasks and report the accuracies and the $95\%$ confidence intervals. + +Comparisons with State of the Art. We compare our model with the state-of-the-art methods. We report 5-way 1-shot and 5-way 5-shot performance on three benchmarks: miniImageNet, tieredImageNet, and CUB, and 311-way $k$ -shot on ImageNet1K. The results are summarized in Table 1. Under the same backbones, our model consistently achieves the best performance on all the datasets and across different sample-size regimes, even outperforming sophisticated methods, such as the attention based classifier 'Cosine Att. Weight' [23] and DeepEMD [82]. In particular, our 1-shot model outperforms state-of-the-art methods by significant margins, e.g., $1.5\%$ on miniImageNet, $2\%$ on tieredImageNet, and $2.8\%$ on CUB. + +Ablation Analysis. To unpack the performance gain and understand the impact of different components, we perform a series of ablations on the challenging ImageNet1K dataset. Tables 2 summarizes the top-5 accuracies and the $95\%$ confidence intervals for all number are of the order of $0.2\%$ . + +Robust to different types of pre-trained features and classifiers. Table 2 shows that DMAS can effectively hallucinate + +
MethodFeaturek=12510
ProtoNet [59] (baseline)Standard39.354.466.371.2
ProtoNet w/ aug (baseline)Standard40.255.066.771.6
ProtoNet Gen [70] (baseline)Standard45.055.967.373.0
ProtoNet DMAS w/ exStandard45.155.567.373.3
ProtoNet DMAS (full)Standard45.956.568.273.9
Cosine Classifier (baseline)Standard37.851.065.572.5
Cosine Classifier Gen (baseline)Standard42.653.966.472.6
Cosine Classifier DMAS w/ inStandard43.454.767.173.5
Cosine Classifier DMAS w/ exStandard44.556.268.674.2
Cosine Classifier DMAS w/ ex↑Standard44.356.368.874.2
Cosine Classifier DMAS w/ ex↓Standard45.456.768.874.8
Cosine Classifier DMAS (full)Standard46.558.369.775.1
Cosine Classifier (baseline)Cosine45.857.068.974.3
Cosine Classifier Gen (baseline)Cosine47.057.869.174.3
Cosine Classifier DMAS w/ exCosine47.258.269.274.4
Cosine Classifier DMAS (full)Cosine47.959.370.175.5
+ +Table 2: Ablation studies (top-5 accuracy) on ImageNet1K 311-way classification: (1) different pre-trained feature spaces for hallucination – 'standard' (the feature backbone is a ResNet10 pre-trained using a standard cross-entropy linear classifier on base classes) vs. 'cosine' (the ResNet10 feature backbone is pre-trained using a cosine classifier); (2) different types of classifiers – prototypical net vs. cosine classifier; (3) impact of different sources of supervision and progressive training. w/aug: with standard data augmentation. Gen: with a plain hallucinator [70] trained using the classification loss on the query set solely. DMAS w/ex: DMAS trained only under the guidance of the mentor without progressive training. DMAS w/ex↑: progressive guidance through strengthening the mentor. DMAS w/ex↓: progressive guidance through weakening the student. DMAS w/in: DMAS trained only in a self-directed way through contrastive learning. DMAS (full): trained under both (progressively) extrinsic and intrinsic supervision. + +
Methodk=15
ProtoNet [59]50.01 ± 0.8272.02 ± 0.67
MatchingNet [68]51.65 ± 0.8469.14 ± 0.72
Cosine Classifier [13]44.17 ± 0.7869.01 ± 0.74
Linear Classifier [13]50.37 ± 0.7973.30 ± 0.69
KNN [36]50.84 ± 0.8171.25 ± 0.69
DeepEMD [82]54.24 ± 0.8678.86 ± 0.65
DMAS (Ours)63.72 ± 0.2981.24 ± 0.20
+ +Table 3: Cross-domain evaluation (miniImageNet $\rightarrow$ CUB). Our model outperforms other baseline methods by large margins, showing the generalization of our learned hallucinator. + +data in different types of pre-trained feature spaces and can work with different types of classifiers. Notably, DMAS achieves the best performance in a homogeneous setting, where the feature is pre-trained by using a cosine classifier and the final classification model is also a cosine classifier. + +Extrinsic guidance from mentor. From Table 2, we can observe that DMAS significantly outperforms baselines by benefiting from the extrinsic guidance of the mentor. There are $5.8\%$ improvement when combining with the prototypical network and $6.7\%$ improvement when combining with the cosine classifier. More importantly, DMAS outperforms the plain hallucinator [70] which is trained using the classification loss only. Note that both the baselines and DMAS use the same amount of data for meta-training on base classes. + +Intrinsic supervision. Table 2 also shows that DMAS trained only with the intrinsic supervision already outper + +
MethodBackbonek=15
MetaOptNet [34]ResNet1262.64 ± 0.6178.63 ± 0.46
MetaOptNet + Gen [70]ResNet1263.46 ± 0.4380.02 ± 0.28
MetaOptNet + DMAS (Ours)ResNet1264.55 ± 0.6480.42 ± 0.46
S2M2 [41]WRN-28-1063.90 ± 0.1881.03 ± 0.11
S2M2 + Gen [70]WRN-28-1063.37 ± 0.5681.23 ± 0.19
S2M2 + DMAS (Ours)WRN-28-1065.35 ± 0.6383.55 ± 0.41
DeepEMD [82]ResNet1265.91 ± 0.8282.41 ± 0.56
DeepEMD + Gen [70]ResNet1264.73 ± 0.3079.92 ± 0.21
DeepEMD + DMAS (Ours)ResNet1267.42 ± 0.2883.74 ± 0.20
+ +Table 4: Ablation study on the generalizability of our approach and additional comparisons with state of the art on miniImageNet. Our DMAS hallucinator is general and can work with different types of classification models and different backbone models to consistently improve their performance. In addition, DMAS consistently outperforms the plain hallucinator [70]. + +forms the baselines. The improvement is more pronounced when there are very few examples, e.g., $5.6\%$ improvement when $k = 1$ . This implies the importance of preserving the label consistency between hallucinated and real examples. In addition, the full DMAS model achieves the best performance, demonstrating that the extrinsic supervision and the intrinsic supervision are complementary to each other. + +Strengthening the mentor vs. weakening the student. We compare two directions for progressive guidance by strengthening the mentor $(w / ex\uparrow)$ and weakening the student $(w/ ex\downarrow)$ . We use a logarithmic scale when changing the number of examples on which the student or mentor model is trained [60, 72]. As shown in Table 2, both directions outperform the normal guidance without progression $(w / ex)$ , and weakening the student achieves better results. It comes from the fact that, if both mentor and student start being weak, the learning problem could actually be hard due to the high variance of both mentor and student. + +Comparisons with standard data augmentation. Table 2 shows that our learned data hallucination outperforms meta-learning with standard hand-crafted data augmentation ('w/ aug'), which includes random crop, random horizontal flip, and color jittering as in [13], indicating the importance of exploiting shared intra-class variation. + +Cross-Domain Evaluation. So far, we have focused on the within-domain scenario. Now we consider the cross-domain scenario, which allows us to investigate the generalization of our DMAS hallucinator and understand the effects of domain shifts. Following the cross-domain setup in [13, 82], the experiment in Table 3 shows that our DMAS hallucinator trained on miniImageNet is effective for never-before-seen classes on CUB without any fine-tuning. + +DMAS as a General Plug-and-Play Module. Table 4 further shows the generalizability of our approach – the DMAS hallucinator can work with different types of classification models and different backbone models to consistently improve their performance. To fully investigate the impact of DMAS and for a fair comparison, we conduct experiments on miniImageNet with the same training setups (e.g., backbones, data augmentation techniques, and training + +![](images/56858111845b99a0f2e97c24451b9d216d2e65d22eabe94670664f2054260309.jpg) +Figure 4: Visualization with t-SNE of the evolution of the decision boundary for two novel classes, when meta-training our DMAS hallucinator through progressive guidance by weakening the student. Real examples (small dots) are progressively removed, and hallucinated examples (triangles) are generated in a way that helps maintain the student decision boundary (black solid line) as close as possible to the desired decision boundary that would be formulated by a large set of real examples (red dashed line). We observe that PCA visualization has a similar phenomenon. Best viewed in color with zoom. + +![](images/faff57cebcb059a223424fe82f7800a18ba28f86fa9792f0e4bcc76f3aea8ca0.jpg) +Figure 5: Visualization of nearest neighbor real images of hallucinated examples for four novel classes. For each class, the single black framed image comes from the original dataset and is used as a seed for generating new examples. Color framed images correspond to the nearest neighbor real images of the hallucinated examples in the feature space. Best viewed in color with zoom. + +![](images/fb9d07e89a5af89dc918fa7e32ffc42cdd5691b56a61df74e675e58068b5f618.jpg) +Figure 6: Visualization of classification results of two novel classes (Top row: malamute; bottom row: mixing bowl) and comparison between our DMAS hallucinator and the plain hallucinator [70]. The left block shows images correctly classified by both approaches. The middle block shows images that are misclassified by [70] as other classes (with predicted class names overlaid on the images), but correctly classified by our approach. The right block shows images from other classes that are misclassified by [70] as the target class, but correctly classified by our approach. In these examples, our classifier is able to recognize objects with different poses and view points, whereas [70] fails to distinguish between similar classes. + +strategies) as the state-of-the-art approaches [34, 41, 82]. In all cases, DMAS can be seamlessly incorporated into these approaches (denoted as $+$ ), and substantially improve their performance, e.g., $1.9\%$ improvement when combining with MetaOptNet [34] and $1.5\%$ improvement when combining with S2M2 [41] under the challenging 1-shot setting. + +Comparisons with the plain hallucinator. Table 4 also shows that DMAS consistently outperforms the plain hallucinator [70] for different types of models (Table 2 has already shown this for ProtoNet and cosine classifier). More importantly, 'DeepEMD + [70]' is worse than the plain DeepEMD; a similar phenomenon is observed with S2M2 in the 1-shot case. These results suggest that, while DMAS is general, [70] is not a general module for different few-shot models. For more sophisticated models (S2M2 and DeepEMD), solely using the classification loss as in [70] is insufficient to adjust the hallucinator to produce effective samples. This further verifies the importance of extrinsic and intrinsic supervision. + +Visualizations. To further understand how our model helps learning a classifier and refining the hallucinator, we conduct visualizations on ImageNet1K. We first visualize in Figure 4 the evolution of the decision boundary for two + +novel classes during progressive guidance by weakening the student using t-SNE [67]. We then visualize in Figure 5 the hallucinated examples in the pixel space, using their nearest neighbor real images in the feature space. Finally in Figure 6, we compare our approach with the state-of-the-art meta-learned hallucinator [70] and show that ours is able to recognize a large range of visual variations. + +# 6. Conclusion + +We present an approach to few-shot classification that uses a dual mentor- and self-directed hallucinator to generate additional examples. This is achieved by exploiting two important natural supervision signals that facilitate data hallucination in a way that most improves the classification performance, and is trained end-to-end through meta-learning. Our hallucinator can be inserted as a plug-and-play module into different classification models. The extensive experiments demonstrate our state-of-the-art performance on the widely-benchmarked few-shot datasets in various scenarios. + +Acknowledgement: This work was supported in part by ONR MURI N000014-16-1-2007, AFRL Grant FA23861714660, and NSF Grant 2106825. We also thank AWS Cloud Credits for Research program. + +# References + +[1] Angeline Aguinaldo, Ping-Yeh Chiang, Alex Gain, Ameya Patil, Kolten Pearson, and Soheil Feizi. Compressing GANs using knowledge distillation. arXiv preprint arXiv:1902.00159, 2019. 3 +[2] Kelsey R Allen, Evan Shelhamer, Hanul Shin, and Joshua B Tenenbaum. Infinite mixture prototypes for few-shot learning. In ICML, 2019. 3 +[3] Rohan Anil, Gabriel Pereyra, Alexandre Passos, Róbert Ormandi, George E. Dahl, and Geoffrey E. Hinton. Large scale distributed neural network training through online distillation. In ICLR, 2018. 3 +[4] Antreas Antoniou, Harrison Edwards, and Amos Storkey. How to train your MAML. In ICLR, 2019. 3 +[5] Anthreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. In ICLR, 2017. 2 +[6] Antreas Antoniou and Amos J. Storkey. Learning to learn via self-critique. In NeurIPS, 2019. 3 +[7] Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. Université de Montréal, Département d'informatique et de recherche opérationnelle, 1990. 1 +[8] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, 2009. 2 +[9] Luca Bertinetto, João F. Henriques, Philip H. S. Torr, and Andrea Vedaldi. Meta-learning with differentiable closed-form solvers. In ICLR, 2018. 3 +[10] Cristian Bucilua, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDD, 2006. 3 +[11] Wei-Lun Chao, Han-Jia Ye, De-Chuan Zhan, Mark Campbell, and Kilian Q Weinberger. Revisiting meta-learning as supervised learning. arXiv preprint arXiv:2002.00573, 2020. 2 +[12] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 2, 3 +[13] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. In ICLR, 2019. 3, 6, 7 +[14] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2021. 3 +[15] Zitian Chen, Yanwei Fu, Yu-Xiong Wang, Lin Ma, Wei Liu, and Martial Hebert. Image deformation meta-networks for one-shot learning. In CVPR, 2019. 2 +[16] Zihang Dai, Zhilin Yang, Fan Yang, William W Cohen, and Ruslan Salakhutdinov. Good semi-supervised learning that requires a bad GAN. In NeurIPS, 2017. 2 +[17] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In ICCV, 2015. 3 +[18] Pedro Domingos. Knowledge acquisition from examples via multiple models. In ICML, 1997. 3 +[19] Nikita Dvornik, Cordelia Schmid, and Julien Mairal. Diversity with cooperation: Ensemble methods for few-shot classification. In ICCV, 2019. 3 +[20] Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. TPAMI, 28(4):594-611, 2006. 1 +[21] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model + +agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017. 1, 3 +[22] Hang Gao, Zheng Shou, Alireza, Zareian, Hanwang Zhang, and Shih-Fu Chang. Low-shot learning via covariance-preserving adversarial augmentation networks. In NeurIPS, 2018. 1, 2, 3 +[23] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018. 3, 6 +[24] Spyros Gidaris and Nikos Komodakis. Generating classification weights with GNN denoising autoencoders for few-shot learning. In CVPR, 2019. 3, 6 +[25] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR, 2018. 3 +[26] Jean-Bastien Grill, Florian Strub, Florent Altché, Coretin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to self-supervised learning. In NeurIPS, 2020. 3 +[27] Bharath Hariharan and Ross B. Girshick. Low-shot visual object recognition by shrinking and hallucinating features. In ICCV, 2017. 2, 6 +[28] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 2, 3 +[29] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 2, 3, 4 +[30] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In NeurIPS, 2020. 2, 5 +[31] Donghyun Kim, Kuniaki Saito, Tae-Hyun Oh, Bryan A Plummer, Stan Sclaroff, and Kate Saenko. CDSP: Cross-domain self-supervised pre-training. In ICCV, 2021. 3 +[32] Jongmin Kim, Taesup Kim, Sungwoong Kim, and Chang D. Yoo. Edge-labeling graph neural network for few-shot learning. In CVPR, 2019. 3 +[33] Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML, 2015. 3 +[34] Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In CVPR, 2019. 3, 6, 7, 8 +[35] Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang. Finding task-relevant features for few-shot learning by category traversal. In CVPR, 2019. 6 +[36] Wenbin Li, Lei Wang, Jinglin Xu, Jing Huo, Yang Gao, and Jiebo Luo. Revisiting local descriptor based image-to-class measure for few-shot learning. In CVPR, 2019. 7 +[37] Wenbin Li, Jinglin Xu, Jing Huo, Lei Wang, Yang Gao, and Jiebo Luo. Distribution consistency based covariance metric networks for few-shot learning. In AAAI, 2019. 3 +[38] Zhizhong Li and Derek Hoiem. Learning without forgetting. TPAMI, 40(12):2935-2947, 2017. 3 +[39] Yann Lifchitz, Yannis Avrithis, Sylvaine Picard, and Andrei Bursuc. Dense classification and implanting for few-shot learning. In CVPR, 2019. 6 +[40] Yanbin Liu, Juho Lee, Minseop Park, Saehoon Kim, Eunho + +Yang, Sung Ju Hwang, and Yi Yang. Learning to propagate labels: Transductive propagation network for few-shot learning. In ICLR, 2019. 6 +[41] Puneet Mangla, Nupur Kumari, Abhishek Sinha, Mayank Singh, Balaji Krishnamurthy, and Vineeth N Balasubramanian. Charting the right manifold: Manifold mixup for few-shot learning. In WACV, 2020. 7, 8 +[42] Seyed Iman Mirzadeh, Mehrdad Farajtabar, Ang Li, Nir Levine, Akihiro Matsukawa, and Hassan Ghasemzadeh. Improved knowledge distillation via teacher assistant. In AAAI, 2020. 3 +[43] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: A regularization method for supervised and semi-supervised learning. TPAMI, 41(8):1979–1993, 2018. 4 +[44] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016. 3 +[45] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 3 +[46] Boris Oreshkin, Pau Rodríguez López, and Alexandre Lacoste. TADAM: Task dependent adaptive metric for improved few-shot learning. In NeurIPS, 2018. 3, 6 +[47] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016. 3 +[48] Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In CVPR, 2018. 6 +[49] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017. 2, 3, 6 +[50] Avinash Ravichandran, Rahul Bhotika, and Stefano Soatto. Few-shot learning with embedded class models and shot-free meta training. In ICCV, 2019. 6 +[51] Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. In ICLR, 2018. 2, 6 +[52] Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In ICLR, 2019. 3, 6 +[53] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, and Kate Saenko. Universal domain adaptation through self supervision. In NeurIPS, 2020. 3 +[54] Victor Garcia Satorras and Joan Bruna Estrach. Few-shot learning with graph neural networks. In ICLR, 2018. 3 +[55] Jürgen Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The metameta... hook. Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987. 1 +[56] Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Abhishek Kumar, Rogerio Feris, Raja Giryes, and Alex M. Bronstein. Delta-encoder: An effective sample synthesis method for few-shot object recognition. In NeurIPS, 2018. 1, 2, 3 +[57] Jonathan Schwarz, Jelena Luketina, Wojciech M Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pas + +canu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In ICML, 2018. 3 +[58] Konstantin Shmelkov, Cordelia Schmid, and Karteek Alahari. How good is my GAN? In ECCV, 2018. 2 +[59] Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017. 1, 3, 6, 7 +[60] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017. 7 +[61] Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for few-shot learning. In CVPR, 2019. 6 +[62] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In CVPR, 2018. 3, 6 +[63] Yee Teh, Victor Bapst, Wojciech M Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In NeurIPS, 2017. 3 +[64] Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 2012. 1, 3 +[65] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, 2020. 3 +[66] Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: A good embedding is all you need? In ECCV, 2020. 6 +[67] Laurens van der Maaten and Geoffrey Hinton. Visualizing high-dimensional data using t-SNE. JMLR, 9(11):2579-2605, 2008. 8 +[68] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In NeurIPS, 2016. 1, 2, 3, 6, 7 +[69] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD Birds-200-2011 dataset. Technical report, 2011. 2, 6 +[70] Yu-Xiong Wang, Ross B. Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018. 1, 2, 3, 6, 7, 8 +[71] Yu-Xiong Wang and Martial Hebert. Learning to learn: Model regression networks for easy small sample learning. In ECCV, 2016. 1, 2 +[72] Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Learning to model the tail. In NeurIPS, 2017. 2, 7 +[73] Yi Wei, Xinyu Pan, Hongwei Qin, and Junjie Yan. Quantization mimic: Towards very tiny CNN for object detection. In ECCV, 2018. 3 +[74] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018. 2, 3 +[75] Yongqin Xian, Tobias Lorenz, Bernt Schiele, and Zeynep Akata. Feature generating networks for zero-shot learning. In CVPR, 2018. 3 +[76] Yongqin Xian, Saurabh Sharma, Bernt Schiele, and Zeynep Akata. f-VAEGAN-D2: A feature generating framework for any-shot learning. In CVPR, 2019. 1, 3 +[77] Jiaolong Xu, Peng Wang, Heng Yang, and Antonio M. López. Training a binary weight object detector by knowledge transfer for autonomous driving. In ICRA, 2019. 3 + +[78] Zheng Xu, Yen-Chang Hsu, and Jiawei Huang. Training shallow and thin networks for acceleration via knowledge distillation with conditional adversarial networks. In ICLR, 2018. 3 +[79] Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Few-shot learning via embedding adaptation with set-to-set functions. In CVPR, 2020. 6 +[80] Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In CVPR, 2019. 3 +[81] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. 2021. 3 +[82] Chi Zhang, Yujun Cai, Guosheng Lin, and Chunhua Shen. DeepEMD: Few-shot image classification with differentiable earth mover's distance and structured classifiers. In CVPR, 2020. 3, 6, 7, 8 +[83] Hongguang Zhang, Jing Zhang, and Piotr Koniusz. Few-shot learning via saliency-guided hallucination of samples. In CVPR, 2019. 1 +[84] Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. MetaGAN: An adversarial approach to few-shot learning. In NeurIPS, 2018. 1, 2 +[85] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In ECCV, 2016. 3 +[86] Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In CVPR, 2017. 3 +[87] Weilin Zhang and Yu-Xiong Wang. Hallucination improves few-shot object detection. In CVPR, 2021. 1 +[88] Fengwei Zhou, Bin Wu, and Zhenguo Li. Deep meta-learning: Learning to learn in the concept space. arXiv preprint arXiv:1802.03596, 2018. 6 \ No newline at end of file diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/images.zip b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ee38610ca7f5931479cbe33c797c5a28ed8bdf1f --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6983461c42de7d258fa135a0c66e1b69f4dc2b10948cc05aebbabf719bc80b40 +size 519140 diff --git a/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/layout.json b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6d11d40c3ed35d46e3f3e111a360dee075691d5c --- /dev/null +++ b/learningtohallucinateexamplesfromextrinsicandintrinsicsupervision/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05fdf2febc81dec5324c8229eca90f33dbffa8b9b03cc86fcc960c4488a048bd +size 514492 diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_content_list.json b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a234ae6387a7153537edfb78d334c68855a6d1d3 --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b89fb21daa7bc27558ee18bd88b285b1e9b6cdd4fefc415ca8421e4a65a77a8b +size 80675 diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_model.json b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c1755ac8786ee08937b355aa112f78785f3b6df2 --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f87c5ce6c6ed0133048edaf276e9beb3d91cfb52c35c971a214d7b612d70991a +size 93792 diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_origin.pdf b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ecfe647b50283bcd994a7ed49e0d55474bfcf6e0 --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/873cec37-2805-4d7d-9b64-21403219950b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9255c5ecc2487ca6381e79d581cb712cf029d34f1bc67995626bcd8b239c8548 +size 1496626 diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/full.md b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..072938bb89723dead7e4742e5ec0fe0bab36c1b6 --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/full.md @@ -0,0 +1,294 @@ +# Learning to Know Where to See: A Visibility-Aware Approach for Occluded Person Re-identification + +Jinrui Yang $^{1,2,3,7}$ , Jiawei Zhang $^{1,2,3}$ , Fufu Yu $^{7}$ , Xinyang Jiang $^{6}$ , Mengdan Zhang $^{7}$ , Xing Sun $^{7*}$ , Yingcong Chen $^{4,5}$ , and Wei-Shi Zheng $^{1,2,3*}$ + +$^{1}$ School of Computer Science and Engineering, Sun Yat-sen University, China, $^{2}$ Pazhou Lab + $^{3}$ Key Laboratory of Machine Intelligence and Advanced Computing, Ministry of Education, China + $^{4}$ The Hong Kong University of Science and Technology + $^{5}$ The Hong Kong University of Science and Technology (Guangzhou) + $^{6}$ Microsoft Research Asia, Youtu Lab, Tencent + +{yangjr27,zhangjw67}@mail2.sysu.edu.cn,fufuyu@tencent.com,xinyangjiang@microsoft.com, {davinazhang,winfredsun}@tencent.com,yingcong.ian.chen@gmail.com,wszheng@ieee.org + +# Abstract + +Person re-identification (ReID) has gained an impressive progress in recent years. However, the occlusion is still a common and challenging problem for recent ReID methods. Several mainstream methods utilize extra cues (e.g., human pose information) to distinguish human parts from obstacles to alleviate the occlusion problem. Although achieving inspiring progress, these methods severely rely on the fine-grained extra cues, and are sensitive to the estimation error in the extra cues. In this paper, we show that existing methods may degrade if the extra information is sparse or noisy. Thus we propose a simple yet effective method that is robust to sparse and noisy pose information. This is achieved by discretizing pose information to the visibility label of body parts, so as to suppress the influence of occluded regions. We show in our experiments that leveraging pose information in this way is more effective and robust. Besides, our method can be embedded into most person ReID models easily. Extensive experiments validate the effectiveness of our model on common occluded person ReID datasets. + +# 1. Introduction + +Person re-identification (ReID) [6, 26] aims to match images of a person across disjoint cameras, which is widely used in video surveillance, security and smart city. Despite the great progress in the recent years, there is still some practical problems that remain unsolved. Especially, occlusion [31] is one common problem that deteriorates the person ReID performance in real-word scenarios. In practice, people can be easily occluded by some obstacles (e.g. baggage, counters, cars, trees) or walk out of the camera fields, + +![](images/dc237f718d7327fbd343a8f6a1cb70cafab3c8be2b4c1d596848eb1d0624b94d.jpg) +Figure 1. (a), (b) illustrate the relationship between the pose granularity and the estimation error on existing person ReID datasets using the off-the-shelf pose estimator. The existing state-of-the-art methods heavily rely on the fine-grained pose cues but suffer noisy pose detections. Thus, they are hard to directly learn an occlusion-robust feature. (c) illustrates our basic idea. Our model learns a robust mapping from imperfect pose cues to the visibility of body parts to alleviate the effect of occlusion. + +![](images/1f7ed264d525f220a9f990147334cecf04b73c7044cc420358650c1b02b4b7e4.jpg) + +making the prediction results prone to error. + +In recent years, plenty of efforts [31, 32, 17, 4, 21, 11] have been made to solve this occluded person ReID problem. Usually, they adopt extra cues, such as pose or human parsing, to assist in judging the occlusion scenarios. However, these methods assume the existence of fine-grained and error-free extra cues, which is difficult to achieve in practical scenarios. For example, [17, 4] utilizes 18 pose keypoints. And if we use less keypoints, the performance could drop. However, such fine-grained keypoints may come with high estimation error in practice. As illustrated in Fig. 1 (a) to (b), we can see that as the granularity of pose improves, the estimation error also increases, and the estimation error may degrade the robustness of the existing ReID model. In this paper, we aim to find a solution to handle the occlusion problem without heavily relying on the pose information, i.e., it can achieve comparable/superior performance with coarse pose information. + +![](images/dc799b10958de3204e1dae3545e325027f9aa500c58a804179cb10a6c4e19bfe.jpg) +Figure 2. An illustration of the mechanism of part label generation. The red dots represent key points. The shade of the color represents confidence score. When confidence score of a key-point is smaller than the $\lambda$ , its voting weight is set to 0. Otherwise, it is 1. Thus we can see fourth part contains two key-points ( ① and ②). But the confidence score of ② is very low. Thus the total voting weight of the fourth part is 1. After obtaining the total voting weight of each part, we set a voting weight threshold to produce the part label. + +We design a simple but effective framework to accurately perceive the occluded region of person with the help of a region visibility discriminator. In particular, we firstly learn a part label generator, as illustrated in Fig. 2, to generate part labels of different body parts. We then develop a region visibility discriminator based on the generated part labels, which learns a robust mapping from pose to visibility score of horizontal stripes. More concretely, we incorporate the off-the-shelf pose estimator to obtain pose keypoints of person. For each keypoint, the pose estimator predicts its coordinates and confidence score. We use redundant voting to utilize these information to determine whether a part is visible or occluded. We then can obtain the coarse part labels of different body parts. Then we utilize these coarse part labels to optimize the region visibility discriminator in the training stage. Finally, in the test stage, we use the learned region visibility discriminator to predict the visibility scores of person parts without using any keypoint detectors. We conduct comprehensive evaluations on four benchmark datasets, which proves the effectiveness of our part-label based ReID algorithm. + +The main contributions of this work are summarized as follows: 1) To the best of our knowledge, we are the first to quantitatively explore how the quality of pose information can influence the performance in occluded person ReID. 2) We propose a novel pose discretization based approach that is robust to the quality of pose information. Even if the keypoints are sparse and inaccurate, our model still achieves promising performance. 3) Our model achieves superior performance on popular occluded person ReID datasets. Besides, our model runs 404.0 FPS during inference, which is about 10 times faster than HOReID [21] (35.3 FPS)1. + +# 2. Related work + +Part-based Re-Identification. Part-based person ReID methods focus on utilizing local descriptors from different regions to improve the discriminative ability and robustness of the algorithm. Sun et al.[20] propose a part-based convolutional baseline (PCB), which partitions feature maps into several horizontal stripes and learns each part-level feature by multiple classifiers. Based on PCB, Fu et al.[3] introduce a multi-scale and more fine-grained partition method to enhance the discriminative capabilities of various person parts. Yao et al. [22] design a part loss network to minimize the empirical classification risk on the training set and gain the discriminative power on unseen persons. Zheng et al. [24] propose a coarse-to-fine pyramid model to incorporate local information, global information and the gradual cues between them and to alleviate the effect of inaccurate bounding boxes. Although these methods can achieve good results in non-occluded person images, they don't explicitly deal with contaminated person regions, leading to obvious mismatch in occluded scenarios. + +Occluded Person Re-identification. Occluded Person Re-identification is first studied by [31]. Early works [31, 32] try to learn occlusion-free and discriminative features to match image pairs in response to diverse occlusions. However, it is difficult to learn such features in a self-learned manner without the help of extra cue. Thus extra cue based methods [17, 4, 21, 11] have been the mainstream for occluded person ReID. Wang et al.[21] utilize graph convolutional network to model the high-order relations among keypoint based local semantics for the robust alignment. Gao et al.[4] propose to use pose-guided attention mechanism to learn clean and discriminative local features. He et al.[11] design a method to reconstruct the feature map of nonoccluded regions guided by the extra semantic cues. Miao et al.[17] utilize the attention maps of pose joints to disentangle the useful information from the occlusion. However, these methods heavily rely on finer-grained extra cues and are sensitive to the granularity of extra cues. Meanwhile, [4, 21, 17] rely on the off-the-shelf pose estimator in the test stage, and thus noisy pose detections degrade their performance. Specially, compared with [17], our method has three main differences as follows: (1) [17] judges whether or not a part should be considered visible or occluded by directly utilizing these pose estimation detectors in an off-the-shelf manner. However, the underlying gap between datasets for pose estimation and person ReID remains a obvious obstacle. We use the region visibility discriminator, which is optimized on the same source datasets in an end-to-end scheme, to produce accurate visibility information of body parts.(2) Our method is more efficient because the keypoint detector is not needed in the test stage. (3) We evaluate occlusion of each person part smoothly in a continuous way. + +In summary, different from the aforementioned paper, we further investigate the influence of granularity of pose + +
Methods CVPR20key numPartial-REIDOccluded-REIDOccluded-Duke
Rank1Rank3Rank1mAPRank1mAP
HR v1669.080.065.961.449.239.5
HR v2870.381.770.865.451.241.1
HR v31072.082.372.165.453.543.7
HR(orig)1477.085.776.368.555.143.8
+ +Table 1. The reproduced results of HOReID [21]. We conduct a series of experiments to observe the effect of granularity of keypoints on HOReID. The number of keypoints changes from 14,10,8 until 6, they are denoted as "HR (orig)," "HR v3", "HR v2", "HR v1", respectively. The 14 keypoints is the original setup of paper [21]. + +
Methods ICCV19Partial-REIDOccluded-REIDOccluded-Duke
Rank1Rank3Rank1mAPRank1mAP
PForig68.079.063.753.251.937.2
PForig w/ GT70.381.768.556.952.837.4
+ +Table 2. The reproduced results of PGFA [17]. + +information and provide a simple yet effective method to robustly make use of pose information on occluded person ReID. We hope our exploration will inspire more works from the ReID research community. + +# 3. Method + +In this section, we first carry out a concrete analysis on the pose information discretization in Sec. 3.1. Then, our part-label based ReID algorithm is introduced in Sec. 3.2, particularly emphasizing on the part-label related modules in Sec. 3.3, Sec. 3.4 and Sec. 3.5. Finally, we elaborate on the overall training processes in Sub. 3.6. + +# 3.1. Discretization analysis + +We first carry out a quantitative analysis to explore the effect of the granularity of pose keypoints and the estimation error for the existing state-of-the-art occluded ReID models. We take HOReID [21] and PGFA [17] as examples, which have been introduced in the related work section. + +To explore the impact of the granularity of pose keypoints, we change the granularity of pose cues from fine to sparse. Specifically, we divide pedestrians into three regions: top, middle and bottom, as shown in part (c) of Fig. 4. For each region, we randomly drop human joints to obtain different granularity of pose cues. The experimental results are presented in Table 1. Table 1 shows that as the number of keypoints decreases from 14 to 6, there is a significant performance degradation for HOReID. + +To explore the impact of noise of pose cues, we reproduce the results of PGFA. The results are shown in Table 2. "PFori" is the results of using the original pose cues, which keeps the original setup of paper [17]. To further quantitatively observe the impact of noise, we manually annotate the three datasets with red rectangle to represent visible regions in pedestrian images. As shown in Fig. 4 (b), the red rectangle box can be seen as precise extra cues without any noise, which can be seen an approximate ground-truth pose annotation. With this kind of refinement, the results using manual annotation extra cues are denoted by the "PForig w/G" in Table 2. We can see PGFA obtains consistent perfor + +mance gains on three different datasets. + +In conclusion, the set of control experiments prove the following insights: 1) Although sparse pose granularity contains less noise, it causes an obvious degradation on performance of ReID models. 2) Extra cues is usually extracted with estimation error, which harms the performance of ReID models; The ground-truth fine-grained extra cue can bring performance gains. But the ground-truth fine-grained extra cue is hard to obtain, which usually requires time-costing and labor-consuming annotations. In this paper, we find an easy but effective solution, which utilizes the imperfect extra cues in coarse manner and is robust to the granularity of extra cues and the estimation error. Meanwhile, the method can achieve the similar ReID performance as exploiting the fine-grained precise extra cue. + +# 3.2. Overall Part-label based Framework + +As shown in Fig. 3, our model is based on PCB [20]. The model mainly includes a Part Label Generator, a region visibility discriminator and a visibility-guided constraint, which aims to learn a robust mapping that maps keypoints to visibility scores of coarse stripes. The detail of our model is described below. + +# 3.3. Part Label Generator with a Redundant Voting + +To convert the keypoint cues to visibility information of person regions, we design a part label generator based on a redundant voting strategy, which is partially inspired by work [17]. But we further consider the information of multiple keypoints in each person stripe. Meanwhile, our purpose is quite different from [17], which has been discussed in related work. Following existing works [17, 4, 21], we use an off-the-shelf pose estimator to obtain pose keypoints of a person. In this paper, we choose the AlphaPose [2] as our pose estimator, which is pre-trained on the COCO dataset [15]. For each keypoint, the pose estimator predicts its coordinates and confidence score. For a person image, we can obtain totally $K$ human keypoints, where $K$ is 18 in this paper. The information of each keypoint can be denoted mathematically as $(cx_{j},cy_{j},s_{j}), j = 1,2,\dots ,K$ . $cx_{j},cy_{j},s_{j}$ denote the horizontal and vertical coordinates, confidence score of $j$ th keypoint respectively. + +The original meaning of the confidence score is to represent the probability that the keypoint belongs to the human joint (e.g., head, hand, leg, etc.). It can also be used to represent a more coarse meaning that indicates the visible information of person part. As shown in Fig. 2, we can see a body stripe may contain multiple keypoints. So we design a redundant voting method to convert confidence score of multiple keypoints to visible information of person part, denoted as part label. We argue that each keypoint should has a voting weight to indicate whether or not a part should be considered visible or occluded. Meanwhile, we also know that when the confidence score of a keypoint is high, it is likely to be visible. Otherwise, it may be occluded. Thus we + +![](images/3ef9367893473cee18d9800a5ed3bf8e50b454dc7bd14f359a2039bf69809b2a.jpg) +Figure 3. The overall architecture of our proposed method. We use a CNN backbone for the feature extraction. Similar to PCB [20], the feature is learnt in both global and local view. We design a region visibility discriminator in the local branch to predict visibility of coarse stripes, as illustrated in the yellow rectangle. The ground-truth part label is generated by the part label generator based on the keypoint predictions, as illustrated in the green rectangle. The region visibility discriminator is supervised by part labels to learn a compact classification boundary by pulling visible body part(e.g., head, the upper body,etc.) together and pushing the occluded body part(e.g., umbrella, tree, car) together in training stage, as illustrated in the orange rectangle. + +set a threshold $\lambda$ to assign different voting weight to different keypoints. The voting weight can denote whether vote of a keypoint is valid or not. When the $s_j \geq \lambda$ , the voting weight of keypoint is 1, which indicates that the keypoint can produce a vaild vote. When the $s_j < \lambda$ , the voting weight of keypoint is 0. Finally, we sum the total voting weight of all keypoints in each stripe, which is denoted as $T$ . If the total voting weight of a body part reaches a certain level, this part can be regarded as visible. Thus we set a voting weight threshold $W$ to judge whether a part should be considered visible or occluded. When $T \geq W$ , the stripe is seen as visible and set its part label to 1. Otherwise, the stripe is seen as occluded and set its part label to 0. Thus, for each part $i = 1, \dots, N$ , its part label $l_i$ is written as follows: + +$$ +w _ {j} = f (s _ {j} - \lambda) \quad (j = 1, \dots , K), +$$ + +$$ +T _ {i} = \sum_ {j = 1} ^ {K} w _ {j} \text {i f} \exists c y _ {j} \in \left[ \frac {i - 1}{N} H, \frac {i}{N} H\right), \tag {1} +$$ + +$$ +l _ {i} = f (T _ {i} - W) \quad (i = 1, \dots , N), +$$ + +where $f(x) = 1$ if $x \geq 0$ , otherwise, $f(x) = 0$ . $H$ denotes the height of the original image. Thus, a person horizontally partitioned into $N$ body regions, each region has a ground truth label $l_{i} \in \{0,1\}$ . $l_{i} = 0$ or 1 means occluded or visible, respectively. + +# 3.4. Region Visibility Discriminator + +Person ReID aims to learn a distance that images of the same identity should be as close as possible. As shown in Fig. 4 (a), if we directly calculate the distance between occluded and holistic person, the final distance would be ob- + +![](images/712e5953c0d09f27b666d9a8964c67c09ccdbda1010239f4cdc59bad9419d3ba.jpg) +Figure 4. (a) An illustration of visibility scores for parts, which help avoid disturbances from occlusions. (b) This red box of manual annotation can be seen a precise extra cues without any noise, which can used to explore the effect of noise in PGFA [17] in Sec. 3.1. (c) An illustration of different granularity of pose cue. + +vious inaccurate. An intuitive idea is to rough visibility information of person images by utilize extra pose cues. But the original pose cues cannot be directly quantified and used in calculating the effective distance between occluded and holistic person images. Thus we design a region visibility discriminator to learning a robust mapping from the coarse pose cues to the visibility scores of person parts. + +We introduce the region visibility discriminator formally below. Given a person image, we denote it as $I$ , whose feature map extracted by the backbone model is denoted as $F$ . $F_{i} \in \mathbb{R}^{h \times w \times c}$ , in which $h, w, c$ denote the height, width and channel number, respectively. The feature map $F$ is horizontally partitioned into $N$ regions. Then each region is processed by average pooling and each region feature is represented as $x_{i} \in \mathbb{R}^{c}, i = 1, \dots, N$ . $c$ is the dimension of feature. Our region visibility discriminator takes each region feature $x_{i}$ as input to estimate its visibility scores. The ground-truth part label, generated by our part label generator, is used to optimize the region visibility discriminator in an end-to-end manner. + +We implement the Region Visibility Discriminator via a tiny network which consists of a Convolutional layer of $1 \times 1$ filter, a BatchNorm layer, a Fully-connected layer, and a Sigmoid activation layer. The output of the region visibility discriminator is visibility scores of person parts, and its range is $(0,1)$ . Further the visibility scores are introduced into the ReID triplet loss to obtain a more accurate distance (see Sec. 3.5). + +# 3.5. Visibility-Guided Constraint Loss + +In the ReID task, the fundamental learning process of human appearance consistency is usually accomplished by common metrics such as the contrastive loss and the triplet loss. Typically, the batch hard triplet loss [12] is exploited in this paper and formulated as follows: + +$$ +L _ {\text {t r i p l e t}} = \max \left(D \left(f _ {a}, f _ {p}\right) - D \left(f _ {a}, f _ {n}\right) + \mathrm {m}, 0\right), \tag {2} +$$ + +where $f_{a}, f_{p}, f_{n}$ are features extracted from the anchor, positive and negative samples, respectively, and $m$ is the margin of the triplet loss. Traditionally, $D(\cdot)$ is the L2-norm distance or cosine distance. However, as shown in Fig. 4 (a), the occluded region is obviously obstacle for computing the effective distance. Thus only consider the global distance is inaccurate and we need to alleviate the negative influence of occluded part by part labels. Therefore, borrowed from the similar matching strategy in [17], we use Equation (3) as the new distance function of measuring image pairs. But different from [17], we integrate the matching strategy into triplet loss, which can optimize the model in end-to-end manner. + +$$ +\operatorname {d i s t} = \frac {\sum_ {i = 1} ^ {N} \left(l _ {i} ^ {q} \cdot l _ {i} ^ {g}\right) \cdot D \left(x _ {i} ^ {q} , x _ {i} ^ {g}\right) + D \left(F ^ {q} , F ^ {g}\right)}{\sum_ {i = 1} ^ {N} l _ {i} ^ {q} \cdot l _ {i} ^ {g} + 1}. \tag {3} +$$ + +Specifically, the $l_i^q$ and $l_i^g$ denote the visibility scores of $i$ th part of query and gallery images respectively. $\cdot$ denotes multiplication. $D(x_i^q,x_i^g)$ is original distance of each corresponding feature pairs. As shown in Fig. 4(a), when there exists occlusion, the $l_i^q\cdot l_i^g$ would be small (close to 0), which can be seen as a weight that reduces the influence of the occlusion on the final distance. When a pair of features are both visible, the $l_i^q\cdot l_i^g$ would be high (close to 1). Then $D(F^{q},F^{g})$ are utilized to measure distance of global feature. Finally, we use Equation (3) to replace the conventional $D(\cdot)$ as more representative measurement metric in hard triplet loss. The visibility-guided hard triplet loss is denoted as $\mathcal{L}_{VGTri}$ . + +Meanwhile, in the test stage, we also use Equation (3) as the distance measurement metric between query and gallery images. Note that the visibility scores of person part are generated by region visibility discriminator instead of pose detectors in test stage. It means we do not need to rely on any extra cues in test stage, which can relax the constraints of expensive resource overhead when deploying re-id models. + +# 3.6. Objective Function + +Except for the Visibility-Guided Hard Triplet loss mentioned above, we employ two type loss functions to optimize our proposed model, including the Cross-Entropy loss and the hard triplet loss in training phase. + +ID loss. For basic discrimination learning, we regard the identification task as a multi-class classification problem, the ID loss can be formulated as Equation (4) + +$$ +\mathcal {L} = C E (\hat {y}, y), \tag {4} +$$ + +where CE denotes the cross-entropy loss, $\hat{y}$ denotes the prediction and $y$ denotes the ground truth identity. In the training phase, global feature, part-level feature and region visibility discriminator are supervised by cross-entropy loss which are denoted as $\mathcal{L}_{gID},\mathcal{L}_{pID},\mathcal{L}_{BCE}$ . + +Triplet loss. For the Sec. 3.5, we propose to use visibility-guided hard triplet loss as the new distance metric of global feature. For part-level feature, we still use batch hard triplet loss to further learn discriminative part-level representation, which is denoted as $\mathcal{L}_{pTri}$ . + +Therefore, the overall objective function is: + +$$ +\mathcal {L} _ {\text {t o t a l}} = \alpha \mathcal {L} _ {p I D} + (1 - \alpha) \mathcal {L} _ {g I D} + \mathcal {L} _ {p T r i} + \mathcal {L} _ {B C E} + \mathcal {L} _ {V G T r i}. \tag {5} +$$ + +where $\alpha$ is balanced factor. + +# 4. Experiments + +# 4.1. Datasets and Evaluation Protocols + +To illustrate the superiority of our proposed method in overcoming the occlusion problem in person ReID, we conduct our experiments on four datasets. They are Occluded-DukeMTMC [17], Partial-REID [28], Partial-iLIDS [27], Occluded-ReID [31], respectively. + +The Occluded-DukeMTMC dataset is proposed recently by work [17]. Its characteristic is that the query images are all occluded images. It contains 15618 training images, 2210 occluded query images and 17661 gallery images, which is the most largest dataset in occluded person ReID. The Occluded-ReID dataset contains 2000 annotated person images of 200 occluded persons. Each person has 5 full-body person images and 5 occluded person. The Partial-REID dataset includes 600 images of 60 persons. 5 occluded person images and 5 holistic person images are collected for each identity. The Partial-iLIDS is based on the iLIDS dataset [27] dataset contains 119 people with a total 238 person images. Following the test setting of previous work [19, 4, 11, 17, 9, 21], Occluded-ReID dataset, Partial-REID dataset and Partial-iLIDS dataset are only used as test set. When conducting our experiments on these three public datasets, we train our proposed model on the training set of Market-1501 [25]. In this work, for Partial-iLIDS and Partial-REID, we only use the full-body and occluded person images for evaluation. For performance evaluation, we used the cumulative matching characteristic (CMC) and the mean Average Precision (mAP). + +
MethodsSourcePartial-REIDPartial-iLIDS
Rank-1Rank-3Rank-1Rank-3
DSR [9]CVPR1850.770.058.867.2
SFR [10]arXiv1856.978.563.974.8
AFPB [31]ICME1878.5---
FPR [11]ICCV1981.0-68.1-
TCSDO [32]arXiv1982.7---
VPM [19]CVPR1967.781.965.574.8
PGFA [17]ICCV1968.080.069.180.9
PVPM+Aug[4]CVPR2078.5---
HOReID [21]CVPR2085.391.072.686.4
Ours-85.793.780.788.2
+ +Table 3. Comparison with state-of-the-arts on two partial datasets, i.e. Partial-REID [28] and Partial-iLIDS [9] datasets. + +# 4.2. Implementation Details + +For the model architectures, we adopt the same modifications for ResNet50 [8] with [16, 20]. The modified ResNet50 is used as our backbone to extract feature maps from input images. For each PCB classifier and the classifier of the region visibility discriminator, following [16], we adopt $1 \times 1$ conv, a batch normalization layer [14] and a fully-connected layer followed by a softmax function. For data preprocessing, the input images are resize to $384 \times 128$ and augmented with we adopt random horizontal flipping, padding ten pixels, random cropping, and random erasing [29]. When conduct the test on Partial-REID, Partial-iLIDS and Occluded-ReID datasets, followed by [21], we adopt color jitter augmentation to avoid domain variance. For optimization, we adopt standard Stochastic Gradient Descent (SGD) optimization strategy to train our model. The total training epoch number is 80. We use cosine annealing strategy to adjust the learning rate. For Market1501 and Occluded-DukeMTMC, we set the initial learning rate of backbone to 0.02 and 0.05, respectively. The hyperparameter $\alpha, N$ are set to 0.9, 6 and 0.8, respectively. For the batch hard triplet loss and visibility-guided hard triplet loss, the batch size is set to 128 with 4 images per person. The threshold $\lambda$ , which assigns voting weight to different key-points, is set to 0.2. The voting weight threshold $W = 1$ . + +# 4.3. Comparison with the State-of-the-art + +To validate the effectiveness of our proposed method on the occluded person ReID problem, we compare our presented method with several recent state-of-the-art methods on the above mentioned four datasets. Meanwhile, we also compare our method with the state-of-the-art methods designed for holistic person. + +Compared to state-of-the-art methods designed for Occluded person ReID. Compared with PGFA [17], the rank1 accuracy of our model significantly surpass this method by $17.7\%$ , $11.6\%$ on Partial-REID and Partial-iLIDS, respectively. Meanwhile, on the Occluded-Duke dataset, our model outperforms the method by $10.8\% / 9.0\%$ in rank1/mAP. The main reason is that PGFA directly depends on the pre-trained pose estimator to generate part labels, it is easily affected by the accuracy of the pose estimator. How + +
MethodsSourceOccluded-DukeOccluded-REID
Rank-1mAPRank-1mAP
Part-Aligned [23]ICCV1728.820.2--
PCB [20]ECCV1842.633.741.338.9
Part Bilinear [18]ECCV1836.9---
FD-GAN [5]40.8---
AMC+SWM [28]ICCV15--31.227.3
DSR [9]CVPR1840.830.472.862.8
SFR [10]arXiv1842.332--
Ad-Occluded [13]CVPR1844.532.2--
TCSDO [32]arXiv19--73.777.9
FPR [11]ICCV19--78.368.0
PGFA [17]ICCV1951.437.3--
PVPM+Aug[4]CVPR20--70.461.2
HOReID [21]CVPR2055.143.880.370.2
ISP [30]ECCV2062.852.3--
Ours-62.246.381.071.0
+ +Table 4. Comparison with state-of-the-arts on two occluded datasets, i.e. Occluded-Duke [17] and Occluded-REID [31]. + +ever, our superiority lies in the design of the region visibility discriminator, which predicts the visibility scores of stripes and can conveniently be integrated into the feature learning model in an end-to-end scheme. + +Compared with PVPM [4], PVPM extracts heatmaps of the keypoints to produce pose-guided attention (PGA) for mining visible parts. Our method surpasses the PVPM by $7.2\%$ rank-1 accuracy on Partial-REID. And also, $11.5\% / 10.6\%$ rank1/mAP on Occluded-REID. HOReID [21] utilizes graph conventional network to model relations of keypoints. Our approach outperforms HOReID by $7.1\% / 2.5\%$ rank-1/mAP on Occluded-Duke. Note that both PVPM [4] and HOReID [21] heavily rely on dense and accurate pose keypoints, which is not always accessible as the pose estimator are not optimal. On the contrary, by transforming keypoints to visibility scores, our model is less sensitive to pose estimation error, thus can better locate occluded regions. Compared to ISP [30], we don't need to iteratively learn and classify feature maps on pixel-by-pixel level, which is time-consuming in training and testing stage. Furthermore, compared with the complicated training scheme of ISP [30], our method can be embedded into most person ReID methods easily. + +Compared to state-of-the-art methods designed for holistic person. We reproduce and evaluate the two strongest state-of-the-art methods [16, 24] designed for holistic person on the four occluded ReID datasets. As shown in Table 6, our model significantly surpasses these methods because they don't explicitly handle occlusion. + +# 4.4. Ablation Study + +The effect of Region Visibility Discriminator. To verify the necessity of region visibility discriminator, we straightly set all the part labels for each image to 1 in testing stage, which means the model can't judge the visibility of each part. From the 1-st row and 2-nd row of Table 5, we can see disabling the function of the region visibility discriminator significantly degrades ReID performance by $8.8\% / 8.3\%$ + +
VGTriVRDPartial-REIDPartial-iLIDSOccluded-REIDOccluded-Duke
Rank-1Rank-3Rank-1Rank-3Rank-1mAPRank-1mAP
××79.789.078.986.571.862.741.734.3
×✓85.093.079.887.380.671.061.346.0
✓×81.691.378.988.274.764.747.038.8
✓✓85.793.780.788.281.071.062.246.3
+ +![](images/e233ddbc031610169d6cf5e6de602a39595b7f5b05924d473ea448eb61e0b5f7.jpg) +Figure 5. A visualization of visibility scores predicted by region visibility discriminator in testing stage on Partial-REID and Occluded-REID datasets. The six black values on left of image from top to bottom denote the visible probability of each part region in turn. + +Table 5. Analysis of Visibility-Guided Hard Triplet loss (VGTri), Region Visibility Discriminator (VRD). The results of first row can be seen as baseline. The experimental results show the effectiveness of our proposed methods. + +
MethodsPartial-REIDPartial-iLDSOccluded-REIDOccluded-Duke
Rank1Rank3Rank1Rank3Rank1mAPRank1mAP
Pyramid [24]64.677.675.688.261.558.552.846.1
Strong Baseline [16]75.385.079.886.664.258.549.943.4
Our85.793.780.788.281.071.062.246.3
+ +Table 6. Comparing the performance of our method and other two state-of-the-art methods on four datasets. + +
Methodskey numPartial-REID Rank1Partial-iLDS Rank1Occluded-REID Rank1Occluded-Duke Rank1
Our v1683.3376.577.760.7
Our v2984.078.276.060.5
Our v31284.778.276.060.5
Our v41584.379.976.060.4
Ours1885.780.781.062.2
+ +Table 7. The number of keypoints changes from 18,15,12,9 to 6. They are denoted as "Ours", "Ours v4", "Ours v3", "Ours v2", "Ours v1", respectively. The 18 keypoints is the original setup of our paper. The experimental results show the robustness of our part label strategy for utilizing pose information. + +
MethodsPartial REIDPartial iLDSOccluded REIDOccluded Duke
Rank1Rank1Rank1Rank1
PGlabel84.065.679.248.1
GT88.080.781.062.2
Ours85.780.781.062.2
+ +Table 8. Analysis of three different methods to obtain part label. The experimental results show the superiority of our proposed method. + +
MethodsPartial-REIDPartial-iLDSOccluded-REIDOccluded-Duke
Rank1Rank3Rank1Rank3Rank1mAPRank1mAP
HTri85.093.079.887.480.670.961.246.0
VGTri85.793.780.788.281.071.062.246.3
+ +Table 9. Comparing the effect of our visibility-guided hard triplet loss with traditional hard triplet loss on four datasets. The experimental results show the superiority of our methods to traditional hard triplet loss. + +and $19.6\% / 11.7\%$ rank1/mAP on the two largest datasets, namely Occluded-REID and Occluded-Duke. Similarly, + +for the 3-rd row and 4-th row of Table 5, the accuracy of rank1/mAP drops $6.3\% / 6.3\%$ and $15.2\% / 7.5\%$ respectively on the same two datasets. Hence, the experimental results show the effectiveness of our proposed region visibility discriminator module. Meanwhile, the consistent significant improvements prove the solid generality of the region visibility discriminator module. + +The Effect of Visibility-Guided Hard Triplet loss. Similar to the analysis of the region visibility discriminator, the comparison results from the 1-st row and 3-rd row, 2nd row and 4-th row of Table 5 depict that the visibility-guided hard triplet loss is effective. Meanwhile, for comparing visibility-guided hard triplet loss(VGTri) and the traditional hard Triplet loss(HTri) [12], we keep all experimental settings same except for the type of the triplet loss and further conduct two experiments. Traditional hard triplet loss and our visibility-guided hard triplet loss are denoted as "HTri" and "VGTri" respectively. The experimental results are shown in Table 9. "VGTri" fully outperforms traditional hard Triplet loss on four datasets, which further illustrates the superiority of visibility-guided hard triplet loss compared to traditional hard triplet loss. + +# 4.5. Model Analysis + +The Superiority of Our Part Label Discretization Strategy. For verifying the superiority of our part label discretization strategy, we compare the other two strategies to get the part label. One is using the off-the-self pose detector to obtain the part label, which is denoted as "PGlabel". The other is using bounding box annotation to obtain part labels, which is denoted as "GT"(e.g., as shown in Fig. 4 (b)). We can regard it as a precise enough extra cue. For fair compar- + +
MethodsPartial-REIDPartial-iLDSOccluded-REIDOccluded-Duke
Rank1Rank3Rank1Rank3Rank1mAPRank1mAP
Mask R-CNN [7]86.391.079.086.681.671.662.945.8
OpenPose [1]86.091.380.786.679.069.961.546.0
AlphaPose [2]85.793.780.788.281.071.062.246.3
+ +Table 10. Comparing the effect of using different pose detectors on four datasets. AlphaPose is used in our original paper. + +![](images/748a9c99c94bac46e512288e54789c064634ff08707c6ef471aa2608e5880dd4.jpg) +Figure 6. (a) The impact of the loss weight $\alpha$ . (b) The impact of confidence threshold $\lambda$ . (c) The impact of Voting weight threshold $W$ . + +ison, we fix all setup and use the same trained model, only change the way of obtaining part label in inference stage. + +The experimental results are presented on Table 8, which suggests the performance of our method fully outperforms the "PGlabel" on four datasets. Specifically, the rank-1 of our method dramatically surpasses "PGlabel" by $14.1\%$ on Occluded-Duke. The reason may is that the "PGlabel" is based on pose information, only obtaining hard part label (0 or 1). Moreover, "PGlabel" is susceptible to the performance of pose estimator itself. But our part label predicted by region visibility discriminator is in a soft form, whose range is from 0 to 1 (e.g., as shown in Fig. 5). Thus our soft part label is continuous, which can reflect the different degrees of occlusion. Meanwhile, under the guidance of part labels, our method can learn consistent feature in an end-to-end manner. On the other hand, we also can see the performance of our method and "GT" is basically same, which shows that our method can achieve the same performance as exploiting ideally precise extra cues. But compared with "GT", our method don't require time-costing and labor-consuming annotations. + +The Robustness of Our Part Label Discretization Strategy. To validate the robustness of our part label strategy, we keep our experimental condition fixed and only change the granularity of pose information. And the Table 7 shows that with the variation of pose information, namely the variation of the number of keypoints, the performance of our model is nearly unchanged, which demonstrates that our part label strategy is robust to granularity of pose cues. + +The Impact of the Pose Estimation Algorithm. To investigate the impact of different pose keypoint detectors, we use three different pose estimation algorithms, AlphaPose [2], Mask RCNN [7] and OpenPose [1]. As shown in Table 10, we find three pose estimation algorithms achieves similar performance on the four datasets, which proves that our model is robust to different keypoint detectors. + +# 4.6. Hyper-parameter Analysis + +The Impact of the balanced factor $\alpha$ . We analyze the effect of the balanced factor $\alpha$ parameters on four datasets. Results in figure 6 (a) indicate that our method is not sensi + +tive to the $\alpha$ in range [0.1,0.9]. + +The Impact of the Threshold $\lambda$ . We set a threshold $\lambda$ (0.2 in this paper) to assign voting weight to different keypoints. We further evaluate the impact of $\lambda$ . As shown in Figure 6 (b), when $\lambda$ is set between 0.1 and 0.5, the performance changes smoothly, which indicates that our model is not sensitive to the $\lambda$ of this range. When $\lambda$ is too large, the model suffers a performance drop, because the voting weight of few keypoints are set to 1 and further lead to generating abundant incorrect part labels. + +The Impact of the voting weight threshold $W$ . We set a voting weight threshold $W$ (1 in this paper) to assign part labels to different body parts. We further evaluate the impact of $\lambda$ . As shown in Figure 6 (c), when $W = 1$ , the model achieves the best performance. The phenomenon explains why our method is robust to granularity of keypoints. When $W$ is set to 1, only needing a small number of keypoints that can produce valid votes can meet the condition. Thus, as shown in Table 7, we can see that even when the granularity is extreme sparse, our method is still competitive to the current state-of-the-art methods. + +# 4.7. Visualization + +we visualise the visibility scores predicted by region visibility discriminator in testing stage. From the Fig. 5, we find although the image region has a variety of diversified appearances, the completely occluded region and the completely visible region both can be predicted a almost ideal visible probability. Moreover, we can see the partially occluded region(e.g., as shown in the third person image on the Fig. 5 (a)), whose visible score is proper and continuously reflects the change of occlusion. It shows our soft part label based on our region visibility discriminator is superiority to hard part label based on pose information. + +# 5. Conclusion + +In this paper, by changing the granularity of the pose cue for current state-of-the-art methods, and adding annotation bounding boxes by hands, we conduct some experiments and observe following facts: 1) these method is sensitive to the granularity of the pose cue and prefers fine-grained and accurate pose cue; 2) the pose cue usually contains noise in real scenarios, increasing the difficulty of robust modeling. Then, we propose a simple but effective part-label based algorithm to discretely utilize coarse pose information while maintain good robustness and generality. The experimental results show the superiority of our algorithm. + +# 6. Acknowledgement + +This work was supported partially by the NSFC(U1911401,U1811461), Guangdong NSF Project (No. 2020B1515120085, 2018B030312002), Guangzhou Research Project (201902010037), and Research Projects of Zhejiang Lab (No. 2019KD0AB03), and the Key-Area Research and Development Program of Guangzhou (202007030004). + +# References + +[1] Zhe Cao, Gines Hidalgo, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Openpose: realtime multi-person 2d pose estimation using part affinity fields. IEEE transactions on pattern analysis and machine intelligence, 43(1):172-186, 2019. 8 +[2] Hao-Shu Fang, Shuqin Xie, Yu-Wing Tai, and Cewu Lu. Rumpe: Regional multi-person pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2334-2343, 2017. 3, 8 +[3] Yang Fu, Yunchao Wei, Yuqian Zhou, Honghui Shi, Gao Huang, Xinchao Wang, Zhiqiang Yao, and Thomas Huang. Horizontal pyramid matching for person re-identification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 8295–8302, 2019. 2 +[4] Shang Gao, Jingya Wang, Hutchuan Lu, and Zimo Liu. Pose-guided visible part matching for occluded person reid. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11744-11752, 2020. 1, 2, 3, 5, 6 +[5] Yixiao Ge, Zhuowan Li, Haiyu Zhao, Guojun Yin, Shuai Yi, Xiaogang Wang, et al. Fd-gan: Pose-guided feature distilling gan for robust person re-identification. In Advances in neural information processing systems, pages 1222–1233, 2018. 6 +[6] Shaogang Gong, Marco Cristani, Shuicheng Yan, Chen Change Loy, and Person Re-Identification. Springer publishing company. Incorporated, 1447162951:9781447162957, 2014. 1 +[7] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961-2969, 2017. 8 +[8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 6 +[9] Lingxiao He, Jian Liang, Haiqing Li, and Zhenan Sun. Deep spatial feature reconstruction for partial person re-identification: Alignment-free approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7073-7082, 2018. 5, 6 +[10] Lingxiao He, Zhenan Sun, Yuhao Zhu, and Yunbo Wang. Recognizing partial biometric patterns. arXiv preprint arXiv:1810.07399, 2018. 6 +[11] Lingxiao He, Yinggang Wang, Wu Liu, He Zhao, Zhenan Sun, and Jiashi Feng. Foreground-aware pyramid reconstruction for alignment-free occluded person re-identification. In Proceedings of the IEEE International Conference on Computer Vision, pages 8450–8459, 2019. 1, 2, 5, 6 +[12] Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. 5, 7 +[13] Houjing Huang, Dangwei Li, Zhang Zhang, Xiaotang Chen, and Kaiqi Huang. Adversarily occluded samples for person re-identification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5098–5107, 2018. 6 +[14] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 6 + +[15] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740-755. Springer, 2014. 3 +[16] Hao Luo, Youzhi Gu, Xingyu Liao, Shenqi Lai, and Wei Jiang. 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, pages 0–0, 2019. 6, 7 +[17] Jiaxu Miao, Yu Wu, Ping Liu, Yuhang Ding, and Yi Yang. Pose-guided feature alignment for occluded person re-identification. In Proceedings of the IEEE International Conference on Computer Vision, pages 542–551, 2019. 1, 2, 3, 4, 5, 6 +[18] Yumin Suh, Jingdong Wang, Siyu Tang, Tao Mei, and Kyoung Mu Lee. Part-aligned bilinear representations for person re-identification. In Proceedings of the European Conference on Computer Vision (ECCV), pages 402–419, 2018. 6 +[19] Yifan Sun, Qin Xu, Yali Li, Chi Zhang, Yikang Li, Shengjin Wang, and Jian Sun. Perceive where to focus: Learning visibility-aware part-level features for partial person re-identification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 393–402, 2019. 5, 6 +[20] Yifan Sun, Liang Zheng, Yi Yang, Qi Tian, and Shengjin Wang. Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In Proceedings of the European Conference on Computer Vision (ECCV), pages 480-496, 2018. 2, 3, 4, 6 +[21] Guan'an Wang, Shuo Yang, Huanyu Liu, Zhicheng Wang, Yang Yang, Shuliang Wang, Gang Yu, Erjin Zhou, and Jian Sun. High-order information matters: Learning relation and topology for occluded person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6449-6458, 2020. 1, 2, 3, 5, 6 +[22] Hantao Yao, Shiliang Zhang, Richang Hong, Yongdong Zhang, Changsheng Xu, and Qi Tian. Deep representation learning with part loss for person re-identification. IEEE Transactions on Image Processing, 28(6):2860-2871, 2019. 2 +[23] Liming Zhao, Xi Li, Yueting Zhuang, and Jingdong Wang. Deeply-learned part-aligned representations for person re-identification. In Proceedings of the IEEE international conference on computer vision, pages 3219–3228, 2017. 6 +[24] Feng Zheng, Cheng Deng, Xing Sun, Xinyang Jiang, Xiaowei Guo, Zongqiao Yu, Feiyue Huang, and Rongrong Ji. Pyramidal person re-identification via multi-loss dynamic training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8514–8522, 2019. 2, 6, 7 +[25] Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable person re-identification: A benchmark. In Proceedings of the IEEE international conference on computer vision, pages 1116–1124, 2015. 5 +[26] Liang Zheng, Yi Yang, and Alexander G Hauptmann. Person re-identification: Past, present and future. arXiv preprint arXiv:1610.02984, 2016. 1 + +[27] Wei-Shi Zheng, Shaogang Gong, and Tao Xiang. Person re-identification by probabilistic relative distance comparison. In CVPR 2011, pages 649–656. IEEE, 2011. 5 +[28] Wei-Shi Zheng, Xiang Li, Tao Xiang, Shengcai Liao, Jianhuang Lai, and Shaogang Gong. Partial person re-identification. In Proceedings of the IEEE International Conference on Computer Vision, pages 4678-4686, 2015. 5, 6 +[29] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In AAAI, pages 13001-13008, 2020. 6 +[30] Kuan Zhu, Haiyun Guo, Zhiwei Liu, Ming Tang, and Jinqiao Wang. Identity-guided human semantic parsing for person re-identification. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part III 16, pages 346–363. Springer, 2020. 6 +[31] Jiaxuan Zhuo, Zeyu Chen, Jianhuang Lai, and Guangcong Wang. Occluded person re-identification. In 2018 IEEE International Conference on Multimedia and Expo (ICME), pages 1-6. IEEE, 2018. 1, 2, 5, 6 +[32] Jiaxuan Zhuo, Jianhuang Lai, and Peijia Chen. A novel teacher-student learning framework for occluded person re-identification. arXiv preprint arXiv:1907.03253, 2019. 1, 2, 6 \ No newline at end of file diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/images.zip b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ba8343b4551c7a8fdf13a33265b1c89eb985f6ec --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2061d895625117144546d6ed427ac244c46ebd6029f4b52851af5fb70cc3b823 +size 610061 diff --git a/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/layout.json b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5033ff6eb86946d20814e7d7394ae955b5d1241b --- /dev/null +++ b/learningtoknowwheretoseeavisibilityawareapproachforoccludedpersonreidentification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5701d4865a31903737161efa47bd359062d638b0c784a4e80e6b410b2898418 +size 358397 diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_content_list.json b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..68cc2be5e098d3a518da88e9a81f79828b5cacf6 --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a40116d73e5854f0bce05a9d0057e82f476bbbff371ca0fc4ec63e755563457c +size 87528 diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_model.json b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_model.json new file mode 100644 index 0000000000000000000000000000000000000000..80b1270d142da4db9e46e7e1d8364a20891c07fa --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb5a2423ee2d5fa0e5c5bbcd36e56da8d0ee6850f60468f45e8e2927060eb08a +size 110082 diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_origin.pdf b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dd94057b06b3fb9a72ad51d883066511cd036267 --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/aabd2c26-8dfd-4396-8eb9-d06d473ac769_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bef68da5c98e3e1982f45e869ada4a687732834f3a00a8ac9ce326fbefffc607 +size 1185594 diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/full.md b/learningtomatchfeatureswithseededgraphmatchingnetwork/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6cde57129c6a6a9f30dea72eadadea568ac49ee1 --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/full.md @@ -0,0 +1,386 @@ +# Learning to Match Features with Seeded Graph Matching Network + +Hongkai Chen1 Zixin Luo1 Jiahui Zhang2 Lei Zhou1 Xuyang Bai1 Zeyu Hu1 Chiew-Lan Tai1 Long Quan1 + +$^{1}$ Hong Kong University of Science and Technology $^{2}$ Tsinghua University + +{hchencf,zluoag,lzhouai,xbaiad,zhuam,taic1,quan}@cse.ust.hk jiahui-z15@mails.tsinghua.edu.cn + +# Abstract + +Matching local features across images is a fundamental problem in computer vision. Targeting towards high accuracy and efficiency, we propose Seeded Graph Matching Network, a graph neural network with sparse structure to reduce redundant connectivity and learn compact representation. The network consists of 1) Seeding Module, which initializes the matching by generating a small set of reliable matches as seeds. 2) Seeded Graph Neural Network, which utilizes seed matches to pass messages within/across images and predicts assignment costs. Three novel operations are proposed as basic elements for message passing: 1) Attentional Pooling, which aggregates keypoint features within the image to seed matches. 2) Seed Filtering, which enhances seed features and exchanges messages across images. 3) Attentional Unpooling, which propagates seed features back to original keypoints. Experiments show that our method reduces computational and memory complexity significantly compared with typical attention-based networks while competitive or higher performance is achieved. + +# 1. Introduction + +Establishing reliable correspondences across images is an essential step to recover relative camera pose and scene structure in many computer vision tasks, such as Structure-from-Motion (SfM) [37], Multiview Stereo(MVS) [17] and Simultaneous Localization and Mapping (SLAM) [31]. In classical pipelines, correspondences are obtained by nearest neighbour search $(NN)$ of local feature descriptors and are usually further pruned by heuristic tricks, such as mutual nearest neighbour check (MNN) and ratio test $(RT)$ [24]. + +In the past few years, great efforts have been made on designing learnable matching strategy. Early works [60, 43, 62] in this direction utilize PointNet [32]-like networks to reject outliers of putative correspondences. In these works, the correspondence coordinates are fed into permutation-equivariant networks, then inlier likelihood scores are predicted for each correspondence. Despite showing exciting results, these methods are limited in two aspects: 1) They + +![](images/92f41214482cc3333b86d5e42005e2ab9131b602b8808c50c2a833b172b8683b.jpg) +(a) SuperGlue +Figure 1. The designs of message passing layer. (a) SuperGlue densely connects every node in the graph, resulting in $\mathcal{O}(N^2)$ computational complexity. (b) Instead, the proposed network, SGMNet, adopts pooling/unpooling operations, reducing the complexity to $\mathcal{O}(NK)$ , where $K \ll N$ in general. + +![](images/fb5fddf0f6bf567b28311270d597a89d4060bb9c20bb4e68e709ca29754badde.jpg) +(b) SGMNet + +operate on pre-matched correspondences, whereas finding more matches than vanilla nearest-neighbour matching is impossible. 2) They only reason about the geometric distribution of putative correspondences, neglecting the critical information of original local visual descriptors. + +Another thread of methods cast feature matching as a graph matching problem [35, 5, 49], which mitigates the limit of vanilla nearest neighbour correspondences. The representative work, SuperGlue [35], constructs densely-connected graphs between image keypoints to exchange messages about both visual and geometric context. However, the superior performance comes along with high computation and memory cost, especially when being applied to keypoints of larger number (e.g. up to $10k$ ). As illustrated in Fig. 1(a), the message passing layer of SuperGlue first calculates similarity scores exhaustively between every two nodes, then gathers features to pass messages densely in the graph. This results in computational complexity of $\mathcal{O}(N^2C)$ for matrix multiplications, and memory occupation of $\mathcal{O}(N^2)$ to hold the attention matrix, supposing that the keypoint number is $N$ and feature channel is $C$ . The complexity increases even drastically for deeper graph networks. Given this, exploring more efficient and compact message passing operation is of practical significance. + +Besides the major efficiency bottleneck, it is debatable + +if such densely-connected graph introduces too much redundancy or insignificant message exchange that may hinder the representation ability, especially in the context of feature matching where the match set is highly outlier-contaminated and a large portion of keypoints are unre repeatable. As a result, most graph edges from SuperGlue [35] tend to have zero strength, as reported in its original paper and also observed in our experiments. This phenomenon indicates that even a sparse graph is largely sufficient and less distracted from unnecessary message exchanges. + +In this paper, we propose Seeded Graph Matching Network (SGMNet) to mitigate above limitations from two aspects. First, inspired by guided matching approaches [10, 42, 29], we design a Seeding Module that initializes the matching from a small set of reliable matches so as to more effectively identify inlier compatibility. Second, we draw inspiration from graph pooling operations [61, 55], and construct a Seeded Graph Neural Network whose graph structure is largely sparsified to lower the computation and reduce the redundancy. Specifically, three operations are proposed to construct our message passing blocks. As illustrated in Fig. 1(b), instead of densely attending to all features within/across images, original keypoint features are first pooled by 1) Attentional Pooling through a small set of seed nodes, of which the features will be further enhanced by 2) Seed Filtering, and finally recovered back to original keypoints through 3) Attentional Unpooling. + +By using seeds as attention bottleneck between images, the computational complexity for attention is reduced from $\mathcal{O}(N^2 C)$ to $\mathcal{O}(NK C)$ , where $K$ is the number of seeds. When $K \ll N$ , for example, $8k$ features are pooled into 512 seeds, the actual computation will be significantly cut down. We evaluate SGMNet under different tasks to demonstrate both its efficiency and effectiveness, and summarize our contributions threefold: + +- A seeding mechanism is introduced in graph matching framework to effectively identify inlier compatibility. +- A greatly sparsified graph neural network is designed that enables more efficient and clean message passing. +Competitive or higher accuracy is reported with remarkably improved efficiency over dense attentional GNN. As an example, when matching $10k$ features, SGMNet runs 7 times faster and consumes $50\%$ less GPU memory than SuperGlue. + +# 2. Related Works + +Learnable image matching. Integrating deep learning techniques into geometry-based computer vision task, such as MVS [57, 58, 63, 64] and Visual Localization [66, 45], has received inspiring success during the past few years. As the front-end component for geometry estimation, learnable image matching has also been proven effective, where + +works in this area can be roughly divided into two categories. The first one focuses on improving local descriptors [59, 40, 26, 25, 30, 48] and keypoints [52, 12, 27, 34, 11] with convolutional neural networks, while methods in the second category attempt to embed learning techniques into matching strategy, which involves learnable outlier rejection [60, 43, 62] and robust estimator [4]. + +Recently, a new framework, SuperGlue [35], is proposed to integrate feature matching and outlier rejection into a single graph neural network (GNN). Though exhibiting promising results in different tasks, SuperGlue still suffers from the excessive computational cost of fully connected self/cross attention operation, especially when used to match features in high number. + +Compared with SuperGlue, our method shares the same advantages, that is, feature matching and refinement are integrated into one single network and allows for end-to-end training. However, our network significantly reduces the computational and memory cost due to its efficient attention block, which is specially designed for image matching. + +Efficient transformer architectures. Transformer [51] architectures have gained intensive interest during the past few years. Specially, in the contexts of graph convolution, the attention mechanism in transformer can be used to pass messages across nodes in graph structure [13, 53]. Despite its effectiveness in a wide range of tasks, one major concern about transformer is its quadratic complexity w.r.t. the input size, which hinders its application under large query/key elements number. + +Recently, many efforts have been made to address the attention efficiency problem. In [23, 7] predefined sparse attention pattern are adopted to cut down memory/computation cost. In [46, 18], attention span is pruned by using learnable partitioning or grouping on input elements. In [54, 20], pooling operation is utilized to reduce elements number. Despite the inspiring progress, works in this area generally focus on self-attention, where keys and queries are derived from the same element set, while their effectiveness in cross-attention, where keys and queries come from two unaligned sets, remains unstudied. + +We draw inspiration from induced set attention (ISA) [20], where a set of learned but fixed nodes are utilized as bottleneck for efficient self attention. To be compatible with cross attention in graph matching, we establish attention between seed matches and original point sets. The selected reliable correspondences align features in both sides and pass message in a low cost way. + +Graph matching. Graph matching, which aims to generating node correspondences across graphs, is a widely used model for feature matching in both 2D [49, 5] and 3D [21, 2] domain. Mathematically formulated as a quadratic assignment problem (QAP) [50], graph matching is NP-hard in its most general form and requires infeasible expensive + +![](images/a050fadc711832430e8ed7cf2d0626fb100eb53f0389c6d679a45353f2332e2d.jpg) +Figure 2. The network architecture of SGMNet, which takes the local features as input, then generates seed matches from seeding module, and finally extracts correspondence features from Seeded GNN with multiple attentional blocks. In practice, updated features will be fed into a reseeding module and a 3-layer seeded GNN for refinement, while we omit this procedure here for simplicity. + +solver for precise solutions. Despite the intractable nature of general graph matching, some methods [14, 15, 28] leverage partially pre-matched correspondences, also called seeds, to help matching, which are referred to as Seeded Graph Matching(SGM). Inspired by SGM, our network integrate seeds into a GNN framework for compact message passing and robust matching. + +# 3. Methodology + +We present Seeded Graph Matching Network, shorten as SGMNet, for learning correspondences between two sets of keypoints and their associated visual descriptors. As illustrated in Fig. 2, our network produces matches in two stages: 1) Seeding Module generates seeds to guide compact message passing, and 2) Seeded Graph Neural Network leverages seeds as message bottleneck to update per-node feature. In the following parts, an overview of our network architecture will be introduced first, followed by detailed description of each module. + +# 3.1. Overview + +Given a pair of images $\mathbf{A}$ and $\mathbf{B}$ , with $n$ and $m$ keypoints and associated visual descriptors respectively, indexed by $\alpha := \{1, \dots, n\}, \beta := \{1, \dots, m\}$ , our objective is to establish reliable and robust keypoints matches across two images. + +We formulate the keypoint matching task as a graph matching problem, where the nodes are the keypoints of each image. Instead of apply fully connected graph, we generate a set of keypoint correspondences, which we refer to as seed matches, to guide message pass across nodes in two graphs for subsequent matching. This critical difference allows for processing large number of keypoints with significantly lower memory and computation cost. + +The input to our network are keypoints $\mathbf{K}_{\mathbf{A}}$ , $\mathbf{K}_{\mathbf{B}}$ in two images, $\mathbf{K}_{\mathbf{I}}^{i} = (\mathbf{p}_{\mathbf{I}}^{i}, \mathbf{d}_{\mathbf{I}}^{i})$ , where $\mathbf{I} \in \{\mathbf{A}, \mathbf{B}\}$ and $\mathbf{p}_{\mathbf{I}}^{i} = (x_{\mathbf{I}}^{i}, y_{\mathbf{I}}^{i})$ is the coordinate of keypoint $i$ in image $\mathbf{I}$ . + +$\mathbf{d}_{\mathbf{I}}^{i}\in \mathbb{R}^{d}$ is associated $^d$ dimensional visual descriptor. + +Positions of keypoints are embedded into high dimensional feature space and combined with descriptors by element-wise summation for initial representation ${}^0\mathbf{F}_{\mathbf{A}}$ ${}^0\mathbf{F}_{\mathbf{B}}$ + +$$ +{ } ^ { 0 } \mathbf { F } _ { \mathbf { I } } ^ { i } = \mathbf { d } _ { \mathbf { I } } ^ { i } + \operatorname { M L P } ( \mathbf { p } _ { \mathbf { I } } ^ { i } ) , \mathbf { I } \in \{ \mathbf { A } , \mathbf { B } \} , \tag {1} +$$ + +A Seeding Module follows to construct a set of seed matches $\mathbf{S}$ . ${}^0\mathbf{F}_{\mathbf{A}}$ , ${}^0\mathbf{F}_{\mathbf{B}}$ and $\mathbf{S}$ are then fed into our Seeded Graph Neural Network which reasons about visual appearance similarity, neighbourhood consensus as well as the guidance provided by seed matches jointly to update keypoint features. + +Inspired by the cascade refinement structure in OANet [62], a second seeding module, or reseeding module, is introduced to generate more accurate seeds based on the updated features, which helps to further refine matches with another Seeded GNN. Final matches are then generated by formulating assignment matrix. + +# 3.2. Seeding Module + +Proposing a set of seed matches lays the foundation for subsequent matching. For initial seeding, we adopt a simple yet effective strategy: we generate putative matches by nearest neighbour matching and use the inverse of distance ratio, i.e., the ratio of distance to first and second nearest neighbours [24], as reliability scores. We adopt Non-Maximum Suppression (NMS) for a better spatial coverage of seeds. More details of seeding module can be found in Appendix A.2. Despite potential noise in initial seeds, our network maintains robustness with proposed weighted unpooling operation and reseeding strategy, which will be discussed later. + +The seeding module outputs $\mathbf{S} = (\mathbf{S}_{\mathbf{A}},\mathbf{S}_{\mathbf{B}})$ , where $\mathbf{S}_{\mathbf{A}}$ , $\mathbf{S}_{\mathbf{B}}$ are index lists for seed matches in each image. + +# 3.3. Seeded Graph Neural Network (Seeded GNN) + +Seeded GNN takes initial position-embedded features ${}^{0}\mathbf{F}_{\mathbf{A}}$ , ${}^{0}\mathbf{F}_{\mathbf{B}}$ and leverages seed matches $\mathbf{S}$ as attention bottlenecks for message passing. To this end, we adopt a pooling-processing-unpooling strategy in each processing unit: seed features first gather information from full point sets on each side through Attentional Pooling, then processed by Seed Filtering operation and finally be recovered back to original size by Attentional Unpooling. Our Seeded GNN is constructed by stacking 6(3) such processing units for initial(refinement) stages. + +Weighted attentional aggregation. We first introduce a weighted version of attentional aggregation, which allows for sharper and cleaner data-dependent message passing. + +In a $d$ -dimensional feature space, for $m$ vectors to be updated: $\mathbf{X} \in \mathbb{R}^{m \times d}$ , $n$ vectors to be attended to: $\mathbf{Y} \in \mathbb{R}^{n \times d}$ and a weight vector: $\mathbf{w} \in \mathbb{R}^n$ , the weighted attentional aggregation $\mathbf{Att}$ is defined as, + +$$ +\mathbf {X} ^ {\mathrm {r}} = \mathbf {A t t} (\mathbf {X}, \mathbf {Y}, \mathbf {w}) = \mathbf {X} + \operatorname {M L P} (\mathbf {X} | | \boldsymbol {\Delta}), \tag {2} +$$ + +where + +$$ +\Delta = \theta (\mathbf {Q} \mathbf {K} ^ {T}) \mathbf {W} \mathbf {V}, \mathbf {W} = D i a g (\mathbf {w}), \mathbf {W} \in \mathbb {R} ^ {n \times n} \tag {3} +$$ + +$\theta (\cdot)$ means row-wise softmax. $\mathbf{Q}$ is linear projection of $\mathbf{X}$ and $\mathbf{K},\mathbf{V}$ are linear projections of $\mathbf{Y}$ . $\mathbf{X}^{\mathrm{r}}$ is renewed representation for $\mathbf{X}$ . + +By attentional aggregation, elements in $\mathbf{X}$ retrieve and aggregate information from elements in $\mathbf{Y}$ . A weighting vector $\mathbf{w}$ is applied on $\mathbf{V}$ to adjust the importance for each element in $\mathbf{Y}$ . + +Attentional pooling. As the first step in message passing, seed matches retrieves contexts from full keypoint set through attentional aggregation, + +For input features ${}^t\mathbf{F}_{\mathbf{A}}$ , ${}^t\mathbf{F}_{\mathbf{B}}$ in layer $t$ , features for seed matches are first retrieved by indices $(\mathbf{S}_{\mathbf{A}},\mathbf{S}_{\mathbf{B}})$ + +$$ +{ } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 1 } = { } ^ { t } \mathbf { F } _ { \mathbf { I } } [ \mathbf { S } _ { \mathbf { I } } ] , \mathbf { I } \in \{ \mathbf { A } , \mathbf { B } \} , \tag {4} +$$ + +where $[ ]$ is the indexing operation. Seed matches are then updated by retrieving context from nodes in each graph + +$$ +{ } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 2 } = \mathbf { A } \mathbf { t } \mathbf { t } ( { } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 1 } , { } ^ { t } \mathbf { F } _ { \mathbf { I } } , \mathbf { 1 } ) , \mathbf { I } \in \{ \mathbf { A } , \mathbf { B } \} , \tag {5} +$$ + +where $\mathbf{1}$ is all one vector, which means no weights are applied. + +A multilayer perceptron follows to fuse the seed features, + +$$ +\left[ ^ {t} \mathbf {S} _ {\mathbf {A}} ^ {3} \right| \left| ^ {t} \mathbf {S} _ {\mathbf {B}} ^ {3} \right] = \operatorname {M L P} \left(^ {t} \mathbf {S} _ {\mathbf {A}} ^ {2} \right| \left| ^ {t} \mathbf {S} _ {\mathbf {B}} ^ {2}\right) \tag {6} +$$ + +where $||$ means concatenation along row dimension. + +![](images/4880994a68042358890524795d43313b13d550bc4e14e9316aa6e82d7d7ad6c4.jpg) +Figure 3. Visualization of attentional pooling/unpooling. In attentional pooling, one pair of seed match aggregates context from the other keypoints, while in attentional unpooling each original keypoint retrieves renewed message from seed matches. + +The outputs ${}^t\mathbf{S}_{\mathbf{A}}^3, {}^t\mathbf{S}_{\mathbf{B}}^3$ , which encode both visual and position context for each graph and information from seed matches themselves, are fed into subsequent operations. + +Seed filtering. We propose seed filtering operation to (1) conduct intra/inter-graph communication between seed matches and (2) suppress the influence of outlier seed matches. More specifically, intra/inter-graph attentional aggregation is applied to the input seed correspondence features ${}^t\mathbf{S}_{\mathbf{I}}^3 \in \mathbb{R}^{k\times d}$ , $\mathbf{I} \in \{\mathbf{A},\mathbf{B}\}$ . + +$$ +{ } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 4 } = \mathbf { A } \mathbf { t } \mathbf { t } ( { } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 3 } , { } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 3 } , \mathbf { 1 } ) , \tag {7} +$$ + +$$ +{ } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 5 } = \mathbf { A } \mathbf { t } \mathbf { t } ( { } ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 4 } , { } ^ { t } \mathbf { S } _ { \mathbf { J } } ^ { 4 } , \mathbf { 1 } ) , \mathbf { I } , \mathbf { J } \in \{ \mathbf { A } , \mathbf { B } \} , \mathbf { I } \neq \mathbf { J } , \tag {8} +$$ + +In addition, a context normalization [60] branch is used to predict inlier likelihood scores $\gamma$ for each seed correspondence, which will be used as weighting score for seed features in later unpooling stage. + +$$ +{ } ^ { t } \gamma = \mathrm { C N } ( { } ^ { t } \mathbf { S } _ { \mathbf { A } } ^ { 5 } | | { } ^ { t } \mathbf { S } _ { \mathbf { B } } ^ { 5 } ) , ( 9 ) +$$ + +where CN is a lightweight stacked context normalization [60] blocks. Detailed structures of CN brach can be found in Appendix A.2. + +The outputs of seed filtering are the filtered features ${}^t\mathbf{S}_{\mathbf{A}}^5$ , ${}^t\mathbf{S}_{\mathbf{B}}^5$ and inlier scores $\gamma \in [0,1]^k$ of seed matches. + +Attentional unpooling. After the message exchange between seed matches and inlier score prediction, an inlierscore-weighted attentional aggregation is adopted to broadcast the pooled contexts to every keypoint in each graph, which we refer to as attentional unpooling. + +Taking ${}^t\mathbf{S}_{\mathbf{A}}^5, {}^t\mathbf{S}_{\mathbf{B}}^5$ , inlier score $\gamma$ and ${}^t\mathbf{F}_{\mathbf{A}}, {}^t\mathbf{F}_{\mathbf{B}}$ as input, attentional unpooling outputs the updated keypoint features ${}^{t+1}\mathbf{F}_{\mathbf{A}}, {}^{t+1}\mathbf{F}_{\mathbf{B}}$ . + +$$ +{ } ^ { t + 1 } \mathbf { F } _ { \mathbf { I } } = \mathbf { A } \mathbf { t t } ( ^ { t } \mathbf { F } _ { \mathbf { I } } , ^ { t } \mathbf { S } _ { \mathbf { I } } ^ { 5 } , ^ { t } \gamma ) , \mathbf { I } \in \{ \mathbf { A } , \mathbf { B } \} \tag {10} +$$ + +Applying inlier score to the aggregation process suppresses information broadcast from false seed matches and results in cleaner feature update, which contributes to the robustness of our network w.r.t. seeding noise (Appendix D.2, Appendix Fig 10). + +Assignment matrix formulation. After all processing units, the updated features are used to construct the assignment matrix. Sinkhorn [8] algorithm is applied on the correlation matrix of features with a dustbin channel to produce final assignment matrix $\mathbf{M}$ . + +Given the keypoint features $^N\mathbf{F_A}\in \mathbb{R}^{n\times d},^N\mathbf{F_B}\in$ $\mathbb{R}^{m\times d}$ after $N$ processing blocks, we compute the assignment matrix by + +$$ +\mathbf {M} = \operatorname {S i n k h o r n} (\hat {\mathbf {C}}) \tag {11} +$$ + +$$ +\hat {C} _ {i, j} = \left\{ \begin{array}{l} C _ {i, j}, \text {f o r} i \leqslant n, j \leqslant m \\ z, \text {o t h e r w i s e} \end{array} , \hat {\mathbf {C}} \in \mathbb {R} ^ {(n + 1) \times (m + 1)} \right. \tag {12} +$$ + +where $\mathbf{C} = {}^{N}\mathbf{F}_{\mathbf{A}}{}^{N}\mathbf{F}_{\mathbf{B}}\mathbf{T}$ , $z$ is a learnable parameter for dustbin. We derive final matches from the assignment matrix $\mathbf{M}$ with a confidence threshold to remove outliers. + +# 3.4. Reseeding + +Although Seeded GNN based on initial seeding exhibits strong capability to identify underlying matches, a second seeding module using updated feature provides even cleaner and richer seeds to further improve the performance. Thus, we adopt a reseeding module. Different from initial seeding where NN matches and ratio scores of raw descriptors are used, reseeding module employs assignment matrix $\mathbf{M}$ of updated features to regenerate seeds. More specifically, matches with highest score in both rows and columns are selected as candidates, where top-k matches are selected as new seeds and are fed into a second Seeded GNN for refinement. More details can be found in Appendix A.2. + +# 3.5. Loss + +Seeding module only outputs seed indices that requires no gradient back-propagation, thus our network is fully differentiable and can be trained end-to-end with supervision from indices of ground truth matches $\mathbf{l}_{\mathbf{m}} = \{(i,j)\} \in \alpha \times \beta$ and unmatched points $\mathbf{l}_{\mathbf{uA}},\mathbf{l}_{\mathbf{uB}}$ , where a point is regarded as unmatched if there are no matchable points in the other image. From assignment matrix $\mathbf{M}_r$ for reseeding, final assignment matrix $\mathbf{M}_f$ , and inlier scores $^t\gamma ,t\in \{1,2,\dots,L\}$ for $L$ processing units, we formulate our loss as two parts, + +$$ +L = L _ {\text {a s s i g n}} + \delta \Sigma_ {t \in \{1, 2, \dots , L \}} L _ {\text {w e i g h t}} ^ {t} \tag {13} +$$ + +where + +$$ +\begin{array}{l} L _ {\text {a s s i g n}} = - \sum_ {\mathbf {M} \in \left\{\mathbf {M} _ {r}, \mathbf {M} _ {f} \right\}} [ \sum_ {(i, j) \in \mathbf {l} _ {\mathbf {m}}} \log (M _ {i, j}) + \\ \sum_ {i \in \mathbf {l} _ {\mathbf {u A}}} \log \left(M _ {i, m + 1}\right) + \sum_ {j \in \mathbf {l} _ {\mathbf {u B}}} \log \left(M _ {n + 1, j}\right) ] \tag {14} \\ \end{array} +$$ + +$L_{weight}^{t}$ is cross entropy loss for inlier/outlier binary classification in $t$ -th processing unit, a seed correspondence is labeled as inlier if its epipolar distance is less than a threshold. $\delta$ is a weight to balance the two loss terms. + +# 3.6. Implementation Details + +We train our network on GL3D dataset [38], which covers both indoor/outdoor scenes, to obtain general purpose model. We sample $1k$ keypoints and 128 seeds during training. We use Adam optimizer with learning rate of $10^{-4}$ in optimization and inlier score weight $\delta$ in loss is set to 250. We use 6/3 processing blocks for initial/refine stage and the gradients flow between the two stages are blocked in early iterations(140k iterations). We use 4-head attention in both attentional pooling/unpooling operations. For all experiments, we use a confidence threshold of 0.2 to retain matches and seeding number of $\frac{128\# \text { keypoint }}{2000}$ , where $\# \text { keypoint }$ is the number of keypoints. More details including training data generation and hyper-parameters can be found in Appendix A. + +# 4. Experiments + +In the following sessions, we provide experiments results of our methods under a wide range of tasks, as well as further analysis of its computation and memory efficiency. + +# 4.1. Image Matching + +Datasets. The performance of our method is first evaluated on image matching tasks and three benchmarks in two-view pose estimation, YFCC100M [47], FM-Bench [3] and ScanNet [9] dataset, are used for demonstration. + +For YFCC100M [47], we follow the setting in OANet [62] and choose 4 sequences for testing. FM-Bench [3] comprises four subsets in different scenarios: KITTI [16] for driving settings, TUM [41] for indoor SLAM settings, Tanks and Temples (T&T) [19] and CPC [56] for wide-baseline reconstruction tasks. ScanNet [9] is a widely used indoor reconstruction dataset. Following SuperGlue [35], we use 1500 pairs in test set for evaluation. + +Evaluation protocols. On YFCC100M and ScanNet dataset, pose estimation is performed on the correspondences after RANSAC post-processing. We report 1) AUC [35, 62, 60] under different thresholds, computed from + +
FeatureMatcherCPCT&TTUMKITTI
%Recall#Corrs(-m)%Recall#Corrs(-m)%Recall#Corrs(-m)%Recall#Corrs(-m)
RootSIFT [1]NN+RT52.992 (123)82.1208 (287)61.9365 (438)90.6847 (928)
OANet [62]58.6119 (167)84.7219 (306)62.3454 (396)89.0773 (854)
SuperGlue [35]61.1218 (466)86.8382 (767)65.9655 (1037)91.01261 (1746)
SGMNet62.0248 (524)85.9397 (789)66.6704 (1132)91.21097 (1506)
ContextDesc [25]NN+RT62.4169 (277)85.5222 (426)58.7456 (625)90.61134 (1416)
OANet65.3187 (288)86.7294 (425)53.2295 (327)89.0791 (907)
SuperGlue67.0260 (579)89.1491 (695)60.1408(690)91.11401 (1897)
SGMNet70.8370 (616)89.9514 (705)61.6423 (705)90.31204 (1724)
SuperPoint [11]MNN34.5152 (421)72.8287 (717)56.7280 (420)88.6848 (1490)
OANet62.9186 (343)91.2280 (477)61.4332 (473)82.2482 (736)
SuperGlue68.8287 (719)92.9414 (987)59.1512 (1038)88.7957 (1777)
SuperGlue*76.7302(712)96.6431(985)59.0121(177)89.5354(526)
SGMNet70.3327 (829)93.2450 (1098)65.8666 (1315)86.3954(1851)
+ +Table 1. Evaluation results on FM-Bench [3], where %Recall denotes mean recall of all pairs, #Corrs(-m) denotes mean number of inlier correspondences after/before RANSAC. SuperGlue* indicates the results obtained from officially released model. + +the angular differences between ground truth and estimated vectors for both rotation and translation; 2) Mean matching score (M.S.) [35, 11], the ratio of correct matches and total keypoint number; 3) Mean precision (Prec.) [35, 11] of the generated matches. We detect up to $2k$ keypoints for all features on YFCC100M, up to $1k$ keypoints for superpoint on ScanNet and up to $2k$ keypoints for other features. + +On FM-Bench dataset, we estimate fundamental matrix for each evaluated pair with RANSAC post-processing, and use the normalized symmetric epipolar distance (SGD) [65, 3] as originally defined in FM-Bench paper, to measure the difference between the estimated fundamental matrix and the ground truth. An estimate is considered correct if its normalized SGD to ground truth is lower than a threshold (0.05 is used by default), and up to $4k$ keypoints are detected for each test pair. Following FM-Bench paper [3], we report: 1) recall (%Recall) on fundamental matrix estimation; 2) mean number of correct correspondences (#Corrs(-m)) after/before RANSAC. + +Comparative methods. We compare our method with heuristic pruning strategy, ratio test [24] or MNN, and a various of learning-based matching methods [62, 35, 44, 10, 60, 39]. These methods are applied on both handcrafted descriptors [24, 1] and learning-based local features [25, 11]. + +For a fair comparison, OANet, SuperGlue and SGMNet are all re-trained using the same sequences of GL3D [38], where 1k keypoints are sampled per image. Noted that the official training code of SuperGlue is not available, and its public model (denoted as SuperGlue*) is trained on MegaDepth [22] and Oxford and Paris dataset [33]. Instead, we retrain SuperGlue on GL3D [38] with similar data selection criteria described in original paper. This re-implementation achieves even better results on YFCC100M (Table 3) for RootSIFT than those reported in the original paper. However, there still remains some performance gap when using SuperPoint [11], even though we have carefully tuned the training and enquired the authors about details. Nevertheless, we consider our re-implementation + +
FeatureMatcherAUCM.S.Prec.
@5°@10°@20°
RootSIFTNN + RT [24]49.0758.7668.588.2329.79
AdaLAM(4k) [6]57.7868.0177.387.9283.15
OANet [62]58.0067.8077.465.8481.80
SuperGlue* [35]59.2570.3880.44--
SuperGlue63.8273.3382.2616.5981.08
SGMNet62.7272.5281.4817.0886.08
ContextDescNN + RT57.9068.4778.359.3959.72
AdaLAM(4k) [6]60.7570.9180.239.1285.45
OANet62.2872.5681.809.3388.49
SuperGlue65.9875.1783.6420.3882.95
SGMNet66.6376.2184.3320.5787.34
SuperPointMNN31.0540.8552.6415.1224.64
AdaLAM(2k) [6]40.2049.0359.1110.1772.57
OANet48.8059.0670.0212.4871.95
SuperGlue*67.1076.1884.3721.5888.64
SuperGlue60.3770.5180.0019.4778.74
SGMNet61.2271.0280.4522.3685.44
SIFTPointCN [60]47.9858.1368.67--
ACNe [44]--78.00--
LGLFM [10]49.6060.3671.37--
-RANSAC-Flow [39]64.8873.3181.56--
+ +Table 2. Results on YFCC100M [47], where AUC evaluates the pose accuracy, $M.S.$ denotes mean matching score and Prec. denotes mean matching precision. SuperGlue* indicates the results obtained from original paper or officially released model. + +
FeatureMatcherAUCM.S.Prec.
@5°@10°@20°
RootSIFTNN + RT [24]9.0819.7532.662.2828.83
AdaLAM [6]8.2418.5731.013.1047.59
OANet [62]10.7123.1037.423.2036.93
SuperGlue13.1227.9943.928.5042.53
SGMNet12.8227.9244.558.7945.55
ContextDescNN + RT11.0723.5237.665.2928.71
AdaLAM8.4519.8133.116.5844.08
OANet11.9524.4940.565.1240.43
SuperGlue15.7031.6748.2210.7542.83
SGMNet15.4631.5548.649.9948.14
SuperPointMNN9.4421.5736.4113.2730.17
AdaLAM6.7215.8227.3713.1944.22
OANet10.0425.0938.0110.5644.61
SuperGlue13.9529.4846.0715.8244.18
SuperGlue*16.1933.8251.8618.5047.32
SGMNet15.4032.0648.3216.9748.01
+ +Table 3. Results on Scannet [9]. SuperGlue* indicates the results obtained from officially released model. + +of SuperGlue [35] faithful and thus can be fairly compared. We report results of both official model and our re + +![](images/931736a845a1bba42faecec52548cf0d9edb96aad4fbf0a66a2a71871db78ae0.jpg) +Figure 4. Correspondence visualizations. We showcase with SIFT features, and compare the results of traditional matching $(MNN + RT)$ , SuperGlue and our method (SGMNet). More visualizations available in Appendix. + +implementation. + +Results. For YFCC100M, ScanNet and two wide-baseline datasets of FM-Bench (CPC and T&T), our method mostly shows competitive results compared with the state-of-the-arts. For two small-baseline datasets in FM-Bench (TUM and KITTI), the advantages of all learnable methods tend to degenerate due to the reduced matching difficulty. Our method matches most inlier correspondences on almost all dataset regarding M.S. on YFCC100M/ScanNet and Corrs(-m) on FM-Bench while maintaining a high matching precision, which contributes to the final pose accuracy. Though not specially trained in indoor scenarios, our method generalizes well on indoor setting. + +# 4.2. Visual Localization + +To evaluate how our method benefits real downstream applications, we integrate it in a visual localization pipeline and evaluate its performance. + +Datasets. We resort to Aachen Day-Night dataset [36] to evaluate the effectiveness of our method on visual localization task. Aachen Day-Night consists of 4328 reference images and 922 (824 daytime, 98 nighttime) query images. All images are taken in urban scenes. + +Evaluation protocols. We use the official pipeline of Aachen Day-Night benchmark. Correspondences between reference images are first used to triangulate a 3D reconstruction. Correspondences between each query and its retrieved reference images are then generated to recover the relative pose. Consistent with the official benchmark, we report the pose estimation accuracy under different thresholds. We extract $8k$ keypoints for RootSIFT, ContextDesc and $4k$ keypoints for SuperPoint. + +Results. Compared with SuperGlue, our method exhibits better results when using RootSIFT and competitive re + +
FeatureMatcher0.25m, 2°0.5m, 5°5m, 10°
RootSIFT [1]MNN43.956.165.3
OANet [62]69.483.794.9
SuperGlue [35]63.380.698.0
SGMNet70.485.798.0
ContextDesc [25]MNN65.380.690.8
OANet74.586.799.0
SuperGlue77.686.799.0
SGMNet75.587.899.0
SuperPoint [11]MNN71.478.687.8
OANet77.686.798.0
SuperGlue*79.690.8100.0
SuperGlue76.588.899.0
SGMNet77.688.899.0
+ +Table 4. Evaluation results on Aachen Day-Night dataset. We report pose accuracy under different thresholds for challenging night spilt. We include the results of official released model of SuperGlue with SuperPoint (denoted as SuperGlue*). + +![](images/9df1c66f6caa35100f9cc06d296b9a9fe14863e84f256d17e83c8a063dd6fb5b.jpg) +Figure 5. The computation (a) and memory (b) efficiency compared the proposed method with SuperGlue. We report memory occupation averaged by batch size for training. The effect of keypoint number on Aachen Day-Night dataset is illustrated in (c). + +sults when using SuperPoint or ContextDesc. Our method consistently outperforms OANet using all three descriptors. The overall performance proves the generalization ability of our method on real challenging applications. + +# 4.3. Scalability + +In above experiments, the proposed method has shown competitive results against the state-of-the-arts. In this ses + +
MatcherAUC@20°M.S.Prec.
NN + RT68.5810.0556.38
SGMNet w Rand. Seed71.2512.9455.57
SGMNet w/o W.U.78.6417.0781.26
SGMNet w/o A.P.79.3517.1182.15
SGMNet w/o Reseeding80.4117.1284.47
SGMNet full81.4817.0886.08
+ +Table 5. Results of ablation study. w/o A.P. stands for w/o attentional pooling, where seed features are directly sent to seed filtering process without attending to original keypoints. w/o W.U. stands for w/o weighted unpooling, where vanilla attention are preformed in unpooling process. Rand. Seed means selecting seed correspondences randomly instead of picking the top-k scores. w/o Reseeding means only use initial seeding. + +sion, we demonstrate the major advantage of our method in time/memory efficiency compared with SuperGlue, a closely related method based on GNN. + +Time/memory consumption. As shown in Fig. 5(a), the time cost of our method is remarkably lower than SuperGlue. Specifically, we report both run time with and without Sinkhorn iterations on a GTX 1080 GPU, in order to more precisely demonstrate the substantial improvements on GNN design itself. It is noteworthy that on $10k$ keypoints and without Sinkhorn iterations, the proposed method reduces the runtime by one magnitude. Besides, due to the reduction of redundancy, SGMNet also delivers better convergence during training (see Appendix C). + +As shown in Fig. 5(b), during test phase, our method consumes half of memory than SuperGlue when keypoint number is larger than $2k$ , where the major memory peak of our method is seeding phase and sinkhorn iterations. The advantage becomes even more significant during training. With a batch size of 16 and keypoint number of $1k$ , SuperGlue occupies up to 23GB GPU memory for training while SGMNet only consumes less than 9GB memory. + +Performance gain when using more keypoints. Within a reasonable range, larger keypoints number generally improves performance of downstream tasks, thus a manageable matching cost is of practical significance to extend the applicability. As a showcase, we vary the keypoints number of RootSIFT when evaluating on Aachen Day-Night Dataset. As can be seen from Fig. 5(c), the accuracy of SGMNet and SuperGlue increases as more keypoints are used. Considering the efficiency advantage of our method, SGMNet delivers better trade-off when increasing the keypoints number. We also provide an experiment of SfM, a typical keypoints-consuming application in Appendix D.3. + +# 5. Discussions + +# 5.1. Ablation Study + +To evaluate the effectiveness of different components of our method, we conduct ablation study on YFCC100M + +
TypeMatcherAUCTime(ms)
@5°@10°@20°
GNNSGMNet-1066.6276.3384.71114.81
SGMNet67.4276.6384.66284.66
SuperGlue-1065.8575.3584.05458.52
SuperGlue66.6575.4184.12604.11
FilterOANet63.7573.6082.4321.30
ACNe63.3773.6782.7418.26
HandcraftedAdaLAM57.7868.0177.384.59
GMS26.1533.5342.135.44
+ +Table 6. Results on YFCC100M using 4k SIFT features. -10 means setting sinkhorn iterations as 10 instead of 100 + +dataset using RootSIFT. As shown in Table 5, all different component in our network contributes to the final performance notably. In particular, seeding reliable matches plays an important role, which further proves that seed matches is able to guide message across images for robust matching. + +# 5.2. Comparison with Filter-based Methods + +For a well-around comparison, we provide in Table 6 more experiment results with filter-based methods (outlier rejection). When using 4k keypoints, SGMNet achieves best performance among all comparative methods while runs 4 times faster than SuperGlue when setting sinkhorn iterations as 10. Despite the fast inference speed of SOTA filter-based methods, a considerable performance gap still remains compared with GNN based methods. + +# 5.3. Designs of SGMNet + +We experiment on other designs for SGMNet, including other seeding strategy and pooling operations in GNN/Transformer architecture [51, 54, 61], e.g. diff-Pool [62, 61] and set transformer [20]. We find 1) learnable seeding achieves limited improvement over our simple heuristic seeding strategy 2) other general pooling operations, which are often verified on self-attention in GNN/Transformer architecture, are not effective alternatives of our seed-based pooling. Details of our experiments can be found in Appendix B. Hyper-parameter study on seeding number can be found in Appendix D. + +# 6. Conclusion + +In this paper, we propose SGMNet, a novel graph neural network for efficient image matching. The new operations we have developed enable message passing with a compact attention pattern. Experiments on different tasks and datasets prove that our method improves the accuracy of feature matching and downstream tasks to competitive or higher level against the state-of-the-arts with a modest computation/memory cost. + +Acknowledgment. This work is supported by Hong Kong RGC GRF 16206819, 16203518, T22-603/15N and Guangzhou Okay Information Technology with the project GZETDZ18EG05. + +# References + +[1] Relja Arandjelović and Andrew Zisserman. Three things everyone should know to improve object retrieval. In CVPR, 2012. 6, 7 +[2] Xuyang Bai, Zixin Luo, Lei Zhou, Hongkai Chen, Lei Li, Zeyu Hu, Hongbo Fu, and Chiew-Lan Tai. Pointdsc: Robust point cloud registration using deep spatial consistency. In CVPR, 2021. 2 +[3] Jia-Wang Bian, Yu-Huan Wu, Ji Zhao, Yun Liu, Le Zhang, Ming-Ming Cheng, and Ian Reid. An evaluation of feature matchers for fundamental matrix estimation. In BMVC, 2019. 5, 6 +[4] Eric Brachmann and Carsten Rother. Neural-guided ransac: Learning where to sample model hypotheses. In ICCV, 2019. 2 +[5] T. S. Caetano, J. J. McAuley, L. Cheng, Q. V. Le, and A. J. Smola. Learning graph matching. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2009. 1, 2 +[6] Luca Cavalli, Viktor Larsson, Martin Ralf Oswald, Torsten Sattler, and Marc Pollefeys. Handcrafted outlier detection revisited. In ECCV, 2020. 6 +[7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. In arXiv, 2019. 2 +[8] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NeurIPS, 2013. 5 +[9] Angela Dai, Matthias Nießner, Michael Zolloffer, Shahram Izadi, and Christian Theobalt. Bundlefusion: Real-time globally consistent 3d reconstruction using on-the-fly surface re-integration. ACM Transactions on Graphics 2017 (TOG), 2017. 5, 6 +[10] François Darmon, Mathieu Aubry, and Pascal Monasse. Learning to guide local feature matches. 2020. 2, 6 +[11] D. DeTone, T. Malisiewicz, and A. Rabinovich. Superpoint: Self-supervised interest point detection and description. In CVPRW, 2018. 2, 6, 7 +[12] Mihai Dusmanu, Ignacio Rocco, Tomas Pajdla, Marc Pollefeys, Josef Sivic, Akihiko Torii, and Torsten Sattler. D2-net: A trainable cnn for joint description and detection of local features. In CVPR, 2019. 2 +[13] Matthias Fey, Jan E. Lenssen, Christopher Morris, Jonathan Masci, and Nils M. Kriege. Deep graph matching consensus. In ICLR, 2020. 2 +[14] Donniell E. Fishkind, Sancar Adali, Heather G. Patsolic, Lingyao Meng, Digvijay Singh, Vince Lyzinski, and Carey E. Priebe. Seeded graph matching. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. 3 +[15] Catherine FRAIKIN and Paul Van Dooren. Graph matching with type constraints on nodes and edges. Dagstuhl Seminar Proceedings, 2007. 3 +[16] A. Geiger, P. Lenz, and R. Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, 2012. 5 +[17] M. Goesele, B. Curless, and S.M. Seitz. Multi-view stereo revisited. In CVPR, 2006. 1 +[18] Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In ICLR, 2020. 2 + +[19] Arno Knapitsch, Jaesik Park, Qian-Yi Zhou, and Vladlen Koltun. Tanks and temples: benchmarking large-scale scene reconstruction. ACM Transactions on Graphics, 2017. 5 +[20] Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In ICML, 2019. 2, 8 +[21] M. Leordeanu and M. Hebert. A spectral technique for correspondence problems using pairwise constraints. In ICCV, 2005. 2 +[22] Zhengqi Li and Noah Snavely. Megadepth: Learning single-view depth prediction from internet photos. In CVPR, 2018. 6 +[23] Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. In ICLR, 2018. 2 +[24] David G Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 2004. 1, 3, 6 +[25] Zixin Luo, Tianwei Shen, Lei Zhou, Jiahui Zhang, Yao Yao, Shiwei Li, Tian Fang, and Long Quan. Contextdesc: Local descriptor augmentation with cross-modality context. In CVPR, 2019. 2, 6, 7 +[26] Zixin Luo, Tianwei Shen, Lei Zhou, Siyu Zhu, Runze Zhang, Yao Yao, Tian Fang, and Long Quan. Geodesc: Learning local descriptors by integrating geometry constraints. In ECCV, 2018. 2 +[27] Zixin Luo, Lei Zhou, Xuyang Bai, Hongkai Chen, Jiahui Zhang, Yao Yao, Shiwei Li, Tian Fang, and Long Quan. Aslfeat: Learning local features of accurate shape and localization. In CVPR, 2020. 2 +[28] Vince Lyzinski, Daniel L. Sussman, Donniell E. Fishkind, Henry Pao, Li Chen, Joshua T. Vogelstein, Youngser Park, and Carey E. Priebe. Spectral clustering for divide-and-conquer graph matching. Parallel Computing, 2015. 3 +[29] Josef Maier, Martin Humenberger, Markus Murschitz, Oliver Zendel, and Markus Vincze. Guided matching based on statistical optical flow for fast and robust correspondence analysis. In ECCV, 2016. 2 +[30] Anastasiia Mishchuk, Dmytro Mishkin, Filip Radenovic, and Jiri Matas. Working hard to know your neighbor's margins: Local descriptor learning loss. In NeurIPS, 2017. 2 +[31] R. Mur-Artal, J. M. M. Montiel, and J. D. Tardós. Orb-slam: A versatile and accurate monocular slam system. IEEE Transactions on Robotics, 2015. 1 +[32] Charles R. Qi, Hao Su, Kaichun Mo, and Leonidas J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017. 1 +[33] Filip Radenović, Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Revisiting oxford and paris: Large-scale image retrieval benchmarking. In CVPR, 2018. 6 +[34] Jerome Revaud, Philippe Weinzaepfel, César De Souza, Noe Pion, Gabriela Csurka, Yohann Cabon, and Martin Humenberger. R2d2: Repeatable and reliable detector and descriptor. In NeurIPs, 2019. 2 + +[35] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In CVPR, 2020. 1, 2, 5, 6, 7 +[36] Torsten Sattler, Will Maddern, Carl Toft, Akihiko Torii, Lars Hammarstrand, Erik Stenborg, Daniel Safari, Masatoshi Okutomi, Marc Pollefeys, Josef Sivic, Fredrik Kahl, and Tomas Pajdla. Benchmarking 6 dof outdoor visual localization in changing conditions. In CVPR, 2018. 7 +[37] Johannes L. Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In CVPR, 2016. 1 +[38] Tianwei Shen, Zixin Luo, Lei Zhou, Runze Zhang, Siyu Zhu, Tian Fang, and Long Quan. Matchable image retrieval by learning from surface reconstruction. In ACCV, 2018. 5, 6 +[39] Xi Shen, François Darmon, Alexei A Efros, and Mathieu Aubry. Ransac-flow: generic two-stage image alignment. ECCV, 2020. 6 +[40] Edgar Simo-Serra, Eduard Trulls, Luis Ferraz, Iasonas Kokkinos, Pascal Fua, and Francesc Moreno-Noguer. Discriminative Learning of Deep Convolutional Feature Point Descriptors. In ICCV, 2015. 2 +[41] J. Sturm, N. Engelhard, F. Endres, W. Burgard, and D. Cremers. A benchmark for the evaluation of rgb-d slam systems. In IROS, 2012. 5 +[42] K. Sun, W. Tao, and Y. Qian. Guide to match: Multi-layer feature matching with a hybrid gaussian mixture model. IEEE Transactions on Multimedia, 2020. 2 +[43] Weiwei Sun, Wei Jiang, Eduard Trulls, Andrea Tagliasacchi, and Kwang Moo Yi. Acne: Attentive context normalization for robust permutation-equivariant learning. In CVPR, 2020. 1, 2 +[44] Weiwei Sun, Wei Jiang, Eduard Trulls, Andrea Tagliasacchi, and Kwang Moo Yi. Acne: Attentive context normalization for robust permutation-equivariant learning. In CVPR, 2020. 6 +[45] Shitao Tang, Chengzhou Tang, Rui Huang, Siyu Zhu, and Ping Tan. Learning camera localization via dense scene matching. In CVPR, 2021. 2 +[46] Yi Tay, Dara Bahri, Liu Yang, Donald Metzler, and Da-Cheng Juan. Sparse sinkhorn attention. In ICML, 2020. 2 +[47] Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. Yfcc100m: The new data in multimedia research. Communications of the ACM, 2016. 5, 6 +[48] Yurun Tian, Bin Fan, and Fuchao Wu. L2-net: Deep learning of discriminative patch descriptor in euclidean space. In CVPR, 2017. 2 +[49] Lorenzo Torresani, Vladimir Kolmogorov, and Carsten Rother. Feature correspondence via graph matching: Models and global optimization. In ECCV, 2008. 1, 2 +[50] S. Umeyama. An eigendecomposition approach to weighted graph matching problems. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1988. 2 +[51] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS. 2017. 2, 8 + +[52] Yannick Verdie, Kwang Moo Yi, Pascal Fua, and Vincent Lepetit. Tilde: A temporally invariant learned detector. In CVPR, 2015. 2 +[53] Runzhong Wang, Junchi Yan, and Xiaokang Yang. Learning combinatorial embedding networks for deep graph matching. In ICCV, 2019. 2 +[54] Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. In arXiv, 2020. 2, 8 +[55] Z. Wang and S. Ji. Second-order pooling for graph neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 2 +[56] Kyle Wilson and Noah Snavely. Robust global translations with 1dsfm. In ECCV, 2014. 5 +[57] Yao Yao, Zixin Luo, Shiwei Li, Tian Fang, and Long Quan. Mvsnet: Depth inference for unstructured multi-view stereo. In ECCV, 2018. 2 +[58] Yao Yao, Zixin Luo, Shiwei Li, Tianwei Shen, Tian Fang, and Long Quan. Recurrent mvsnet for high-resolution multiview stereo depth inference. In CVPR, 2019. 2 +[59] Kwang Moo Yi, Eduard Trulls, Vincent Lepetit, and Pascal Fua. Lift: Learned invariant feature transform. In ECCV, 2016. 2 +[60] Kwang Moo Yi, Eduard Trulls, Yuki Ono, Vincent Lepetit, Mathieu Salzmann, and Pascal Fua. Learning to find good correspondences. In CVPR, 2018. 1, 2, 4, 5, 6 +[61] Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In NeurIPs, 2018. 2, 8 +[62] Jiahui Zhang, Dawei Sun, Zixin Luo, Anbang Yao, Lei Zhou, Tianwei Shen, Yurong Chen, Long Quan, and Hongen Liao. Learning two-view correspondences and geometry using order-aware network. In ICCV, 2019. 1, 2, 3, 5, 6, 7, 8 +[63] Jingyang Zhang, Yao Yao, Shiwei Li, Zixin Luo, and Tian Fang. Visibility-aware multi-view stereo network. In BMVC, 2020. 2 +[64] Jingyang Zhang, Yao Yao, Zixin Luo, Shiwei Li, Tianwei Shen, Tian Fang, and Long Quan. Learning stereo matchability in disparity regression networks. In ICPR, 2020. 2 +[65] Zhengyou Zhang. Determining the epipolar geometry and its uncertainty: A review. IJCV, 1998. 6 +[66] Lei Zhou, Zixin Luo, Tianwei Shen, Jiahui Zhang, Mingmin Zhen, Yao Yao, Tian Fang, and Long Quan. Kfnet: Learning temporal camera relocalization using kalman filtering. In CVPR, 2020. 2 \ No newline at end of file diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/images.zip b/learningtomatchfeatureswithseededgraphmatchingnetwork/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1cd96d10e37f355164350bf187c8c41092908f4a --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2978075c1e68e657918b5f5be7cb208bedb4a5b8a5d99e82eb62c41b57d78410 +size 752118 diff --git a/learningtomatchfeatureswithseededgraphmatchingnetwork/layout.json b/learningtomatchfeatureswithseededgraphmatchingnetwork/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c3c4cfe58ec2043486b72ca182ac340c8262118a --- /dev/null +++ b/learningtomatchfeatureswithseededgraphmatchingnetwork/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb86527ab1b151116a7a92c6919d45379339b785ff1ca9269e1ea30126d75f74 +size 447431 diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_content_list.json b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..30c8d64ef1b8cdb7ebb42ccddd7a34dbf722c94d --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0734113c314479abb66a77a768a09d812a6fccd4ff0b662e325c9e9b0efbd11d +size 76701 diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_model.json b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_model.json new file mode 100644 index 0000000000000000000000000000000000000000..35f890bbde396b78f7551a718775737aaf4f5b32 --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:deaa664d439ea36558aaa28fff56bc6997111147a004ba5269700b7bb2ab257f +size 94496 diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_origin.pdf b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0a4b979e0eae8ff86df42a2dda8d2d6d8c4c6033 --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/eb1f2f13-391c-411e-9182-6ae645fbcb10_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:885c30315ce67e5c6b7872fb9662350a96fbb48f036181e24f99db8e4d33a333 +size 3365278 diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/full.md b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0c030ddfc82156cb9a779c6ac9b96f8a72713e44 --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/full.md @@ -0,0 +1,345 @@ +# Learning to Reduce Defocus Blur by Realistically Modeling Dual-Pixel Data + +Abdullah Abuolaim $^{1*}$ + +Mauricio Delbracio² + +Damien Kelly + +Peyman Milanfar2 + +$^{1}$ York University + +Michael S. Brown1 + +# Abstract + +Recent work has shown impressive results on data-driven defocus deblurring using the two-image views available on modern dual-pixel (DP) sensors. One significant challenge in this line of research is access to DP data. Despite many cameras having DP sensors, only a limited number provide access to the low-level DP sensor images. In addition, capturing training data for defocus deblurring involves a time-consuming and tedious setup requiring the camera's aperture to be adjusted. Some cameras with DP sensors (e.g., smartphones) do not have adjustable apertures, further limiting the ability to produce the necessary training data. We address the data capture bottleneck by proposing a procedure to generate realistic DP data synthetically. Our synthesis approach mimics the optical image formation found on DP sensors and can be applied to virtual scenes rendered with standard computer software. Leveraging these realistic synthetic DP images, we introduce a recurrent convolutional network (RCN) architecture that improves deblurring results and is suitable for use with single-frame and multi-frame data (e.g., video) captured by DP sensors. Finally, we show that our synthetic DP data is useful for training DNN models targeting video deblurring applications where access to DP data remains challenging. + +# 1. Introduction and related work + +Defocus blur occurs in scene regions captured outside the camera's depth of field (DoF). Although the effect can be intentional (e.g., the bokeh effect in portrait photos), in many cases defocus blur is undesired as it impacts image quality due to the loss of sharpness of image detail (e.g., Fig. 1, second row). Recovering defocused image details is challenging due to the spatially varying nature of the defocus point spread function (PSF) [25, 41], which not only is scene depth dependent, but also varies based on the camera aperture, focal length, focus distance, radial dis + +# Cameras + +# Input + +Dual-pixel images with defocus blur (Only a single DP view is shown) + +![](images/6313ca7713c9dcaeec3ecd210a1996ead4c9c8151c4aba2956f717a11c204061.jpg) +Pixel smartphone + +![](images/df74a7f9db495a51f6b031d5d1c1159e7fab88f9dfbefaf3301796bf67783fb0.jpg) +Canon DSLR + +![](images/4ec4957b0512b63ee5b3b04faf2794281b3eca2f491c5b54c5d4364a62622d1f.jpg) +DNN trained with Canon data only + +![](images/9a206f10e834d5e4e289d4a92a86d69bf41554d16645f4a168a1caeea55b4684.jpg) +Deblurred results [1] + +![](images/52f05c462ad682538a9d79623553efe1b16772fdb37e80c7c5660fc138cab1e3.jpg) + +Our results + +
EncoderRCNDecoder
·
EncoderRCNDecoder
+ +Our RCN trained with our synthetic data + +![](images/7bb7a09c92abf844c075aa95ebc324b6cc4d556266a5dfe6f909db5631859003.jpg) +Figure 1. Deblurring results on images from a Pixel 4 smartphone and a Canon 5D Mark IV. Third row: results of the DNN proposed in [1] trained with DP data from the Canon camera. Last row: results from our proposed network trained on synthetically generated data only. + +![](images/9afea9b4e7a9dbf0fb46446e50f36e820951528655ea23744b0a363571362e76.jpg) + +tortion, and optical aberrations. Most existing deblurring methods [6, 20, 23, 31, 38] approach the defocus deblurring problem by first estimating a defocus image map. The defocus map is then used with an off-the-shelf non-blind deconvolution method (e.g., [7, 22]). This strategy to defocus deblurring is greatly limited by the accuracy of the estimated defocus map. + +Recently, work in [1] was the first to propose an interesting approach to the defocus deblurring problem by leveraging information available on dual-pixel (DP) sensors found on most modern cameras. The DP sensor was originally designed to facilitate auto-focusing [2, 3, 19]; however, researchers have found DP sensors to be useful in broader applications, including depth map estimation [10, 30, 34, 47], defocus deblurring [4, 43, 24, 30], reflection removal [35], and synthetic DoF [44]. DP sensors consist of two photo + +![](images/72f872c17a882b1e54714e8464b5e3d269e15c43ecd3f706561dd1881a9e27b2.jpg) +Figure 2. Thin lens model illustration and dual-pixel image formation. The circle of confusion (CoC) size is calculated for a given scene point using its distance from the lens, camera focal length, and aperture size. On the two dual-pixel views, the half-CoC PSF flips if the scene point is in front or back of the focal plane. + +![](images/28919178b67121e92b43851862650a7d089154c972470ad0318f74d731f0ba0d.jpg) + +diodes at each pixel location effectively providing the functionality of a simple two-sample light-field camera (Fig. 2, DP sensor). Light rays coming from scene points within the camera's DoF will have no difference in phase, whereas light rays from scene points outside the camera's DoF will have a relative shift that is directly correlated to the amount of defocus blur. Recognizing this, the work in [1] proposed a deep neural network (DNN) framework to recover a deblurred image from a DP image pair using ground-truth data captured from a Canon DSLR. + +Although the work of [1] demonstrates state-of-the-art deblurring results, it is restricted by the requirement for accurate ground truth data, which requires DP images to be captured in succession at different apertures. As well as being labor intensive, the process requires careful control to minimize the exposure and motion differences between captures (e.g., see local misalignment in Fig. 3). Another significant drawback is that data capture is limited to a single commercial camera, the Canon 5D Mark IV, the only device that currently provides access to raw DP data and has a controllable aperture. + +While datasets exist for defocus estimation, including CUHK [37], DUT [48], and SYNDOF [23], as well as lightfield datasets for defocus deblurring [6] and depth estimation [14, 40], none provide DP image views. The work of [1] is currently the only source of ground truth DP data suitable for defocus deblur applications but is limited to a single device. This lack of data is a severe limitation to continued research on data-driven DP-based defocus deblurring, in particular to applications where the collection of ground truth data is not possible (e.g., fixed aperture smartphones). + +Contributions. This work aims to overcome the challenges in gathering ground-truth DP data for data-driven defocus deblurring. In particular, we propose a generalized model of the DP image acquisition process that allows realistic generation of synthetic DP data using standard computer graphics-generated imagery. We demonstrate that we can achieve state-of-the-art defocus deblurring results using synthetic data only (see Fig. 1), as well as complement real-image data sets through data augmentation. To demonstrate the generality of the model, we explore a new application domain of video defocus deblurring using DP data + +![](images/668c6cec7a68e18c337b3202888fc2abd9496fee08606e3e49db84527e1e2977.jpg) +Image patch $\mathbf{P}_1$ + +![](images/2a92b1c8194ed202bf6eff34159f6908d6a5a7d158d2689d29dcaf21c459bade.jpg) +Image patch $\mathbf{P}_2$ +Figure 3. Misalignment in the Canon DP dataset [1] due to the physical capture procedure. Patches $\mathbf{P}_1$ and $\mathbf{P}_2$ are cropped from in-focus regions from two captures: the first using a wide-aperture (w/ defocus blur) and the second capture using a narrow-aperture (w/o defocus blur). The 2nd capture is intended to serve as the ground truth for this image pair. The third column shows the 2D cross correlation between the patches $\mathcal{X}_{\mathrm{2D}}(\mathbf{P}_1,\mathbf{P}_2)$ , which reveals the local misalignment that occurs in such data capture. + +![](images/a6d6b405f1cab3db41fea5e93d282ed827c05e5b502ee699c7a8a9f81a0d6f04.jpg) +$\chi_{2D}(\mathbf{P}_1,\mathbf{P}_2)$ + +and propose a recurrent convolutional network (RCN) architecture that scales from single-image deblurring to video deblurring applications. Additionally, our proposed RCN addresses the issue of patch-wise training by incorporating radial distance learning and improves the deblurring results with a novel multi-scale edge loss. Our comprehensive experiments demonstrate the power of our synthetic DP data generation procedure and show that we can achieve the state-of-the-art results quantitatively and qualitatively with a novel network design trained with this data. + +# 2. Modeling defocus blur in dual-pixel sensors + +Synthetically generating realistic blur has been shown to improve data-driven approaches to both defocus map [23] and depth map estimation [29]. We follow a similar approach in this work but tackle the problem of generating realistic defocus blur targeting DP image sensors. For this, we comprehensively model the complete DP image acquisition process with spatially varying PSFs, radial lens distortion, and image noise. Fig. 4 shows an overview of our DP data generator that enables the generation of realistic DP views from an all-in-focus image and corresponding depth map. + +# 2.1. Thin lens model + +We model our virtual camera optics using a thin lens model that assumes negligible lens thickness, helping to simplify optical ray tracing calculations [32]. Through + +![](images/49cb8b2936e136f8ad6e51dd82d44cb0d817aef09bbcfd58dbca2af086d26488.jpg) +Figure 4. An overview of our framework used to synthetically generate dual-pixel (DP) views. Our approach starts with computer-generated (CG) imagery produced with a standard computer graphics package. Starting from this data, we model scene defocus, PSFs related to the DP sensor image formation, and additional artifacts, including radial distortion and sensor noise. + +![](images/77ca390f3f4c2eab875c29188bcb868905a427a3113c92578ed459b5ebb4e348.jpg) +Figure 5. Front and back focus DP PSFs. The similarity between two PSFs is measured by the 2D cross correlation. Left: Measured DP PSFs from the Canon 5D Mark IV DSLR. Middle: DP PSFs as modeled by [34]. Right: Our newly proposed model for DP PSFs based on a modified 2D Butterworth filter. Our modeling achieves higher correlation with the real-world measured PSFs. + +![](images/85e47e58c946ede93516befe55110666698618395bcc6b4bc4f167455cf10a54.jpg) + +this model, we can approximate the circle of confusion (CoC) that represents the PSF for a given point based on its distance from the lens and camera parameters (i.e., focal length, aperture size, and focus distance). This model is illustrated in Fig. 2, where $f$ is the focal length, $s$ is the focus distance, and $F$ is the f-stop. The distance between the lens and sensor $s'$ , and the aperture diameter $q$ are defined as $s' = \frac{fs}{s - f}$ and $q = \frac{f}{F}$ . Then, the CoC radius $r$ of a scene point $P_1$ located at distance $d$ from the camera is: + +$$ +r = \frac {q}{2} \times \frac {s ^ {\prime}}{s} \times \frac {d - s}{d}. \tag {1} +$$ + +# 2.2. Dual-pixel PSFs + +Recent work in [34] introduced a model for approximating a PSF that occurs in the left and right views of a DP sensor using a nice symmetry property between the left and right PSFs. However, the model involved a single free parameter only that was directly correlated to the CoC size (Fig. 5, middle column). Though the model is able to capture the symmetry property observed in a real DP PSF, the overall PSF did not sufficiently reflect the true structure exhibited by real-world PSFs, as illustrated in Fig. 5's left column. Real DP PSFs exhibit a donut-shaped depletion in the CoC that is attributed to optical aberrations [41]. + +To provide more realistic PSFs for the DP views, we introduce a parametric model based on the 2D Butterworth filter $\mathbf{B}$ , defined as follows: + +$$ +\mathbf {B} (x, y) = \left(1 + \left(\frac {D _ {o}}{\sqrt {\left(x - x _ {o}\right) ^ {2} + \left(y - y _ {o}\right) ^ {2}}}\right) ^ {2 n}\right) ^ {- 1}, \tag {2} +$$ + +where $n$ is the filter order, and $D_{o}$ is a parameter controlling the 3dB cutoff position. Aiming to capture the donut-shaped structure of the PSF, we define a parametric PSF model based on the Butterworth filter $\mathbf{B}$ as follows: + +$$ +\mathbf {H} = \mathbf {B} \circ \mathbf {C} \left(x _ {o}, y _ {o}\right), \tag {3} +$$ + +where $\mathbf{C}$ represents a circular disk with radius $r$ matching the CoC radius as calculated in Eq. 1. The notation $\circ$ denotes the Hadamard product. Both $\mathbf{B}$ and $\mathbf{C}$ are centered at $(x_o, y_o)$ . $D_o$ is a function of the radius $r$ and is controlled by the parameter $\alpha$ . The values of $\mathbf{B}$ are re-scaled to $[\beta, 1]$ , where the parameter $\beta > 0$ is introduced to control the minimum depletion at the kernel's center (which is always positive based on our observation of PSFs measured from real-world data). With our proposed model, the parameterized PSF $\mathbf{H}$ has a sharp fall-off about the circumference. Therefore, we smooth $\mathbf{H}$ by convolving it with a Gaussian kernel of standard deviation $\kappa \times r$ , where $0 < \kappa << 1$ . + +Our modeling of $\mathbf{H}$ represents the combined DP PSF, which is formed as $\mathbf{H} = \mathbf{H}_l + \mathbf{H}_r$ , where $\mathbf{H}_l$ and $\mathbf{H}_r$ are the left and right DP PSFs, respectively. Similar to the work in [34], we enforce the constraint of horizontal symmetry between $\mathbf{H}_l$ and $\mathbf{H}_r$ , and express $\mathbf{H}_r$ as $\mathbf{H}_l^f$ , where $\mathbf{H}_l^f$ represents the left PSF flipped about the vertical axis. $\mathbf{H}_l$ can be shown as $\mathbf{H}$ with a gradual fall-off towards the right direction (see front-focus DP left in Fig. 5). Mathematically, we denote $\mathbf{H}_l$ as: + +$$ +\mathbf {H} _ {l} = \mathbf {H} \circ \mathbf {M}, \quad \text {s . t .} \quad \mathbf {H} _ {l} \geq \mathbf {0}, \text {w i t h} \sum \mathbf {H} _ {l} = \frac {1}{2}, \tag {4} +$$ + +where $\mathbf{M}$ is a 2D ramp mask with a constant decay. This + +decay can be considered as an intensity fall-off (intensity/pixel) in a given direction. The direction is determined by the sign of the CoC radius calculated based on the thin lens model. The positive sign represents the front focus (i.e., blurring of objects behind the focal plane), whereas the negative sign represents the back focus (i.e., blurring of objects in front of the focal plane). Our PSF model, parameterized with five parameters, facilitates synthesizing PSF shapes more similar to what we measured in real cameras under different scenarios (see Fig. 5, right column). From this model, we can generate a bank of representative PSFs based on actual observations from real cameras. Additional details about the calibration procedure, PSF estimation method, and parameter searching are provided in the supplemental material. + +# 2.3. Modeling additional camera artifacts + +Radial lens distortion. Radial lens distortion occurs due to lens curvature imperfections causing straight lines in the real world to map to circular arcs in the image plane. This is a well-studied topic with many methods for modelling and correcting the radial distortion (e.g., [5, 8, 13, 33]). In our framework, we consider applying radial distortion to the synthetically generated images to mimic this effect found in real cameras. We adopt the widely used division model introduced in [8], as follows: + +$$ +(x _ {d}, y _ {d}) = (x _ {o}, y _ {o}) + \frac {(x _ {u} - x _ {o} , y _ {u} - y _ {o})}{1 + c _ {1} R ^ {2} + c _ {2} R ^ {4} + \cdots}, \qquad (5) +$$ + +where $(x_{u},y_{u})$ and $(x_{d},y_{d})$ are the undistorted and distorted points respectively, and $c_{i}$ is the $i^{\mathrm{th}}$ radial distortion coefficient. $R$ is the radial distance from the image plane center $(x_o,y_o)$ . This model enables different types of radial distortion, including barrel and pincushion. We generate representative radial distortion sets at different focal lengths found on cameras. A detailed description of this procedure is provided in the supplemental material. + +Noise. Image noise is the undesirable occurrence of random variations in intensity or color information in images. Our initial input is CG-generated data that is noise-free. In order to synthesize realistic images, we add signal-dependent noise as the last step. We model the noise using a signal-dependent Gaussian distribution where the variance of noise is proportional to image intensity [9, 26]. Let $\mathbf{I}$ be the noiseless image and $\mathbf{N}$ a zero-mean Gaussian noise layer; then our modeling of the signal-dependent Gaussian noise is $\mathbf{I}_{\mathrm{noise}} = \mathbf{I} + \mathbf{I} \circ \mathbf{N}$ , where $\mathbf{N} \sim \mathcal{N}(\mathbf{0}, \sigma^2 \mathrm{Id})$ , and $\sigma$ controls the noise strength. + +# 3. Generating dual-pixel views + +In this section we introduce the synthetic dataset used, followed by a description of the procedure to synthetically + +generate the DP left and right views. The source of our synthetic example data comes from the street view SYNTHIA dataset [16], which contains image sequences of photorealistic GC-rendered images from a virtual city. Each sequence has 400 frames on average. The dataset contains a large diversity in scene setups, involving many objects, cities, seasons, weather conditions, day/night time, and so forth. The SYNTHIA dataset also includes the depth-buffer and labelled segmentation maps. In our framework, we use the depth map to apply synthetic defocus blur in the process of generating the DP views. + +To blur an image based on the computed CoC radius $r$ , we first decompose the image into discrete layers according to per-pixel depth values, where the maximum number of layers is set to 500. Then, we convolve each layer with our parameterized PSF, blurring both the image and mask of the depth layer. Next, we alpha-blend the blurred layer images in order of back-to-front, using the blurred masks as alpha values. For each all-in-focus video frame $\mathbf{I}_s$ , we generate two images – namely, the left $\mathbf{I}_l$ and right $\mathbf{I}_r$ sub-aperture DP views – as follows (for simplicity, let $\mathbf{I}_s$ be a patch with all pixels from the same depth layer): + +$$ +\mathbf {I} _ {l} = \mathbf {I} _ {s} * \mathbf {H} _ {l}, \quad \mathbf {I} _ {r} = \mathbf {I} _ {s} * \mathbf {H} _ {r}, \tag {6} +$$ + +where $*$ denotes the convolution operation. Afterwards, the radial distortion is applied on $\mathbf{I}_l$ , $\mathbf{I}_r$ , and $\mathbf{I}_s$ based on the camera's focal length. Finally, we add signal-dependent noise layers (i.e., $\mathbf{N}_l$ and $\mathbf{N}_r$ ) for the two DP views that have the same $\sigma$ , but are drawn independently. The final output defocus blurred image $\mathbf{I}_b$ is equal to $\mathbf{I}_l + \mathbf{I}_r$ . + +Our synthetically generated DP views exhibit a similar focus disparity to what we find in real data, where the infocus regions show no disparity and the out-of-focus regions have defocus disparity. + +# 4. Defocus deblurring image sequences + +With the ability to generate synthetic DP data, we can shift our attention to training new RCN-based architectures addressing image sequences (e.g., video) captured with DP sensors. This is possible only by using our synthetic DP data, as no current device allows video DP data capture. As we will show, our method can be used for both image sequences and single-image inputs. In the context of image sequences, the amount of defocus blur changes based on the motion of the camera and scene's objects over time. In the presence of such motion, sample depth variation over a sequence of frames provides useful information for deblurring. Our work is the first to explore the domain of defocus deblurring on image sequences (e.g., video). + +We adopt a data-driven approach for correcting defocus blur. We leverage a symmetric encoder-decoder CNN-based architecture with skip connections between corresponding feature maps [28, 36]. Skip connections are + +![](images/8835082ec046f0e3a84d09db420a66a956ceeeac1f07a2f84d0c304dbc99104f.jpg) +Figure 6. Our recurrent dual-pixel deblurring (RDPD) architecture. Our model takes a blurred image sequence, where each image at time $t$ is fed as left $\mathbf{I}_l(t)$ and right $\mathbf{I}_r(t)$ DP views. The DP views are encoded at the encoder part to feed the convLSTM that outputs the hidden state $\mathcal{H}_t$ and memory cell $\mathcal{C}_t$ to the next time point. The convLSTM unit also outputs a feature map $o_t$ that is processed through the decoder part to give the deblurred sharp image $\mathbf{I}_d(t)$ . Note: the number of output filters is shown under each convolution operation. + +widely used in encoder-decoder CNNs and have been found to be effective for image deblurring tasks [1, 11]. Our proposed network is also coupled with convLSTM units [42, 45, 46] to better learn temporal dependencies between multiple frames and to allow variable sequence size. With convLSTM units, the same network remains fully convolutional and can successfully deblur a single image or a sequence of images of arbitrary number. Fig. 6 shows a detailed overview of our proposed CNN-convLSTM architecture, which we refer to as recurrent dual-pixel deblurring (RDPD). + +Our architecture is similar to the one in [1], but with the following modifications: (1) convLSTM units are added to the network bottleneck, (2) we train the network using the radial distance patch to address the patch-wise training issue, (3) we introduce a multi-scale edge loss function that helps in recovering sharp edges, (4) the number of nodes are reduced to half at each block to make the model lighter, and (5) the last layer is replaced by a linear layer with a $[0,1]$ clamping as it is found to be more effective in [11]. + +RDPD architecture. Given an input video of $j$ consecutive frames that have defocus blur $\{\{\mathbf{I}_l(t),\mathbf{I}_r(t)\} ,\dots ,\{\mathbf{I}_l(t + j),\mathbf{I}_r(t + j)\} \}$ (such that $\mathbf{I}_l(t)$ and $\mathbf{I}_r(t)$ are the DP views of the given frame at time $t$ ), we first obtain a sequence of compact convolutional features $\{X(t),\dots ,X(t + j)\}$ encoded at the CNN bottleneck - namely, $X(t) = \mathrm{CNN - Encoder}(\mathbf{I}_l(t),\mathbf{I}_r(t))$ . Then, the features are fed to a convLSTM as shown in Fig. 6. We utilize the convLSTM to learn of the temporal dynamics of the sequential inputs. This is achieved by incorporating memory units with the gated operations. The convLSTM also preserves spatial information by replacing dot products with convolutional operations, which is essential for making spatially variant estimation align with the spatially varying DP PSFs. We choose LSTM over RNN because standard RNNs are known to have difficulty in learning long-time dependencies [17], whereas LSTMs have shown the capability to learn long- and short-time dependencies [18]. + +For the input feature $X(t)$ at time $t$ , our convLSTM leverages three convolution gates - input $i_t$ , output $o_t$ , and + +forget $\mathcal{F}_t$ - in order to control the signal flow within the cell. The convLSTM outputs a hidden state $\mathcal{H}_t$ and maintains a memory cell $\mathcal{C}_t$ for controlling the state update and output: + +$$ +i _ {t} = \Sigma \left(W _ {i} ^ {X} * X _ {t} + W _ {i} ^ {\mathcal {H}} * \mathcal {H} _ {t - 1} + W _ {i} ^ {\mathcal {C}} \circ \mathcal {C} _ {t - 1} + b _ {i}\right), \tag {7} +$$ + +$$ +\mathcal {F} _ {t} = \Sigma \left(W _ {\mathcal {F}} ^ {X} * X _ {t} + W _ {\mathcal {F}} ^ {\mathcal {H}} * \mathcal {H} _ {t - 1} + W _ {\mathcal {F}} ^ {\mathcal {C}} \circ \mathcal {C} _ {t - 1} + b _ {\mathcal {F}}\right), (8) +$$ + +$$ +o _ {t} = \Sigma \left(W _ {o} ^ {X} * X _ {t} + W _ {o} ^ {\mathcal {H}} * \mathcal {H} _ {t - 1} + W _ {o} ^ {\mathcal {C}} \circ \mathcal {C} _ {t - 1} + b _ {o}\right), \tag {9} +$$ + +$$ +\mathcal {C} _ {t} = \mathcal {F} _ {t} \circ \mathcal {C} _ {t - 1} + i _ {t} \circ \tau \left(W _ {\mathcal {C}} ^ {X} * X _ {t} + W _ {\mathcal {C}} ^ {\mathcal {H}} * \mathcal {H} _ {t - 1} + b _ {\mathcal {C}}\right), \tag {10} +$$ + +$$ +\mathcal {H} _ {t} = o _ {t} \circ \tau (\mathcal {C} _ {t}), \tag {11} +$$ + +where the $W$ terms denote the different weight matrices, and the $b$ terms represent the different bias vectors. $\Sigma$ and $\tau$ are the activation functions of logistic sigmoid and hyperbolic tangent, respectively. Afterwords, the output deblurred image $\mathbf{I}_d$ is obtained by decoding $o_t$ through the decoder part of our encoder-decoder CNN as follows: + +$$ +\mathbf {I} _ {d} (t) = \operatorname {C N N - D e c o d e r} \left(o _ {t}\right). \tag {12} +$$ + +Radial distance patch. Radial distortion and lens aberration make the PSFs vary in radial directions away from the image center. Similar to [1, 31], we perform patch-wise training to avoid the redundancies of full image training and ensure that the input has enough variance. However, this approach breaks the spatial correlation between the image patches as they are fed independently with no knowledge of their location on the image plane. As a result, in addition to the six-channel RGB DP views, we include a single-channel patch that represents the relative radial distance. + +Multi-scale edge loss. In addition to the MSE loss, we introduce a multi-scale edge loss using a Sobel gradient to guide the network to encourage sharper edges. Our new loss is similar in principle to the single-scale (i.e., $3 \times 3$ ) Sobel loss used in [27], but we modified this loss in two ways: first, we added multiple scales of the Sobel operator (i.e., kernel sizes) in order to capture different edge sizes. Second, we minimized for the horizontal and vertical directions separately, to concentrate more on the direction that is perpendicular to the imaging sensor orientation. For our + +Table 1. Results on the Canon DP dataset from [1]. DPDNet is the pre-trained model on Canon data provided by [1]. DPDNet+ and our RDPD+ are trained with Canon and our synthetically generated DP data. Bold numbers are the best and highlighted in green. The second-best performing results are highlighted in yellow. The testing set consists of 37 indoor and 39 outdoor scenes. + +
MethodIndoorOutdoorIndoor & OutdoorTime ↓
PSNR ↑SSIM ↑MAE ↓PSNR ↑SSIM ↑MAE ↓PSNR ↑SSIM ↑MAE ↓NIQE ↓
EBDB [20]25.770.7720.04021.250.5990.05823.450.6830.0495.42929.7
DMENet [23]25.700.7890.03621.510.6550.06123.550.7200.0494.85613.7
JNB [38]26.730.8280.03121.100.6080.06423.840.7150.0485.11843.1
DPDNet [1]27.480.8490.02922.900.7260.05225.130.7860.0413.770.5
DPDNet+ [1]27.650.8520.02822.720.7190.05425.120.7840.0423.730.5
Our RDPD+28.100.8430.02722.820.7040.05325.390.7720.0403.190.3
+ +multi-scale modified edge loss, the vertical $G^{x}$ and horizontal $G^{y}$ derivative approximations of the deblurred output $\mathrm{I}_d$ and its ground truth $\mathrm{I}_s$ are: + +$$ +G _ {d} ^ {x} = \mathrm {I} _ {d} * S _ {m \times m} ^ {x}, \quad G _ {d} ^ {y} = \mathrm {I} _ {d} * S _ {m \times m} ^ {y}, \tag {13} +$$ + +$$ +G _ {s} ^ {x} = \mathrm {I} _ {s} * S _ {m \times m} ^ {x}, \quad G _ {s} ^ {y} = \mathrm {I} _ {s} * S _ {m \times m} ^ {y}, \tag {14} +$$ + +where $S_{m \times m}^{x}$ and $S_{m \times m}^{y}$ are the vertical and horizontal Sobel operators of size $m$ , respectively. The derivative operations are performed at multiple filter sizes. Our new edge loss $\mathcal{L}_{\mathrm{edge}}$ is the mean of multiple scales for each direction $x / y$ and denoted as: + +$$ +\mathcal {L} _ {\text {e d g e}} ^ {\{x, y \}} = \mathbb {E} [ \mathrm {M S E} \left(G _ {s} ^ {\{x, y \}}, G _ {d} ^ {\{x, y \}}\right) ]. \tag {15} +$$ + +Then the final loss function $\mathcal{L}$ is: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {M S E}} + \lambda_ {x} \mathcal {L} _ {\text {e d g e}} ^ {x} + \lambda_ {y} \mathcal {L} _ {\text {e d g e}} ^ {y}, \tag {16} +$$ + +such that $\mathcal{L}_{\mathrm{MSE}}$ is the typical MSE loss between the output estimated $\mathrm{I}_d$ and its ground truth $\mathrm{I}_s$ . The $\lambda$ terms are added to control our final loss. + +# 5. Experiments + +We evaluate our proposed RDPD and other existing defocus deblurring methods: the DP deblurring network (DPDNet) [1], the edge-based defocus blur (EBDB) [20], the defocus map estimation network (DMENet) [23], and the just noticeable blur (JNB) [38] estimation. DPDNet [1] is the only method that utilizes DP data for deblurring, and the others [20, 23, 38] use only a single image as input (i.e., $\mathrm{I}_l$ ) and estimate the defocus map in order to feed it to an off-the-shelf deconvolution method (i.e., [7, 22]). EBDB [20] and JNB [38] are not learning-based methods; thus, we can test them directly. For the learning-based DMENet method, we cannot retrain it with the Canon data [1], as it does not provide the ground truth defocus map. However, with our data generator we are able to generate defocus maps, which allows us to retrain DMENet with our synthetically generated data. + +Settings to generate DP data. For our DP data generator, we define five camera parameter sets - namely, + +$\{4,5,6\} ,\{5,8,6\} ,\{7,5,8\} ,\{10,13,12\} ,\{22,10,30\}$ + +- such that each set represents focal length, aperture size, and focus distance. Given the depth range found in the SYNTHIA dataset [16], these camera sets cover a wide range of front- as well as back-focus CoC sizes. For each image sequence in the SYNTHIA dataset, we generate five sequences based on the predefined camera sets. The radial distortion coefficients are set accordingly for each camera set. For the DP PSFs, we generate many representative PSF shapes by varying the parameters in the given ranges $n \in \{3, 6, 9\}$ , $\alpha \in \{0.4, 0.6, 0.8, 1\}$ , $\beta \in \{0.1, 0.2, 0.3, 0.4\}$ , and $\kappa = 0.14$ . Image noise layer strength is chosen randomly, where $\sigma \in \{5e^{-2}, 5.5e^{-2}, \dots, 5e^{-1}\}$ . These parameters are set empirically to model real camera hardware. More detail is provided in the supplemental material. + +We divide the SYNTHIA dataset [16] into training and testing sequences. We generate five sets of blurred images for each image sequence. In total, we synthesize 2023 training and 201 testing blurred DP views. Though our synthetic DP data generator enables an unlimited number of images to be generated, we found this number of images sufficient for training. In addition to our synthetically generated DP data, we use the DP ground truth data from [1] with 300 training, 74 validation, and 76 testing pairs of blurred images (with DP views) and corresponding sharp images. + +RDPD settings and training procedure. We set the size of the convLSTM to 512 units. For patch-wise training, we fix the size of input and output layers to $512 \times 512 \times 7$ and $512 \times 512 \times 3$ , respectively. We initialize the weights of the convolutional layers using He's initialization [15] and use the Adam optimizer [21] to train the model. The initial learning rate is $5 \times 10^{-5}$ , which is decreased by half every 40 epochs. + +For domain generalization from synthetic to real data [12, 39], we train our model iteratively using minibatches of real (i.e., single image) as well as synthetic data (i.e., image sequence), where the patches are randomly cropped at each iteration. This type of iterative image/image sequence training becomes feasible since our recurrent model RDPD allows training and testing with any + +![](images/2098c58046c30028cf1c762f1bf8a30a26f3b69e93501d280f268b80e8399d32.jpg) +Figure 7. Qualitative results. DPDNet [1] is trained on Canon DP data. RDPD is our method trained on synthetically generated DP data only. DPDNet+ and RDPD+ are trained on both Canon and synthetic DP data. In general, RDPD and RDPD+ are able to recover more image details. Interestingly, RDPD trained on synthetic data generalizes well to real data from the two tested cameras. Note that there is no ground truth sharp image for Pixel 4, due to the fact smartphones have fixed aperture and thus a narrow-aperture image cannot be captured to serve as a ground truth image. Additionally, we note that the DP data currently available from the Pixel smartphones are not full-frame, but are limited to only one of the green channels in the raw-Bayer frame. + +number of frames, and it does not need to be preset beforehand. We set the mini-batch size for the real data iteration to eight batches, because the dataset of real data has only single-image examples (i.e., no image sequences). For the synthetic data iteration, we set the mini-batch size to two sequences each of size four frames. We define three scales for our edge loss – namely, $m \in \{3, 7, 11\}$ . The $\lambda$ terms are found to be effective at $\lambda_x = 0.03$ and $\lambda_y = 0.02$ . + +To avoid overfitting, the dropout layer in the convLSTM is set to 0.4. Our model converges after 140 epochs. Although we train on image patches, our RDPD (with convLSTM) is fully convolutional and enables testing on full-resolution inputs. To demonstrate the effectiveness of each component in our model, an ablation study of different training settings is provided in the supplemental material. + +Single image results. We evaluate our proposed RDPD against existing defocus deblurring methods for single-image inputs. For methods that utilize DP views for the input image (i.e., RDPD and DPDNet [1]), we introduce variations on the training data used for more comprehensive evaluations. The variations are RDPD+ and DPDNet+ that are trained on both Canon DP data from [1] combined with synthetic DP data generated by the process described in Sec. 2. The RDPD without the + sign is our baseline trained with synthetically generated DP data only. The DPDNet + +without the $+$ is trained on Canon data only. + +In Table 1, we report quantitative results on real Canon DP data from [1] using standard metrics – namely, MAE, PSNR, SSIM, and time. We also report the Naturalness Image Quality (NIQE) metric of the output deblurred images with respect to a reference model derived from the DP GT images. In general, our RDPD+ has the best overall PSNR compared to other methods. Particularly, RDPD+ achieves the best PSNR and MAE for both indoor and combined categories, and all with our lighter-weight network that enabled the fastest inference time. + +For the Outdoor dataset, the PSNR of RDPD+ is slightly lower (i.e., 0.08dB) due to the fact that the Outdoor dataset is imperfect as a result of the capturing process (see Fig. 3). DP cameras do not enable simultaneous capture of the DP images and corresponding ground truth sharp image (i.e., the image pairs can be captured only in succession at different times). As a result, the Outdoor ground-truth is imperfect with small local motion and illumination variations. The Indoor ground-truth is captured in more controlled conditions and has fewer imperfections. The slightly better performance of DPDNet for outdoor scenes is because DPDNet is learning to compensate for imperfections in the Outdoor dataset. A key strength of our work is the ability to synthetically generate DP data that is not impeded by + +![](images/b13da598f5b511e99c28033d8e87d91b45870a8a4ed256c09aed40cb6dbc467e.jpg) +Figure 8. Results on a Canon 5D DSLR image sequence. PSNR is shown for each deblurred image. sRDPD+ has a 0.4dB lower PSNR on average when it is trained with a single frame compared to our multi-frame method – that is, RDPD+. + +imperfections of manual capture. RDPD+ is trained on the Outdoor dataset as well as the synthetically generated data (without such imperfections) debiasing the result from the imperfect ground-truth. The consequence is reduced fidelity to the imperfect ground-truth (in terms of PSNR/SSIM), but better defocus deblur performance overall. Similar behavior is observed when DPDNet is trained with Canon data and our synthetically generated data (i.e., DPDNet+). + +In Fig. 7, we also provide qualitative results of RDPD compared to other methods on data captured by Canon DSLR and Pixel 4 cameras. In general, RDPD+ is able to recover more details from the input deblurred image. Additionally, Fig. 7 demonstrates that the baseline RDPD achieves good deblurring results on Canon and Pixel 4 data despite being trained with synthetic data only. This result demonstrates the accuracy of the proposed framework for synthetic DP data generation and the ability of the recurrent model to generalize to different cameras. It can also be seen that DPDNet+ has improved results compared to DPDNet, demonstrating the benefit gained by DPDNet+ through the addition of synthetic DP data on training. The supplemental material contains more quantitative results, visual comparisons, and animated deblurring examples for both Canon and Pixel 4 cameras. + +Image sequence results. Our RDPD is designed to handle input image sequences. Here, we investigate the improvement gained by training with image sequences vs. single + +Table 2. Results on our synthetically generated DP data. sRDPD+ is a variation that is trained with single-frame data (green=best, yellow=second best). Our RDPD+, trained with image sequences, achieves the best results. + +
MethodPSNR ↑SSIM ↑MAE ↓
DPDNet [1]26.380.7820.034
DPDNet+ [1]29.840.8280.025
sRDPD+30.260.8490.020
RDPD+31.090.8610.016
+ +frames. For this comparison, we introduce the RDPD+ variant sRDPD+, which is trained with single-frame inputs. + +As previously mentioned, there is no camera that enables access to DP views for video data. Nevertheless, we mimic the same capturing procedure in [1] in order to capture a sequence of images. We performed four captures of the same scene with small camera motion introduced between the captures. Each image has its own DP views and is captured at narrow and wide apertures. Fig. 8 presents the results on the sequence of images. The effectiveness of training with image sequences with RDPD+ can be seen from the average PSNR gain (i.e., $+0.4\mathrm{dB}$ ) compared to sRDPD+ trained using single-image inputs. + +Table 2 shows the quantitative results on our synthetically generated DP image sequences. Our method RDPD+ (trained on multiple frames) achieves the best results as it utilizes the convLSTM architecture to better model the temporal dependencies in an image sequence. Recall that our RDPD network is lighter and has a much lower number of weights compared to DPDNet. + +# 6. Conclusion + +We proposed a novel framework to generate realistic DP data by modeling the image formation steps present on cameras with DP sensors. Our framework helps to address the current challenges in capturing DP data. Utilizing our synthetic DP data, we also proposed a new recurrent convolutional architecture that is designed to reduce defocus blur in image sequences. We performed a comprehensive evaluation of existing deblurring methods, and demonstrated that our synthetically generated DP data and recurrent convolutional model achieve state-of-the-art results quantitatively and qualitatively. Furthermore, our proposed framework demonstrates the ability to generalize across different cameras by training on synthetic data only. We believe our DP data generator will help spur additional ideas about defocus deblurring and applications that leverage DP data. Our dataset, code, and trained models are available at https://github.com/Abdullah-Abuolaim/recurrent-defocus-deblurring-synth-dual-pixel. + +Acknowledgments. The authors would like to thank Shumian Xin, Yinxiao Li, Neal Wadhwa, and Rahul Garg for fruitful comments and discussions. + +# References + +[1] Abdullah Abuolaim and Michael S Brown. Defocus deblurring using dual-pixel data. In ECCV, 2020. 1, 2, 5, 6, 7, 8 +[2] Abdullah Abuolaim and Michael S Brown. Online lens motion smoothing for video autofocus. In WACV, 2020. 1 +[3] Abdullah Abuolaim, Abhijith Punnappurath, and Michael S Brown. Revisiting autofocus for smartphone cameras. In ECCV, 2018. 1 +[4] Abdullah Abuolaim, Radu Timofte, Michael S Brown, et al. NTIRE 2021 challenge for defocus deblurring using dual-pixel images: Methods and results. In CVPR Workshops, 2021. 1 +[5] Faisal Bukhari and Matthew N Dailey. Automatic radial distortion estimation from a single image. Journal of mathematical imaging and vision, 45(1):31-45, 2013. 4 +[6] Laurent D'Andres, Jordi Salvador, Axel Kochale, and Sabine Süssstrunk. Non-parametric blur map regression for depth of field extension. TIP, 25(4):1660-1673, 2016. 1, 2 +[7] DA Fish, AM Brinicombe, ER Pike, and JG Walker. Blind deconvolution by means of the richson-lucy algorithm. Journal of the Optical Society of America (A), 12(1):58-65, 1995. 1, 6 +[8] Andrew W Fitzgibbon. Simultaneous linear estimation of multiple view geometry and lens distortion. In CVPR, 2001. 4 +[9] Alessandro Foi, Mejdi Trimeche, Vladimir Katkovnik, and Karen Egiazarian. Practicaloissonian-gaussian noise modeling and fitting for single-image raw-data. TIP, 17(10):1737-1754, 2008. 4 +[10] Rahul Garg, Neal Wadhwa, Sameer Ansari, and Jonathan T Barron. Learning single camera depth estimation using dual-pixels. In ICCV, 2019. 1 +[11] Jochen Gast and Stefan Roth. Deep video deblurring: The devil is in the details. In ICCV Workshops, 2019. 5 +[12] Xiaoyang Guo, Hongsheng Li, Shuai Yi, Jimmy Ren, and Xiaogang Wang. Learning monocular depth by distilling cross-domain stereo networks. In ECCV, 2018. 6 +[13] Richard Hartley and Sing Bing Kang. Parameter-free radial distortion correction with center of distortion estimation. TPAMI, 29(8):1309-1321, 2007. 4 +[14] Caner Hazirbas, Sebastian Georg Soyer, Maximilian Christian Staab, Laura Leal-Taixe, and Daniel Cremers. Deep depth from focus. In ACCV, 2018. 2 +[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015. 6 +[16] Daniel Hernandez-Juarez, Lukas Schneider, Antonio Espinosa, David Vazquez, Antonio M. Lopez, Uwe Franke, Marc Pollefeys, and Juan Carlos Moure. Slanted stixels: Representing san francisco's steepest streets. In BMVC, 2017. 4, 6 +[17] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, Jürgen Schmidhuber, et al. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. 5 +[18] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. 5 + +[19] Jinbeum Jang, Yoonjong Yoo, Jongheon Kim, and Joonki Paik. Sensor-based auto-focusing system using multi-scale feature extraction and phase correlation matching. Sensors, 15(3):5747-5762, 2015. 1 +[20] Ali Karaali and Claudio Rosito Jung. Edge-based defocus blur estimation with adaptive scale selection. TIP, 27(3):1126-1137, 2017. 1, 6 +[21] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[22] Dilip Krishnan and Rob Fergus. Fast image deconvolution using hyper-laplacian priors. In NeurIPS, 2009. 1, 6 +[23] Junyong Lee, Sungkil Lee, Sunghyun Cho, and Seungyong Lee. Deep defocus map estimation using domain adaptation. In CVPR, 2019. 1, 2, 6 +[24] Junyong Lee, Hyeongseok Son, Jaesung Rim, Sunghyun Cho, and Seungyong Lee. Iterative filter adaptive network for single image defocus deblurring. In CVPR, 2021. 1 +[25] Anat Levin, Yair Weiss, Fredo Durand, and William T Freeman. Understanding blind deconvolution algorithms. TPAMI, 33(12):2354-2367, 2011. 1 +[26] Ce Liu, Richard Szeliski, Sing Bing Kang, C Lawrence Zitnick, and William T Freeman. Automatic estimation and removal of noise from a single image. TPAMI, 30(2):299-314, 2007. 4 +[27] Zhengyang Lu and Ying Chen. Single image super resolution based on a modified u-net with mixed gradient loss. arXiv preprint arXiv:1911.09428, 2019. 5 +[28] Xiaojiao Mao, Chunhua Shen, and Yu-Bin Yang. Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections. In NeurIPS, 2016. 4 +[29] Maxim Maximov, Kevin Galim, and Laura Leal-Taixe. Focus on defocus: bridging the synthetic to real domain gap for depth estimation. In CVPR, 2020. 2 +[30] Liyuan Pan, Shah Chowdhury, Richard Hartley, Miaomiao Liu, Hongguang Zhang, and Hongdong Li. Dual pixel exploration: Simultaneous depth estimation and image restoration. In CVPR, 2021. 1 +[31] Jinsun Park, Yu-Wing Tai, Donghyeon Cho, and In So Kweon. A unified approach of multi-scale deep and hand-crafted features for defocus estimation. In CVPR, 2017. 1, 5 +[32] Michael Potmesil and Indranil Chakravarty. A lens and aperture camera model for synthetic image generation. SIGGRAPH, 15(3):297-305, 1981. 2 +[33] B Prescott and GF McLean. Line-based correction of radial lens distortion. Graphical Models and Image Processing, 59(1):39-47, 1997. 4 +[34] Abhijith Punnappurath, Abdullah Abuolaim, Mahmoud Afifi, and Michael S Brown. Modeling defocus-disparity in dual-pixel sensors. In ICCP, 2020. 1, 3 +[35] Abhijith Punnappurath and Michael S Brown. Reflection removal using a dual-pixel sensor. In CVPR, 2019. 1 +[36] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. 4 + +[37] Jianping Shi, Li Xu, and Jiaya Jia. Discriminative blur detection features. In CVPR, 2014. 2 +[38] Jianping Shi, Li Xu, and Jiaya Jia. Just noticeable defocus blur detection and estimation. In CVPR, 2015. 1, 6 +[39] Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Joshua Susskind, Wenda Wang, and Russell Webb. Learning from simulated and unsupervised images through adversarial training. In CVPR, 2017. 6 +[40] Pratul P Srinivasan, Tongzhou Wang, Ashwin Sreelal, Ravi Ramamoorthi, and Ren Ng. Learning to synthesize a 4D RGBD light field from a single image. In ICCV, 2017. 2 +[41] Huixuan Tang and Kiriakos N Kutulakos. Utilizing optical aberrations for extended-depth-of-field panoramicas. In ACCV, 2012. 1, 3 +[42] Xin Tao, Hongyun Gao, Xiaoyong Shen, Jue Wang, and Jiaya Jia. Scale-recurrent network for deep image deblurring. In CVPR, 2018. 5 +[43] Tu Vo. Attention! stay focus! In CVPR Workshops, 2021. 1 +[44] Neal Wadhwa, Rahul Garg, David E Jacobs, Bryan E Feldman, Nori Kanazawa, Robert Carroll, Yair Movshovitz-Attias, Jonathan T Barron, Yael Pritch, and Marc Levoy. Synthetic depth-of-field with a single-camera mobile phone. ACM Transactions on Graphics, 37(4):64, 2018. 1 +[45] Wenguan Wang, Jianbing Shen, Fang Guo, Ming-Ming Cheng, and Ali Borji. Revisiting video saliency: A large-scale benchmark and a new model. In CVPR, 2018. 5 +[46] SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In NIPS, 2015. 5 +[47] Yinda Zhang, Neal Wadhwa, Sergio Orts-Escalano, Christian Hane, Sean Fanello, and Rahul Garg. Du2net: Learning depth estimation from dual-cameras and dual-pixels. ECCV, 2020. 1 +[48] Wenda Zhao, Fan Zhao, Dong Wang, and Huchuan Lu. Defocus blur detection via multi-stream bottom-top-bottom fully convolutional network. In CVPR, 2018. 2 \ No newline at end of file diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/images.zip b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..46e4917f5c275db920f7ed78655387b62d8f1b1f --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebd580cf9ff962c9244fb92a8e58b3cece60101490fdd088921899962015cb09 +size 691628 diff --git a/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/layout.json b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..341b8d429778a693693415c49b2416d7a7205310 --- /dev/null +++ b/learningtoreducedefocusblurbyrealisticallymodelingdualpixeldata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d89627f376eeeb63c12a90f21f80ae0fc85099d75888818258d7cbc8663a740 +size 427361 diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_content_list.json b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d5746ec8092bfa325eedb1026175f13f6c94bb05 --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b19cd50f048a9c838e03ee629ee578541ffc2c84f77459102ef140310e65d23 +size 67079 diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_model.json b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ead2293a1f141f26bf9be25f8ccc97d7276fb7 --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a726d73dbe670a1e36a0792a9ea3a42e143220279eccdd34c00fc9a4af6509c +size 83998 diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_origin.pdf b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c7419dbf7016c451009a131d2b698fc4c03a887b --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/e83586b5-dbb4-4af3-b35e-06641d9e85e0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad9b387ee9bba8fe4db5c44cc6c1dad95c31a207be93931897402bf4852eaffb +size 5481724 diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/full.md b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..65a29628cc83e20bb6d5bd33c058e7204b27d8a1 --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/full.md @@ -0,0 +1,232 @@ +# Learning to Regress Bodies from Images using Differentiable Semantic Rendering + +Sai Kumar Dwivedi1 Nikos Athanasiou1 Muhammed Kocabas1,2 Michael J. Black1 +1Max Planck Institute for Intelligent Systems, Tübingen, Germany +2ETH Zurich +{sdwivedi, nathanasiou, mkocabas, black}@tue.mpg.de + +![](images/9dacf2b72f15b98f348cb6494b0d9c5bf7d89a5d339249a17184a5d846d021db.jpg) +Figure 1: Differentiable Semantic Rendering (DSR). A state-of-the-art approach [14] (purple) fails to estimate accurate 3D pose and shape for in-the-wild scenarios. We address this by exploiting the clothing semantics of the human body. Our approach, DSR, (blue) captures more accurate 3D pose and shape compared to previous work. + +# Abstract + +Learning to regress 3D human body shape and pose (e.g. SMPL parameters) from monocular images typically exploits losses on 2D keypoints, silhouettes, and/or part-segmentation when 3D training data is not available. Such losses, however, are limited because 2D keypoints do not supervise body shape and segmentations of people in clothing do not match projected minimally-clothed SMPL shapes. To exploit richer image information about clothed people, we introduce higher-level semantic information about clothing to penalize clothed and non-clothed regions of the human body differently. To do so, we train a body regressor using a novel "Differentiable Semantic Rendering (DSR)" loss. For Minimally-Clothed (MC) regions, we define the DSR-MC loss, which encourages a tight match between a rendered SMPL body and the minimally-clothed regions of the image. For clothed regions, we define the DSR-C loss to encourage the rendered SMPL body to be inside the clothing mask. To ensure end-to-end differentiable training, we learn a semantic clothing prior for SMPL vertices from thousands of clothed human scans. We perform extensive qualitative and quantitative experiments to evaluate the role of clothing + +semantics on the accuracy of 3D human pose and shape estimation. We outperform all previous state-of-the-art methods on 3DPW and Human3.6M and obtain on par results on MPI-INF-3DHP. Code and trained models are available for research at https://dsr.is.tue.mpg.de/. + +# 1. Introduction + +Estimating 3D human pose and shape from in-the-wild images has received great research interest [5, 14, 15, 18, 20, 30, 34, 54] because of its varied applications in animation, games, and the fashion industry. One aspect that makes this problem challenging is the difficulty of obtaining accurate 3D ground-truth annotations, as they require either specialized –mostly indoors– MoCap systems or careful calibration and setup of IMU sensors [46]. Such data would facilitate training robust regressors paving the way for estimating human-scene interaction with greater granularity. + +Given the lack of in-the-wild 3D ground-truth, the vast majority of previous methods focus on 2D keypoints [5, 14] with some learned 3D priors. Even though sparse 2D keypoints give useful constrained, relying only on these leads to unrealistic poses because of depth ambiguities and occlu + +sion. They also do not provide reliable information about body shape. On the other hand, relying too strongly on 3D priors introduces bias. To circumvent this problem, recent approaches [30, 34, 50] propose to use part-segmentations or silhouettes. However, there is a mismatch between part-segmentations/silhouettes and projected SMPL bodies since segmentation covers clothed bodies while the common 3D body models are minimally clothed. We propose an alternative approach to compensate for limited 3D supervision that leverages high-level 2D image cues. + +Specifically, we propose more detailed clothing segmentation labels to supervise a neural network. Traditional multi-class clothing segmentation approaches cannot be directly applied as the segmentation loss tries to exactly match the rendered SMPL body. Hence, to make use of such labels, we need to reason about which parts of the SMPL body model correspond to which clothing label. This is non-trivial to obtain because a body part can be covered by many clothing types. Therefore, we learn a semantic clothing prior from a large-scale clothed human scan dataset, which has varied subjects, poses and camera views to which the SMPL body is fitted [31]. This prior encodes the likelihood of clothing types given a vertex on the SMPL body model, which gives the correspondence between segmentation labels and the SMPL body surface. Then, we use this prior to calculate a loss between the SMPL body and observed clothing labels in images. To achieve this we introduce Differentiable Semantic Rendering (DSR), a novel loss that supervises the training of 3D body regression with clothing semantics using weak supervision [8]. + +Our novel loss has two components: $DSR-C$ for supervising the clothing region and $DSR-MC$ for the minimally-clothed region. A high-level illustration of our idea is shown in Fig. 2. While the former ensures that the rendered SMPL mesh stays inside the observed clothing label, the latter tries to tightly match the rendered SMPL mesh to the 2D minimal-clothing mask. The loss between the rendered output and the target mask is back-propagated using a differentiable renderer. Specifically, for the $DSR-MC$ term, we apply pixel-level supervision for tight-fitting with the minimal-clothing regions, while for $DSR-C$ , we minimize the negative log probability of a SMPL semantic part label being inside the respective segmentation mask. For example, there will be a high penalty if the rendered vertices with a high probability of being "shirt" fall in the "pants" segmentation pixels. To ensure that our method is fast and differentiable, we render the semantic class probabilities computed from 3D scans as textures of the SMPL mesh. + +While training, DSR can be used as an additional loss in any neural network-based human body estimator that predicts SMPL parameters. First, we examine the effect of our approach over a baseline full-body mask supervision and 3D joint only supervision which verifies our hypothe + +![](images/20d1ce0518d78a469bf4a38eba2636808d907a76ab515d3281ec1d8fa56776db.jpg) +Figure 2: DSR Idea - For more accurate human body estimation, we supervise 3D body regression training with clothed and minimal-clothed regions differently using our novel $DSR$ loss and our learned semantic prior. The semantic prior represents a distribution over possible clothing labels for each vertex. For easier illustration, we depict the most likely labels per-vertex here. + +sis about the value of clothing semantics. Then, we perform extensive comparisons and show that DSR outperforms previous state-of-the-art methods as shown in Fig. 1. In summary: + +1. We explore the importance of clothing semantics for 3D human body estimation by introducing a novel differentiable semantic rendering loss that distinguishes between clothed and minimally-clothed regions. +2. We estimate a semantic clothing prior for SMPL from 3D scans of clothed people for our method which can be used also for other cases when a vertex clothing probability for a 3D SMPL body is required. +3. We outperform all state-of-the-art methods on 3DPW and Human3.6M and obtain on par results on MPI-INF-3DHP, suggesting the value of using human parsing and semantics for more accurate human body estimation. + +# 2. Related Work + +Estimating human pose and shape is a vastly growing field using different sources of supervision and input (image, video, keypoints, etc.). Here, we focus on different works that estimate 3D human pose and shape from an RGB image. We refer to recent surveys [7, 38] for more details. + +# 2.1. Image cues and 2D/3D joints + +Towards estimating 3D human pose and shape, initial attempts focus on estimating the coordinates of 3D joints or heatmaps [12, 21, 33, 39-41, 43] from images using geometric assumptions for the human body and 3D training data. However, those approaches require 3D ground-truth data, which are limited in terms of pose variation, quantity and background, and lack generalization to in-the-wild images. The vast progress in 2D pose detection [6, 29, 42, 49], along with the introduction of parametric body models of pose and shape [3, 24] lead to significant progress and high-quality in-the-wild 3D humans. In [5] the authors use 2D keypoints to obtain SMPL parameters with an optimization-based approach, while this process improves via human annotations on predicted fits [20]. Martinez et al. [27] show that lifting the predictions of a 2D keypoint detector provides a reasonable baseline for the 3D pose. Pavlakos et al. [32] use additional ordinal depth annotations for weak 3D supervision. Kolotouros et al. [19] regress vertex locations using a sub-sampled SMPL mesh and Graph-CNNs. Xiang et al. [47] extract joint confidence maps and 3D orientation information via CNNs and pair them with a deformable body model. Furthermore, in HMR [15], a regressor from 2D joints to SMPL parameters is trained, using a discriminator with unpaired 3D data [26] to encourage plausible poses. Along these lines, some recent approaches using video as input, have applied similar methods to predict temporal kinematics of 3D bodies [16] and estimate the body using temporal features and a motion discriminator [17]. Another approach [51], uses a disentanglement of the skeleton from the 3D human mesh paired with a self-attention network to ensure temporal coherence. SPIN [18], revisits optimizations methods in collaboration with neural networks as it uses a network [15] that provides an initial estimate to the optimization process (SMPLify). Moreover, a regressor-based alternative suggests the use of the 3D neural regressor as a pose prior [14]. Although such methods produce promising results, they typically estimate average body shapes, are not robust to occlusion, and produce poses that are only approximate. Without 3D training data the problem is hard. + +# 2.2. Image alignment and pixel-level supervision + +Concurrently, there is a line of research that uses additional constraints, in addition to image features and 2D/3D joints, to better align the body with the image such as dense body landmarks, silhouettes, body part segmentation or pixel aligned implicit functions. Initial seminal lines of work, use a few keypoints along with the SCAPE body model and optimize 3D body shape with silhouettes and smooth shading [9]. Along these lines, Balan et al. [4] propose a distance function for the connected silhouette to ensure the rendered 3D model falls inside the mask. Later + +work uses 2D keypoints, background segmentation, and SMPL to extract 3D bodies from images [44], similar to [34] who use silhouettes for supervision. Even silhouettes, although they provide supervision when keypoints fail, are often ambiguous in the case of self-occlusion. Towards a detailed alignment of the 3D human body surface and pixels the authors in [10] introduce a dataset with image-to-surface correspondence from MS-COCO [22] and a variant of Mask-RCNN that regresses UV coordinates from images. Part-segmentation masks and IUV are also used in [30] and [54], respectively, as dense supervision. A continuous UV map of SMPL for direct pixel correspondence of the image and the 3D mesh is introduced in [54]. In a similar approach [50], exploits IUV maps as a proxy representation. It estimates SMPL parameters by minimising dense body landmarks and human part masks and also by using motion discriminator. While a large majority of the aforementioned work leverages a parametric 3D body model, there is some recent work that uses voxel representations along with 2D pose and part segmentation supervision [45] or employs implicit functions with surface reconstruction techniques to reconstruct clothed humans. Although these approaches output fine-grain details, they are unable to capture the shape under clothing and are prone to occlusion [11, 36, 37]. An interesting approach is proposed in [55] where a partial UV map of the person is used and the human pose estimation is formulated as an image inpainting problem. Another work that explores scene semantics [35], predicts the label of an occluding object and employs this information to detect invisible joints. Finally, Zanfir et al. [52] represent the body with a normalizing flows-based latent space and use body part segmentation supervision to estimate 3D human body pose from videos and images, unifying different previous approaches. Clothing segmentation is used in [48] for clothing deformation to penalize the vertex offset of the clothed body if the rendered vertex falls outside the clothing boundary. + +Most of these approaches are based on joints, silhouettes and part-segmentation masks using approximate supervision for the pose of a person in clothing. We claim that there is more that an image can tell us about human pose. Our key insight is that clothing for different parts of the body conveys important information for detailed fitting. We employ an off-the-shelf 2D semantic segmentation method [8] and a semantic clothing prior to apply these labels in 3D. Given those, we supervise clothed and minimal-clothed regions separately, yielding more aligned fits of 3D humans. + +# 3. Method + +DSR uses high-level semantic information for more accurate pose and shape estimation using two additional loss terms DSR-MC and DSR-C, as shown in Figure 3. DSR takes an image $I$ as input which passes through a CNN. + +![](images/92f79ae087577b9b92dfb4005a982004b2f1f575bc67230457a4fd79d7557793.jpg) +Figure 3: Illustration of DSR - SMPL is rendered with the semantic prior learned from RenderPeople scans. The two novel loss terms are calculated based on different semantic regions of the clothed person. DSR-MC tightly fits the minimal-clothed region, while DSR-C ensures that the rendered body lies within the clothing boundaries. + +Then, the image features $\Phi(I)$ are fed to an iterative regressor, similar to HMR [15], to estimate the parameters of SMPL body model, $\hat{\Theta}$ . Given the rendered SMPL mesh, we apply our novel DSR-MC and DSR-C losses in addition to standard loss terms used in EFT [14]. SMPL is a parametric body model that represents body pose and shape by $\Theta = [\theta \in \mathbb{R}^{72}, \beta \in \mathbb{R}^{10}]$ . The pose parameters $\theta$ include the global rotation and rotations of 23 body joints in axis-angle format and the shape parameters $\beta$ consist of the first 10 coefficients of a PCA shape space. SMPL model is a differentiable function $\mathcal{M}(\theta, \beta) \in \mathbb{R}^{6890 \times 3}$ that outputs a 3D mesh according to the pose and shape parameters. + +Clothing Semantic Information. Ground-truth clothing segmentations are expensive to obtain for in-the-wild datasets, which limits the scalability of such an approach. Hence, to analyze the importance of clothing semantics for human pose and shape estimation, we employ an off-the-shelf segmentation model to generate pseudo ground-truth clothing semantics. Graphonomy [8] is a state-of-the-art clothing segmentation model that uses inter and intra graph transfer learning for unifying different clothing datasets and produces 20 clothing labels and body part segmentations. As DSR-MC reasons about the minimal-clothing region, we use a binary mask comprised of 5 labels - LeftArm, RightArm, LeftShoe, RightShoe and Face from Graphonomy as ground-truth (whenever available). For DSR-C, we use 4 labels - UpperClothes, LowerClothes, Minimal-Clothing and Background. We run the Universal Model of Graphonomy on all the datasets to generate pseudo-truth clothing segmentations. For more details on the generation of pseudo-ground truth, cleaning of obtained masks and mapping of graphonomy labels for DSR-C and DSR-MC, + +please refer to the Sup. Mat. + +Semantic Prior for SMPL. To use the semantic information obtained from Graphonomy as pseudo ground-truth training labels, we need a semantic prior of clothing for SMPL 3D bodies. To achieve this, we use thousands of scans from Renderpeople [1] with varied clothing, subject, pose and 10 camera views for which we have ground-truth SMPL fits from AGORA [31]. We run the universal model of Graphonomy on the rendered images of the scan with 20 clothing and body part segmentation labels. Next, we use the ground-truth SMPL mesh to compute the visible face triangles given the mesh and camera parameters. Then, each visible triangular face is assigned the corresponding segmentation label. We repeat this process for all the available scans. We compute the probability of each vertex being a particular label out of the 20 labels from Graphonomy. This probabilistic label for each vertex is referred to as semantic prior. For more details refer to Sup. Mat. + +Differentiable Semantic Rendering. We use SoftRas [23] as the differentiable renderer to supervise the estimation of the 3D parametric model using semantic information. It uses a differentiable aggregation process for rendering, which fuses the probabilistic contributions of all mesh triangles with respect to rendered pixels. The semantic prior obtained from AGORA [31] is used as a texture. Specifically, for each semantic label, we render the probability of that label for each visible vertex. Once the semantic probability is rendered as images by SoftRas, the loss is computed on the 2D image output by comparing with the semantic image segmentation and this is backpropagated to change the vertices, in turn, changing the network to give more accurate SMPL parameters. + +Standard Losses. As we use the EFT [14] data for training, we use the standard supervision loss $\mathcal{L}_{SD}$ similar to EFT which is defined as: + +$$ +\mathcal {L} _ {2 D} (\Pi (\mathcal {M} (\hat {\Theta})), j) + \mathcal {L} _ {3 D} (\mathcal {M} (\hat {\Theta}), J) + \mathcal {L} _ {\Theta} (\Theta , \hat {\Theta}) \tag {1} +$$ + +where, $\hat{\Theta}$ are the estimated SMPL parameters, $\mathcal{L}_{2D}$ is the joint reprojection loss, $\mathcal{L}_{3D}$ and $\mathcal{L}_{\Theta}$ are losses on 3D joints and SMPL parameters, respectively. Ground truth 2D joints are represented by $j$ , 3D joints by $J$ , SMPL parameters by $\Theta$ and the camera projection function by $\Pi$ . + +DSR - Minimal-Clothing. For minimal-clothing, we choose five labels from Graphonomy namely, LeftArm, RightArm, LeftShoe, RightShoe and Face, which often appear similar in shape to the rendered SMPL body; i.e. look roughly "naked." For a particular image, we take the clothing segmentation mask given by Graphonomy and create a binary mask $G$ comprising of the valid labels for that image from the available five labels. This forms the ground-truth for DSR-MC denoted by $GT - DSR - MC$ in Fig. 3. We render the probability distribution of vertex labels for SMPL precomputed from RenderPeople as textures; these are shown as Rendered Semantics in Fig. 3. We only take the probability distribution of vertices that are visible and set the others as zero. Thus, we define the DSR-MC loss to tightly match the corresponding rendered minimal-clothing region of SMPL to the available semantic binary mask as shown in Fig. 3 (bottom). + +We study two variants of the loss for DSR-MC: soft-DistM and soft-IOU. Soft-DistM is inspired by the DistM loss of Naked Truth [4] which was originally proposed for estimating body shape under-clothing. Since we render the semantic probability instead of silhouettes, we call it soft-DistM. It is a distance measure function that takes the rendered image $R$ and target binary Graphonomy mask $G$ and is defined as: + +$$ +\mathcal {L} _ {M C - s D i s t M} = \sum_ {i, j} \left(R _ {i, j} \cdot d _ {i, j} (G)\right) / \left(\sum_ {i, j} R _ {i, j}\right) ^ {3 / 2} \tag {2} +$$ + +where $R_{i,j}$ are the pixels inside rendered human body and $d_{i,j}$ is a distance function which is zero if pixel $(i,j)$ is inside $G$ . For points outside, it is defined as the Euclidean distance to the closest point on the boundary of $G$ . Soft-DistM can pull the output inside the target because of the sharp difference in penalization between pixels inside the mask and pixels outside. Given a good initial estimate, the Soft-DistM loss ignores spurious and scattered labels outside the region of interest because the loss is high for pixels far away. This is particularly helpful, when using an off-the-shelf segmentation model without instance segmentation, which can give the wrong output for hard examples. + +However, soft-DistM cannot fully ensure that the rendered output exactly matches the target as it gives the same + +penalty for outputs with different percentages of overlap when it is inside the boundary. Hence, we studied soft-IoU, which ensures tight fitting and is calculated as: + +$$ +\mathcal {L} _ {M C - s I O U} = \frac {1}{N} \frac {\sum_ {(i , j)} P _ {i , j} \cdot G _ {i , j}}{\sum_ {(i , j)} P _ {i , j} + G _ {i , j} - P _ {i , j} \cdot G _ {i , j}} \tag {3} +$$ + +where $P_{i,j}$ is the rendered vertex probability at pixel $(i,j)$ , $G_{i,j}$ is the graphonomy label for that pixel. Soft-IoU suffers from spurious and scattered labels outside the region of interest and also suffers from the lack of instance segmentation in the off-the-shelf model. However, we choose soft-IoU for the metric for DSR-MC due to better quantitative results in the baseline experiments in Table 1. + +DSR - Clothing. The rendered SMPL body mesh cannot exactly match all the target pixels for the clothing region. Hence, for a more accurate estimate of the 3D body model, we want to encourage the rendered SMPL mesh to stay inside the clothing mask. Previous methods [4] define a distance function to deal with such scenarios. However, we have higher-level semantic information than a silhouette to better address this. We have additional boundaries other than the body outline to enforce that a particular semantic part of the SMPL mesh should fall inside the corresponding semantic part of the segmentation mask. Clothing segmentation provides additional boundaries, such as between the upper and lower body or between clothing and skin. + +Specifically, we define four labels, UpperClothes, LowerClothes, MinimalClothing and Background, shown as four color masks in Fig. 3 (top). We introduce a MinimalClothing label for DSR-C to avoid confusion between the background and minimal-clothing region. Without it, the DSR-C loss would give the same penalty when the minimalclothing region falls on the corresponding target region or the background. As the semantic prior learned from RenderPeople has 20 probability labels per vertex, we add all the probabilities of upper body clothing labels for Upperclothes, lower body clothing labels for LowerClothes and body part segmentation labels for MinimalClothing. We define DSR-C loss as the negative log-likelihood (NLL) of the rendered probability distribution of each vertex belonging to one of the four labels. The rendered probability distribution is first sent through log softmax before applying NLL loss for numerical stability. So, $\mathcal{L}_{DSR - C}$ is defined as + +$$ +\mathcal {L} _ {D S R - C} = \sum_ {i = 1} ^ {W} \sum_ {j = 1} ^ {H} - \log \left(y _ {i, j}\right) \tag {4} +$$ + +where $y_{i,j}$ is the probability output for the vertex at pixel $(i,j)$ , $H$ is the height and $W$ is the width of the image. Hence, the total loss $\mathcal{L}_{total} = \mathcal{L}_{SD} + \mathcal{L}_{MC - sIOU} + \mathcal{L}_{DSR - C}$ . + +![](images/d7401b228ff0a91196355f554f9c9239584496a4bb14d41ce0bcb950f3247bf2.jpg) +Figure 4: Are 3D joints enough? We over-fit a batch of H36M samples on ground-truth (GT) joints (green) and joints with DSR (blue). The weak supervision with semantic information improves accuracy. + +# 4. Experimental Setup + +Training Procedure. Following EFT [14], we train a regressor similar to HMR [15] with mixed 3D and 2D datasets. We use the pseudo-ground 3D annotations for 2D datasets from EFT. For 2D data, we only use COCO [22] as including other in-the-wild datasets did not give a performance gain and for 3D datasets, we use Human3.6M [13] and MPI-INF-3DHP [28]. We also use the 3DPW [46] training set for fair comparisons and the same data ratio for mixed 2D and 3D datasets as EFT. For baseline and ablation experiments, we train only on COCO-EFT [14]. For faster training, we initialize the network with SPIN pre-trained weights and use the same hyper-parameters as SPIN [18] and train the model for 100K iterations. + +Evaluation Procedure. For state-of-the-art comparisons, we use 3DPW [21], Human3.6M [13] and MPI-INF-3DHP [28]. As in prior work [14, 18], we use the gender information for ground truth meshes on 3DPW. We report results with and without 3DPW training on Procrustes-aligned mean per joint position error (PA-MPJPE), mean per joint position error (MPJPE) and Per Vertex Error (PVE). + +Differentiable Semantic Rendering. We use Soft-Ras [23] to render the probability distribution for DSR-C and DSR-MC. For SoftRas, we use a higher gamma value of $1.0 \times 10^{-1}$ to ensure the loss affects the occluded part of the body and a lower sigma value of $1.0 \times 10^{-5}$ to ensure the error does not significantly affect the spatial region. For more details, refer to SoftRas [23]. We render the probability distribution of each triangle face as textures and compute the loss on the RGB channel of the rendered output. We render 5 images for each sample in a batched manner: 1 for DSR-MC and 4 for DSR-C. However, the loss is calculated per individual sample to avoid calculating for samples that do not have a valid segmentation mask. In such cases, + +
MethodPAMPJPE ↓MPJPE ↓PVE ↓
C-EFT58.5101.0119.3
+ DSR-FB59.8102.1120.3
+ DSR-FB (s-DistM)58.0100.2117.8
+ DSR-MC (s-DistM)58.2100.6118.5
+ DSR-MC (s-IoU)58.0100.3118.1
+ DSR-C57.699.8117.6
+ DSR-MVP58.1100.3117.8
+ DSR-C + DSR-MC (Ours)57.299.2116.3
+ +Table 1: Baseline Comparisons for DSR on 3DPW. C-EFT is the regressor trained with COCO-EFT and standard losses. DSR-FB is supervised with a full-body silhouette. DSR-MC is minimal-clothing, DSR-C is clothing and DSR-MVP is manual labelling of clothing and minimal-clothing. + +the loss is set to zero. After using the heuristics to clean the mask, a valid label set is created for DSR-C and DSR-MC. The weighting parameters for both the components are set to 0.01. As DSR depends on weak supervision from off the shelf clothing segmentation model and hence not robust for hard examples, we enable the loss after 10K iterations into our training. + +# 5. Results + +# 5.1. Baseline Comparison and Ablation Studies + +We perform baseline experiments to (1) motivate the use of semantic rendering and (2) study how the different terms and design choices contribute to the final result as shown in Table 1. As a baseline, we use an HMR [15] based regressor trained on EFT-COCO [14] data and report results on 3DPW (C-EFT). Then, we supervise the baseline with an additional full-body silhouette (DSR-FB) which is a per pixel binary classification loss guided by differentiable rendering. The results deteriorate as the rendered SMPL body does not match the full body. We further train DSR-FB with the Dist-M loss in contrast to per-pixel classification to ensure all body parts (irrespective of clothing) stay inside the silhouette. The result in Table 1 shows that explicit supervision with clothing semantics (Ours) outperforms the naive cloth-agnostic approach. We study the importance of estimating clothing semantics from scans in contrast to manual vertex painting (MVP) of semantic labels as the former gives a distribution over possible clothing labels (20) for each vertex whereas the latter would give only 1. To quantitatively verify the benefit of the probabilistic clothing semantic prior, we take the most likely label per vertex (Fig. 2) as a proxy for MVP. Since we have 1 label per vertex, we use IoU instead of s-IoU. Table 1 shows low performance of a fixed semantic prior (MVP) compared to a probabilistic one (Ours). We also study the individual contribution of DSR-C and DSR-MC on the overall performance and find that the clothing term helps more than the minimal-clothing + +
Models3DPWHuman3.6MMPI-INF-3DHP
PA-MPJPE ↓MPJPE ↓PVE ↓PA-MPJPE ↓MPJPE ↓PA-MPJPE ↓MPJPE ↓
HMR [15]76.7130.0-56.88889.8124.2
NBF [30]---59.9---
Pavlakos et al. [34]---75.9---
CMR [19]70.2--50.1---
SPIN [18]59.296.9116.441.162.567.5105.2
EFT [14]54.2--43.7-68.0-
Zanfir et. al [52] (w/ 3DPW train)57.190.0-----
EFT [14] (w/ 3DPW train)52.2--43.8-67.0-
DSR54.191.7105.840.360.966.7105.3
DSR (w/ 3DPW train)51.785.799.541.462.067.0104.7
+ +Table 2: Evaluation of state-of-the-art models on 3DPW, Human3.6M, and MPI-INF-3DHP datasets. DSR is our proposed model trained on monocular images similar to [14, 15, 18]. DSR outperforms all state-of-the-art models, including EFT [14] on the challenging datasets. “—” shows the results that are not available. + +
MethodPAMPJPE ↓MPJPE ↓PVE ↓
Standard Loss (SD)47.573.999.2
SD + DSR45.171.396.6
+ +term. One possible explanation could be that the off-the-shelf segmentation model is not robust for hands and feet hence causing less gain. Empirically, we observe that soft-IoU performs better than soft-DistM and hence use it as the metric for DSR-MC for all subsequent experiments. Overall, the best accuracy is reached when both terms are used showing that supervising minimally-clothed and clothed regions differently helps improve 3D body estimation. + +# 5.2. State-of-the-art comparison + +We compare our approach with state-of-the-art methods in Table 2. We use two variants of our model, with and without the 3DPW training set, to be aligned with the training data of other methods. In 3DPW, an in-the-wild challenging 3D dataset, we outperform previous work when using 3DPW training data, while performing on par with EFT [14] when they are not used. Moreover, we clearly improve accuracy on Human3.6M [13], a standard indoor benchmark, over state-of-the-art SPIN [18] and EFT [14] methods. We also report on par results in MPI-INF-3DHP [2]. We perform significantly better than previous approaches that use ground-truth part-segmentation or silhouettes [30, 34, 52] compared to our weak supervision. Overall, we consistently perform better than previous approaches across different datasets, both indoors and outdoors. In Fig. 5 we can see different comparisons of DSR with the previous state-of + +Table 3: Potential of DSR. We train and test on a subset of Human3.6M to evaluate the full potential of DSR loss. SD refers to standard joint loss. + +
MethodAnkleKneeHipWristElbowHead
Standard Loss (SD)99.354.620.0109.581.181.8
SD + DSR96.150.419.5107.379.380.5
+ +Table 4: Per joint error for Human3.6M subset. SD refers to standard joint loss used in 3D body estimation. + +the-art and observe that the estimated mesh is more aligned with image evidence. These observations validate our hypothesis that clothing semantics, even when used as weak supervision, provides additional information for estimating more accurate 3D bodies. + +# 5.3. Potential of DSR + +To test the significance of high-level semantics on shape and pose estimation, we use an off-the-shelf segmentation model [8]. However, such models are not robust to in-the-wild examples. Because we use the output of the model as pseudo ground-truth for supervision, it is hard to determine the full potential of our approach. Hence, we experiment on the Human3.6M dataset to test the DSR loss in a more controlled setting. Human3.6M is an indoor dataset with significantly less background complexity as compared to outdoor datasets. Hence, it is ideal for testing the limit of DSR. We study two different cases. First, we split the training set of Human3.6M, with SMPL parameters computed by MoSh [25], into training and validation sets with S8 in the validation set. This is done to evaluate the per-vertex-error (PVE) using the MoSh ground truth SMPL parameters, thus, giving insight into the shape estimation efficacy of our method. As shown in Table. 3, the performance gain with the DSR loss is significantly higher compared to the standard joint loss. This emphasizes the importance of semantic information. We also analyze the per joint error to understand the source of a performance gain as shown in + +![](images/4d488e990802aa11de220eb954b0d984e01ea2f2c92c1bd956f65b949de540e3.jpg) +Figure 5: Qualitative Results on COCO. From left to right - Input image, SPIN [18], EFT [14] and DSR results. + +the Table. 4. Using the DSR, the maximum performance gains are from Ankle, Knee, Wrist which are common failures in 3D pose estimation. Second, we take a step further to examine whether ground truth 3D joints are enough for accurate and pixel aligned body estimation. To this end, we take a random batch of 64 samples from Human3.6M and over-fit on only joints and joints with the DSR loss for 100 iterations with the same hyper-parameters used for other experiments. The qualitative results are depicted in Fig. 4. As we can see, supervision with ground 3D joints cannot always reason about all the pixels. Using DSR produces more pixel-aligned fits, especially for hands and feet. + +# 6. Conclusion + +While huge progress has been made in estimating 3D human pose and shape, we are still far from estimating highly accurate 3D humans in everyday scenes. We hypothesize that clothing semantics is an under-explored feature that can benefit 3D body estimation methods. Therefore, we introduce a novel method to exploit clothing semantics as weak supervision. Namely, we: (1) Introduce a novel differentiable loss that supervises clothed and minimally-clothed regions differently to ensure that the body lies inside the + +clothes for the former while tightly fitting for the latter. (2) Learn a semantic clothing prior, i.e. a probability distribution over clothing labels for SMPL vertices, to apply our method efficiently. This can also be used independently. (3) Thoroughly evaluate our approach qualitatively and quantitatively, outperforming the state-of-the-art. (4) Analyze our method's components and show that clothing semantics, even as weak supervision, is a valuable complementary cue to 3D joints that improves the estimation of 3D bodies. Our experiments show the importance of such semantics, providing new insight into 3D human body estimation. + +DSR uses clothing as weak supervision, which can be limited in complex scenes with multiple people and occlusion. Our method can be easily extended to pipelines that account for multiple people in the scene [53]. In the future, we should explore methods that model 3D clothing semantics, build a better prior for SMPL bodies or incorporate additional constraints to disambiguate scene semantics. + +Acknowledgements: We thank Sergey Prokudin, ChunHao P. Huang, Vassilis Choutas, Priyanka Patel, Radek Danecek, Cornelia Kohler and all Perceiving Systems department members for their help, feedback and fruitful discussions. Disclosure: https://files.is.tue.mpg.de/black/CoI/ICCV2021.txt + +# References + +[1] Renderpeople. https://renderpeople.com, 2020.4 +[2] M. Andriluka, L. Pishchulin, P. Gehler, and B. Schiele. 2D human pose estimation: New benchmark and state of the art analysis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. 7 +[3] Dragomir Anguelov, P. Srinivasan, D. Koller, S. Thrun, J. Rodgers, and James Davis. SCAPE: shape completion and animation of people. In SIGGRAPH, 2005. 3 +[4] A. Balan and M. J. Black. The naked truth: Estimating body shape under clothing.. In European Conference on Computer Vision (ECCV), 2008. 3, 5 +[5] Federica Bogo, Angjoo Kanazawa, Christoph Lassner, Peter Gehler, Javier Romero, and Michael J. Black. Keep it SMPL: Automatic estimation of 3D human pose and shape from a single image. In European Conference on Computer Vision (ECCV), 2016. 1, 3 +[6] Zhe Cao, Gines Hidalgo, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Openpose: Realtime multi-person 2D pose estimation using part affinity fields. In IEEE Transaction on Pattern Analysis and Machine Intelligence (TPAMI), 2021. 3 +[7] Y. Chen, Yingli Tian, and Mingyi He. Monocular human pose estimation: A survey of deep learning-based methods. In Comput. Vis. Image Underst., 2020. 2 +[8] Ke Gong, Yiming Gao, Xiaodan Liang, Xiaohui Shen, Meng Wang, and Liang Lin. Graphonomy: Universal human parsing via graph transfer learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2, 3, 4, 7 +[9] P. Guan, A. Weiss, A. Balan, and Michael J. Black. Estimating human shape and pose from a single image. In International Conference on Computer Vision (ICCV), 2009. 3 +[10] Riza Alp Güler, N. Neverova, and I. Kokkinos. Densepose: Dense human pose estimation in the wild. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 3 +[11] Tong He, J. Collomosse, H. Jin, and Stefano Soatto. Geopifu: Geometry and pixel aligned implicit functions for single-view human reconstruction. In Advances in Neural Information Processing (NeurIPS), 2020. 3 +[12] David C. Hogg. Model-based vision: a program to see a walking person. In Image Vis. Comput., 1983. 3 +[13] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3D human sensing in natural environments. In IEEE Transaction on Pattern Analysis and Machine Intelligence (TPAMI), 2014. 6, 7 +[14] Hanbyul Joo, Natalia Neverova, and Andrea Vedaldi. Exemplar fine-tuning for 3d human pose fitting towards inthe-wild 3d human pose estimation. In arXiv preprint arXiv:2004.03686, 2020. 1, 3, 4, 5, 6, 7, 8 +[15] Angjoo Kanazawa, Michael J. Black, David W. Jacobs, and Jitendra Malik. End-to-end recovery of human shape and pose. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 3, 4, 6, 7 +[16] A. Kanazawa, Jason Y. Zhang, Panna Felsen, and Jitendra Malik. Learning 3D human dynamics from video. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3 + +[17] Muhammed Kocabas, Nikos Athanasiou, and Michael J. Black. VIBE: Video inference for human body pose and shape estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 +[18] Nikos Kolotouros, Georgios Pavlakos, Michael J Black, and Kostas Daniilidis. Learning to reconstruct 3D human pose and shape via model-fitting in the loop. In International Conference on Computer Vision (ICCV), 2019. 1, 3, 6, 7, 8 +[19] Nikos Kolotouros, Georgios Pavlakos, and Kostas Dani-ilidis. Convolutional mesh regression for single-image human shape reconstruction. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3, 7 +[20] Christoph Lassner, J. Romero, Martin Kiefel, Federica Bogo, Michael J. Black, and P. Gehler. Unite the people: Closing the loop between 3D and 2D human representations. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 1, 3 +[21] Sijin Li and Antoni B. Chan. 3D human pose estimation from monocular images with deep convolutional neural network. In Asian Conference on Computer Vision (ACCV), 2014. 3, 6 +[22] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In European Conference on Computer Vision (ECCV), 2014. 3, 6 +[23] Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft rasterizer: A differentiable renderer for image-based 3d reasoning. In International Conference on Computer Vision (ICCV), 2019. 4, 6 +[24] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black. SMPL: A skinned multiperson linear model. In ACM Trans. Graphics (Proc. SIGGRAPH Asia), 2015. 3 +[25] Matthew M. Loper, Naureen Mahmood, and Michael J. Black. MoSh: Motion and shape capture from sparse markers. In ACM Transactions on Graphics, (Proc. SIGGRAPH Asia), 2014. 7 +[26] Naureen Mahmood, N. Ghorbani, N. Troje, Gerard Pons-Moll, and Michael J. Black. AMASS: Archive of motion capture as surface shapes. In International Conference on Computer Vision (ICCV), 2019. 3 +[27] J. Martinez, Rayat Hossain, J. Romero, and J. Little. A simple yet effective baseline for 3D human pose estimation. In International Conference on Computer Vision (ICCV), 2017. 3 +[28] Dushyant Mehta, H. Rhodin, D. Casas, P. Fua, Oleksandr Sotnychenko, Weipeng Xu, and C. Theobalt. Monocular 3d human pose estimation in the wild using improved cnn supervision. In International Conference on 3D Vision (3DV), 2017. 6 +[29] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In European Conference on Computer Vision (ECCV), 2016. 3 +[30] Mohamed Omran, Christoph Lassner, Gerard Pons-Moll, Peter Gehler, and Bernt Schiele. Neural body fitting: Unifying deep learning and model based human pose and shape estimation. In International Conference on 3D Vision (3DV), 2018. 1, 2, 3, 7 + +[31] Priyanka Patel, Chun-Hao Paul Huang, Joachim Tesch, David Hoffmann, Shashank Tripathi, and Michael J Black. AGORA: Avatars in geography optimized for regression analysis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 2, 4 +[32] Georgios Pavlakos, Xiaowei Zhou, and Kostas Daniilidis. Ordinal depth supervision for 3D human pose estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 3 +[33] Georgios Pavlakos, Xiaowei Zhou, K. Derpanis, and Kostas Daniilidis. Coarse-to-fine volumetric prediction for single-image 3D human pose. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 3 +[34] Georgios Pavlakos, Luyang Zhu, Xiaowei Zhou, and Kostas Daniilidis. Learning to estimate 3D human pose and shape from a single color image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 1, 2, 3, 7 +[35] U. Rafi, Juergen Gall, and B. Leibe. A semantic occlusion model for human pose estimation from a single depth image. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2015. 3 +[36] S. Saito, Zeng Huang, R. Natsume, S. Morishima, A. Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In International Conference on Computer Vision (ICCV), 2019. 3 +[37] Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3D human digitization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 +[38] Nikolaos Sarafianos, Bogdan Boteanu, Bogdan Ionescu, and Ioannis A. Kakadiaris. 3D human pose estimation: A review of the literature and analysis of covariates. In Computer Vision and Image Understanding, 2016. 2 +[39] L. Sigal, S. Bhatia, S. Roth, Michael J. Black, and M. Isard. Tracking loose-limbed people. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2004. 3 +[40] Edgar Simo-Serra, A. Quattoni, C. Torras, and F. Moreno-Noguer. A joint model for 2D and 3D pose estimation from a single image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2013. +[41] Carsten Stoll, N. Hasler, Juergen Gall, H. Seidel, and C. Theobalt. Fast articulated motion tracking using a sums of gaussians body model. In International Conference on Computer Vision (ICCV), 2011. 3 +[42] K. Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3 +[43] X. Sun, J. Shang, Shuang Liang, and Y. Wei. Compositional human pose regression. In International Conference on Computer Vision (ICCV), 2017. 3 +[44] H. F. Tung, H. Tung, Ersin Yumer, and K. Fragkiadaki. Self-supervised learning of motion capture. In Advances in Neural Information Processing (NeurIPS), 2017. 3 +[45] G. Varol, D. Ceylan, Bryan C. Russell, Jimei Yang, Ersin Yumer, I. Laptev, and C. Schmid. Bodynet: Volumetric inference of 3D human body shapes. In European Conference on Computer Vision (ECCV), 2018. 3 + +[46] Timo von Marcard, Roberto Henschel, Michael Black, Bodo Rosenhahn, and Gerard Pons-Moll. Recovering accurate 3D human pose in the wild using imus and a moving camera. In European Conference on Computer Vision (ECCV), 2018. 1, 6 +[47] Donglai Xiang, Hanbyul Joo, and Yaser Sheikh. Monocular total capture: Posing face, body, and hands in the wild. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3 +[48] Donglai Xiang, Fabian Prada, Chenglei Wu, and J. Hodgins. Monoclothcap: Towards temporally coherent clothing capture from monocular rgb video. In International Conference on 3D Vision (3DV), 2020. 3 +[49] Bin Xiao, Haiping Wu, and Y. Wei. Simple baselines for human pose estimation and tracking. In European Conference on Computer Vision (ECCV), 2018. 3 +[50] Yuanlu Xu, Song-Chun Zhu, and Tony Tung. Denserac: Joint 3D pose and shape estimation by dense render-and compare. In International Conference on Computer Vision (ICCV), 2019. 2, 3 +[51] S. Yu, Ye Yun, L. Wu, Gao Wenpeng, Fu Yi-li, and Mei Tao. Human mesh recovery from monocular images via a skeleton-disentangled representation. In International Conference on Computer Vision (ICCV), 2019. 3 +[52] A. Zanfir, Eduard Gabriel Bazavan, Hongyi Xu, B. Freeman, R. Sukthankar, and C. Sminchisescu. Weakly supervised 3D human pose and shape reconstruction with normalizing flows. In European Conference on Computer Vision (ECCV), 2020. 3, 7 +[53] A. Zanfir, Elisabella Marinoiu, and C. Sminchisescu. Monocular 3d pose and shape estimation of multiple people in natural scenes: The importance of multiple scene constraints. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 8 +[54] Wang Zeng, Wanli Ouyang, Ping Luo, Wentao Liu, and Xiaogang Wang. 3D human mesh regression with dense correspondence. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 1, 3 +[55] Tianshu Zhang, Buzhen Huang, and Yangang Wang. Object-occluded human shape and pose estimation from a single color image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 \ No newline at end of file diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/images.zip b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f825cc88acc3cfcc6ad14a7ed5092b3326e47cc4 --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f466856311b9282fcde69554c2fd5cd4d0bd18e5ee7e54f22070255a8039aba2 +size 603236 diff --git a/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/layout.json b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c26a637771bae7ffec598e2776f39ab0e00dae70 --- /dev/null +++ b/learningtoregressbodiesfromimagesusingdifferentiablesemanticrendering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc0760e1097b9c34b43320e362a3fce404342bdfe9ee571e90e068e6d75182a +size 283820 diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_content_list.json b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b434c12f0cbde86a4c1bebb3b15c20f248ef31d3 --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac576dc43b287f05a6ef9126da8337eaf900b72fd2d6b11b239dee9925f31991 +size 75725 diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_model.json b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..aacd616246914fc7215f45a5d9d4e944d4cb7626 --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4acaa47846e7005b67dbe08bde82ff8c264ae6b04b6138725279f197b96389cc +size 91449 diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_origin.pdf b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f73ed8d8991b4ff8378b8f3e87864aa3e720b533 --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/6211b5e0-ed07-4ffa-b4ee-bd04e79925b4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9078d2f1e255eb306499d3db988d0c4008b79c9aebecc8e3e84c645872c3169 +size 3050945 diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/full.md b/learningtoremoverefractivedistortionsfromunderwaterimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..977719fed116cdb1dfb9f3f0e4164d2b43045b63 --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/full.md @@ -0,0 +1,285 @@ +# Learning to Remove Refractive Distortions from Underwater Images + +Simron Thapa Nianyi Li Jinwei Ye +Louisiana State University, Baton Rouge, LA 70803, USA +{sthapa5, nli5, jinweiye}@lsu.edu + +# Abstract + +The fluctuation of the water surface causes refractive distortions that severely downgrade the image of an underwater scene. Here, we present the distortion-guided network (DG-Net) for restoring distortion-free underwater images. The key idea is to use a distortion map to guide network training. The distortion map models the pixel displacement caused by water refraction. We first use a physically constrained convolutional network to estimate the distortion map from the refracted image. We then use a generative adversarial network guided by the distortion map to restore the sharp distortion-free image. Since the distortion map indicates correspondences between the distorted image and the distortion-free one, it guides the network to make better predictions. We evaluate our network on several real and synthetic underwater image datasets and show that it out-performs the state-of-the-art algorithms, especially in presence of large distortions. We also show results of complex scenarios, including outdoor swimming pool images captured by drone and indoor aquarium images taken by cellphone camera. + +# 1. Introduction + +Underwater scenes, when observed in air, suffer from strong distortion artifacts due to refraction caused by the wavy water surface. Restoring the true underwater images by removing the refractive distortions can benefit numerous tasks in underwater exploration and outer-space expedition (by extending to remove the atmospheric distortions). + +However, it is non-trivial to remove the refractive distortions because 1) the geometric deformations are highly non-rigid and discontinuous due to the non-linear light transport through the wavy water surface, and 2) fast-evolving waves also cause blurriness in the image. Classical approaches usually take a long sequence of images (or video) of a static underwater scene, and rely on the mean/median images [31, 30] or the "lucky patch" [16, 14], which happens to be free from distortion in a certain frame, to restore the latent distortion-free image. As these methods require + +![](images/fee8da60a6a93453274cb7f3fa603b0d8e05dddd2dd5060abc15d9a2824d2712.jpg) +Figure 1. We design a physics-based distortion-guided network for underwater image correction. Our method predicts the distortion-free image, given three distorted underwater images. + +![](images/3e0d2ab7cae529c7402d430eae6b5c94ba7201d39a9810b9aad2177849c4192f.jpg) + +![](images/1c71f6b35538311145926cd96090d6386729f7a2de1f00df4cc96e4a1e419392.jpg) + +![](images/6ae04e65daf320fa9ed989c05ccf03cd8ef659bd4926284b8983a6ee7af0cab0.jpg) + +video input of a static scene, they cannot be used for images captured on a moving platform (for example, an underwater vehicle). The seminal work of [34] presents a model-based tracking method to undistort underwater images. But their parametric model cannot be easily tuned and applied to arbitrary waves. Most recently, Li et al. [28] propose a learning-based method to correct refractive distortions using a single image. This work demonstrates great potential of using deep neural networks to tackle the challenging problem of refractive distortion removal. But this network does not account for physical constraints and requires a large training set (over 300k images from the ImageNet [10]). + +In this paper, we present the distortion-guided network (DG-Net) for restoring distortion-free underwater images. The key idea is to use a distortion map to guide network training. The distortion map models the pixel displacement caused water refraction. As the distortion map reveals correspondences between the distorted and distortion-free images, we can use it to guide the network to make better predictions. We first use convolutional neural network (CNN) to estimate the distortion map from the refracted image. Specifically, we design training losses that follow the physical model of refractive distortions. We also exploit the temporal consistency of the distortion map by taking three sequential images as input. We use three parallel CNNs + +![](images/ab5401dbb3de881614d1e68b1837d8698b62a40e2b62e97edf63a5cfb969b651.jpg) +Figure 2. The overall architecture of DG-Net. It consists of two subnets: a convolutional network for estimating the refractive distortions (Dis-Net) and a distortion-guided generative adversarial network for restoring the distortion-free image (DG-GAN). Note that we have three CNN networks in Dis-Net which takes each of three inputs. The generator and discriminator of DG-GAN are represented by $\mathcal{G}$ and $\mathcal{D}$ , respectively. $\mathcal{F}$ and $\mathcal{B}$ denotes forward and backward mapping of images. + +to generalize features from each input, and then use recurrent layers to refine the CNN-predicted distortion maps by enforcing the temporal consistency among them. We can use the estimated distortion map to correct slight refractive distortions. Since large distortion are non-invertible (due to many-to-one mapping), we then use a distortion-guided generative adversarial network (GAN) to recover sharp distortion-free image. The distortion map is used to guide the training of both generator and discriminator of the GAN. Our network is trained on a synthetic refracted image dataset, with patterns that resemble the underwater scenes. + +We evaluate the DG-Net on our own synthetic dataset and several real captured underwater image datasets [24, 33, 34]. The results show that our method out-performs the state-of-the-arts [23, 24, 28, 30, 34], especially in presence of large distortions. Compared with the model-based methods [24, 34, 30], we do not need long video sequence of a static underwater scene to achieve accurate reconstruction. Although we still take three images to exploit the temporal constraints, the images can be captured with the burst mode in a very short time interval. Our method can therefore be used for dynamic scenes such as videos from a flying drone and videos of aquatic scenes with moving objects. Compared with the learning-based methods [23, 28], our network requires fewer training data (around one tenth in size), but achieves better accuracy in presence of large distortions and generalizes well on real scenes. + +# 2. Related Work + +Recovering underwater images. The problem of recovering faithful underwater images is critical to underwater imaging. Early solutions [14, 27] take the mean/median of a distorted image sequence to approximate the latent distortion-free image. Although these methods work well on weak distortions, the mean image becomes blurry in + +presence of large distortions. Another popular class of methods rely on finding and stitching the "lucky patches" to recover the latent distortion-free image. Many solutions such as clustering [11, 12], manifold embedding [14], and Fourier-based averaging [39] are proposed to locate the "lucky patch" in the input sequence. The seminal work of [34, 35] presents a model-based tracking method to restore underwater images. Oreifej et al. [30] propose a two-step algorithm that first iteratively aligns the distorted images to the mean image and then denoises the estimation with low-rank constraint. More recently, James et al. [24] propose a compressed sensing (CS) solver for underwater image restoration by tracking a few salient feature points across the frames of a video sequence of the submerged scene. All these methods require a long sequence of distorted images ( $\sim 60$ to 100 frames) as input and cannot work for single or few images. Li et al. [28] propose a generative adversarial network to correct refractive distortions using a single image. In this work, our proposed network considers the physical model of refractive distortions, and use the distortion maps as training guidance. Our method can recover high quality distortion-free image with three input images. + +Estimating pixel displacement between images. The problem of estimating pixel displacement has been extensive studied in motion/flow estimation. Most methods [19, 2] in this category consider rigid motion and estimate the displacement vectors through matched corresponding features. Recent trend is to use deep neural networks to tackle this problem. The FlowNet [5, 13, 29] is proposed to estimate the shift between two consecutive images. Kanazawa et al. [25] propose the WarpNet to match invariant features between cross-category images. However, the refractive distortions caused by wavy water is highly non-rigid and it is difficult to find invariant features from the distorted images. Xue et al. [41] adapt the classical opti + +cal flow to estimate small refractive distortions caused by hot air or gas. In this work, we propose a physically constrained convolutional network with recurrent layers to estimate large refractive distortions caused by wavy water. + +Image-to-image generation. The generative adversarial networks (GANs) [17] have shown great success in solving image-to-image generation problems, such as image superresolution [40, 4, 45, 38], denoising [47, 43, 6], deblurring [26, 46], inpainting [9, 37], etc. The key idea is to use an adversarial discriminator network (discriminator) to pit against the generative network (generator) and force the generator to produce realistic images. Most existing GANs are trained with images of natural scenes [28, 3, 42, 8] or human faces [44, 36, 20], and usually is trained on a large dataset (with millions of images). In contrast, our GAN is trained with patterns that resemble the underwater environment. In addition, we use the refractive distortions to guide the training of both generator and discriminator. As a result, our network requires fewer training data ( $\sim$ 50k images), but can achieve better accuracy. + +# 3. Proposed Method + +We consider the setting that a camera is looking at the underwater scene through the wavy water surface. The captured images therefore suffer from refractive distortions. Assume $J$ is the true image of the underwater scene unaffected by the water waves, our goal is to estimate a distortion-free image $\hat{J}$ that appears close to $J$ from the captured distorted images $I$ . + +We propose a distortion-guided network (DG-Net) to tackle this problem. Specifically, ground truth distortion maps are used to guide the training of our networks. The overall structure of our network is shown in Fig. 2. Our DG-Net has two subnets: a convolutional network for estimating the refractive distortions (Section 3.1) and a distortion-guided generative adversarial network for restoring the distortion-free image (Section 3.2). The two subnets are trained separately. Notice that although our network takes three sequential images $\{I^t\}_{t=1}^3$ as input, we only output one distortion-free image for the last frame $(I^3)$ . The first two frames are used for enforcing the temporal consistency of our distortion estimation. Unlike classical methods that require a video of static scene, our method can be used for moving scenes as the three sequential images can be captured with the burst mode in a very short time interval. + +# 3.1. Distortion Estimation + +We first use a distortion estimation network (Dis-Net) to predict the distortion map between the input distorted image and the latent distortion-free image. Our Dis-Net considers the physical model of refractive distortions and use temporal constraints to improve the estimation accuracy. + +![](images/53fd1af64380b0fefb086eb6898515f63a859293fffa9604be69e794f985156e.jpg) +Figure 3. Illustration of refractive distortion. $I$ and $J$ are distorted and distortion-free images respectively; $\mathbf{p}_1$ , $\mathbf{q}_1$ and $\mathbf{p}_2$ , $\mathbf{q}_2$ are two pairs of corresponding pixels; $h_0$ is the average water surface height, and $h_1$ is the height at the pixel $\mathbf{p}_1$ ; $\mathbf{n}_1$ and $\mathbf{n}_2$ are normal vectors; $\mathbf{w}_1$ and $\mathbf{w}_2$ are distortion vectors. + +Refractive distortion model. Given a distorted image $I$ and the true distortion-free image $J$ , we define a distortion map $W = \{\mathbf{w}_i\}_{i=1}^M$ (where $\mathbf{w}_i \in R^2$ is per-pixel distortion vector and $M$ is the total number of pixels) to represent the pixel displacement between $I$ and $J$ caused by the refraction of water-air interface. $\mathbf{w}_i$ can then be written as: + +$$ +\mathbf {w} _ {i} = \mathbf {q} _ {i} - \mathbf {p} _ {i} \tag {1} +$$ + +where $\mathbf{p}_i\in R^2$ is a pixel in $I$ , and $\mathbf{q}_i\in R^2$ is a pixel in $J$ . $\mathbf{q}_i$ maps to $\mathbf{p}_i$ through refraction. + +Since the refractive distortion is caused by the fluctuation of water surface, the amount of distortion (or pixel placement) is naturally related to the water surface height. By applying the first-order approximation of the Snell's law, Tian and Narasimhan derive that the distortion vector $\mathbf{w}_i$ has linear relationship with the gradient of surface height [34]. The mapping from the surface height map $H = \{h_i\}_{i=1}^M$ (where $h_i \in R$ is a height value) to the distortion map $W$ can be written as: + +$$ +W = f (H) = \alpha \nabla H \tag {2} +$$ + +where $\nabla . = [\frac{\partial}{\partial x},\frac{\partial}{\partial y} ]$ is the gradient operator, and $\alpha = h_0(1 - \frac{1}{n})$ is a constant scalar determined by the average surface height $h_0$ and the refractive index $n$ . The inverse mapping from $W$ to $H$ can then be found by integrating the distortion vectors: + +$$ +\begin{array}{l} H = f ^ {- 1} (W) = h _ {0} + \iint_ {x, y} \nabla H d _ {x} d _ {y} \\ = \frac {\alpha \cdot n}{n - 1} + \iint_ {x, y} \frac {W}{\alpha} d _ {x} d _ {y} \tag {3} \\ \end{array} +$$ + +As surface normals are related to the 2D height gradients, we can also derive the normal map $N = \{\mathbf{n}_i\}_{i=1}^M$ (where $\mathbf{n}_i \in R^3$ is a normal vector) from the distortion map $W$ as: + +$$ +\mathbf {n} _ {i} = \gamma_ {i} \left[ - \frac {\mathbf {w} _ {i} (x)}{\alpha}, - \frac {\mathbf {w} _ {i} (y)}{\alpha}, 1 \right] \tag {4} +$$ + +where $\gamma_{i} = 1 / \| \mathbf{n}_{i}\|$ is a normalization factor. + +Given the surface height map $H$ and the distortion-free image $J$ , the ground truth distortion map $W$ can be found by backward tracing rays from the image plane through the water surface to the underwater image $J$ , as shown in Fig. 3. We use the ground truth distortion maps as well as physics-based losses derived from our refraction model to guide the training of the Dis-Net. + +Network structure. The Dis-Net takes three distorted images $\{I_{t + 1}^3\}$ as input, and output one distortion map prediction $W$ for the last frame $(I^3)$ . The network consists of three concatenated convolutional neural networks (CNNs) followed by two recurrent layers (see Fig. 2). + +Note that our network can be easily modified to take arbitrary number of images (by adding or reducing the CNN branches). We find that three images are sufficient to achieve decent performance even in presence of large distortions. Adding more input images results in more network parameters, but the performance gain is marginal. + +The structure of a CNN branch is shown in Fig. 2. Each CNN estimate a distortion map from one distorted image. The encoder of our CNN is made up of standard stacked convolutional layers with max-pooling. The decoder uses variational refinement [13] to preserve fine details in the distortion map. Specifically, at each layer, we concatenate the transpose-convolved feature map, the corresponding feature map from the encoder, and an intermediate distortion map output by the current feature map. The intermediate distortion maps are compared with downsampled ground truth maps using our training losses. + +The three distortion maps $\{\hat{W}^t\}_{t=1}^3$ output from the CNNs are concatenated as a temporal sequence and fed into two stacked convolutional LSTM layers with batch normalization. The convolutional LSTM layers transmit hidden states from previous time frames to learn the temporal dependencies [32]. By exploiting the temporal consistency among the distortion maps, the prediction accuracy is further improved, which is shown in the ablation study (see Section 4.3). + +Loss functions. The Dis-Net takes ground truth distortion free image $(J)$ , distortion map $(W)$ and surface height map $(H)$ for training. We design loss functions following the refractive distortion model. Our loss functions consist of three terms: the distortion map loss, the refraction loss, and the consistency loss. + +The distortion map loss has three components. For each component, we use the scale-invariant error function [15] to measure the difference between two distortion maps: + +$$ +\varepsilon (W, W ^ {*}) = \frac {1}{M} \sum_ {i = 1} ^ {M} \left(\mathbf {w} _ {i} - \mathbf {w} _ {i} ^ {*}\right) ^ {2} - \frac {1}{2 M ^ {2}} \left(\sum_ {i = 1} ^ {M} \left(\mathbf {w} _ {i} - \mathbf {w} _ {i} ^ {*}\right)\right) ^ {2} \tag {5} +$$ + +where $\mathbf{w}_i$ is a distortion vector in $W$ ; $\mathbf{w}_i^*$ is a distortion vector in $W^*$ ; $M$ is the total number of pixels. + +![](images/ed54b0ef8ffc8dda7cdee3943e947263f384ea427a381cd12bacdc18749849fb.jpg) +Figure 4. Illustration of forward $\mathcal{F}$ and backward mapping $\mathcal{B}$ . In presence of large distortions, backward mapping alone with the correct distortion map are insufficient to obtain an accurate distortion-free image. + +Intuitively, we compare the predicted distortion map $\hat{W}$ with the ground truth one and calculate the error $\varepsilon(W, \hat{W})$ . Since the distortion map is directly related to water surface depth and normal, we consider two additional errors that are constrained by the physical models. Specifically, by applying Eq. 2 to $H$ , we can obtain another distortion map $W_{H}$ converted from the ground truth height. We compare $\hat{W}$ with $W_{H}$ to enforce their consistency. By applying Eq. 3 and Eq. 4 to $\hat{W}$ , we can map our predicted distortion map to its corresponding height map $\hat{H}$ and normal map $\hat{N}$ . We can then apply backward ray tracing and obtain a new distortion map $W_{\hat{H}}$ . We compare $W_{\hat{H}}$ with the ground truth map $W$ . Since our converted height $\hat{H}$ is accurate, the two map should be consistent. In sum, our distortion map loss can be written as $\mathcal{L}_W = \alpha_1 \varepsilon(W, \hat{W}) + \alpha_2 \varepsilon(W_H, \hat{W}) + \alpha_3 \varepsilon(W, W_{\hat{H}})$ , where $\alpha_{1,2,3}$ are weighting factors. + +The refraction loss minimizes the difference between the input image $I$ and the distorted image $I_{\hat{W}}$ traced with the height map $\hat{H}$ mapped from $\hat{W}$ . We use the $l2$ norm as error metric: $\varepsilon_{l2}(I, I^*) = \frac{1}{M} \sum (I - I^*)^2$ . Our refraction loss is therefore written as $\mathcal{L}_R = \varepsilon_{l2}(I, I_{\hat{H}})$ . + +The consistency loss enforces consistent estimations from the three parallel CNNs. As three inputs $\{I^t\}_{t=1}^3$ are captured in a short time interval, we assume their latent distortion-free images are the same. Specifically, we use the predicted distortion maps $\{\hat{W}^t\}_{t=1}^3$ to undistort their corresponding inputs by applying Eq. 1 and obtain $\{\hat{J}_{\hat{W}^t}^t\}_{t=1}^3$ . We use the $l2$ error to compare pairwise difference among $\{\hat{J}_{\hat{W}^t}^t\}_{t=1}^3$ . The consistency loss is therefore written as $\mathcal{L}_C = \frac{1}{3}\sum_{t,s=1}^{3}\varepsilon_{l2}(\hat{J}_{\hat{W}^t}^t,\hat{J}_{\hat{W}^s}^s)$ . + +We combine $\mathcal{L}_W$ , $\mathcal{L}_R$ , and $\mathcal{L}_C$ to train the Dis-Net. The training is performed end-to-end. The CNNs and the recurrent layers use different sets of weights for the losses. + +# 3.2. Image Restoration + +Given the estimated distortion map $\hat{W}$ , we propose a distortion-guided adversarial network (DG-GAN) to estimate the distortion-free image $\hat{J}$ . By directly applying $\hat{W}$ to undistort the input distorted image $I$ , we can obtain an intermediate image $\hat{J}_{\hat{W}} = \mathcal{B}(I, \hat{W})$ , where $\mathcal{B}$ refers to backward mapping: + +$$ +\mathcal {B} (I, W) = I (\mathbf {p} - \mathbf {w}) \tag {6} +$$ + +We use this warped image $\hat{J}_{\hat{W}}$ as input to the DG-GAN. Although $\hat{J}_{\hat{W}}$ appear less distorted than $I$ , some large distortions cannot be inverted as several pixels in $J$ may map to one pixel in $I$ through refraction as shown in Fig. 4. + +Our DG-GAN has similar structure to the conditional GAN [23], but adopts distortion-guided training losses. The generator $\mathcal{G}$ uses the "U-Net" as base architecture. It has 6 convolutional layers in the encoder and 6 deconvolutional layers with skip connections in the decoder. $\mathcal{G}$ 's goal is to produce distortion-free images $\hat{J}$ that cannot be distinguished from "real" by the discriminator. $\mathcal{G}$ is trained with both the $l1$ and $l2$ losses that force its output to appear similar to the ground truth distortion-free image $J$ . The $l1$ loss encourages less blurring and help to generate sharper image. In addition, we can apply the ground truth distortion map $W$ on $\mathcal{G}$ 's output to obtain a distorted image $\hat{I}_{\mathcal{G}} = \mathcal{F}(\mathcal{G}(\hat{J}_{\hat{W}}), W)$ , where $\mathcal{F}$ refers to forward mapping: + +$$ +\mathcal {F} (I, W) = I (\mathbf {p} + \mathbf {w}) \tag {7} +$$ + +If $\mathcal{G}$ 's output appears similar to $J$ , then $\hat{I}_{\mathcal{G}}$ should be consistent with the input distorted image $I$ . The loss function for training $\mathcal{G}$ is therefore written as: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {G}} = \frac {1}{M} \left(\sum | \mathcal {G} (\hat {J} _ {\hat {W}}) - J |\right. \\ + \sum \left(\mathcal {G} \left(\hat {J} _ {\hat {W}}\right) - J\right) ^ {2} + \sum \left(\hat {I} _ {\mathcal {G}} - I\right) ^ {2}) \tag {8} \\ \end{array} +$$ + +The discriminator $\mathcal{D}$ is adversarially trained to identify the "fake" hallucinated images from generator. Our $\mathcal{D}$ is formed with 6 modules of the form convolution-BatchNorm-ReLu modules [22]. Besides learning a mapping from the input $\hat{J}_{\hat{W}}$ to the distortion-free image $J$ , the network also learns to predict whether the distortion constraint is satisfied. Specifically, we apply the ground truth distortion map $W$ to $\hat{J}_{\hat{W}}$ , the discriminator $\mathcal{D}$ then favors predictions that appear closer to input distorted image $I$ , instead of the forward mapping result $\hat{I}_{\mathcal{G}}$ of $\mathcal{G}$ 's output. The objective function of our DG-GAN can be written as: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {G A N}} (\mathcal {G}, \mathcal {D}) = E [ \log \mathcal {D} (\hat {J} _ {\hat {W}}, J) ] + E [ \log \mathcal {D} (\mathcal {F} (\hat {J} _ {\hat {W}}, W), I) ] \\ + E [ \log (1 - \mathcal {D} (\hat {J} _ {\hat {W}}, \mathcal {G} (\hat {J} _ {\hat {W}})) ] \\ + E \left[ \log \left(1 - \mathcal {D} \left(\mathcal {F} \left(\hat {J} _ {\hat {W}}, W\right), \hat {I} _ {\mathcal {G}}\right)\right) \right] \tag {9} \\ \end{array} +$$ + +The corrected distortion-free image is then optimized as $\hat{J} = \arg \min_{\mathcal{G}}\max_{\mathcal{D}}\mathcal{L}_{\mathrm{GAN}}$ + +![](images/603c740e1706cb043fe5e381633bc254f900af5a84d038825e93ba1d4e266162.jpg) +Figure 5. Sample images of our synthetic underwater image dataset. From left to right, we show the ground truth (GT) distortion-free image, GT height map, GT distortion map, and the refraction image. + +![](images/571c7dbe0a6af00c6c2974bf70771035edd16c5bbe2917e91784a55213f26c87.jpg) + +![](images/81afee73ca3481328c8107a284b3dedcdca99b42bfc1a20a3b475289412a4ba1.jpg) + +# 4. Experiments + +In this section, we evaluate our DG-Net on both synthetic and real underwater image datasets. Specifically, we compare our method with competitive state-of-the-art methods, and perform ablation studies on our network. + +# 4.1. Network Training + +Data preparation. Our DG-Net is trained on a synthetic underwater dataset. We generate the dataset using physics-based modeling and rendering. Specifically, we use partial derivative equations derived from the Navier-Stokes to model the water waves. We consider waves with various heights and fluctuations to create distortions of different scales. To show that our method is robust to different types of water wavefronts, we simulate three types of waves: ripple waves, ocean waves, and Gaussian waves. More details of these wave equations can be found in the supplementary material. Fig. 5 shows exemplary water distortion images and their corresponding distortion maps and height maps. + +The distortion-free underwater images are chosen from the Describable Textures Dataset (DTD) [7]. DTD contains a broad range of realistic texture images. We select a subset from the DTD, whose appearance resembles the underwater scenes (for example, pool tiles, sea plants, pebbles, etc.). In addition, we add $\sim 500$ various text images to our set as underwater patterns. Altogether, our dataset contains $\sim 63k$ distorted refraction images, generated from 6354 unique distortion-free images (or reference pattern). We keep 10 consecutive frames per wave. For each refraction image, we provide the ground truth distortion-free image, distortion map, and height map of the water surface. We divide our dataset as $70\%$ for training (43,600), $15\%$ for validation (9980), and $15\%$ for testing (9960). Note that all the waves and reference patterns are non-overlapping among the training set, validation set, and testing set. + +![](images/da1d43bdaed6e0da6954a9d2e7653980eaebbf4d3795765b73ebe7cc4d614478.jpg) +Figure 6. Visual comparison with the state-of-the-arts on real captured datasets: the TianSet [34] (top), the JamesSet [24] (middle), and the ThapaSet [33] (bottom). Here Tian-10, Oreifej-10, and James-10 refer to using a 10-frame sequence as input to the methods [34], [30], and [24], respectively. Please see our supplementary material for more visual comparison results. + +Implementation details. We implement our network with TensorFlow [1]. The overall network (DG-Net) has around 50 million trainable parameters, which includes 3.1 million for the Dis-Net, 41 million for the generator of DG-GAN, and 6.9 million for the discriminator of DG-GAN. All computations are performed with a desktop computer with Xeon E5-2620 CPU and two NVIDIA GTX 1080 Ti GPUs. + +The DG-Net is trained in two steps. We first train the distortion estimation network (Dis-Net) on the synthetic training set. We set the weights $\sim 0.55, \sim 0.25$ , and $\sim 0.15$ for the distortion map loss $\mathcal{L}_W$ , refraction loss $\mathcal{L}_R$ , and consistency loss $\mathcal{L}_C$ , respectively. We use the Adam optimizer to train the network. We use batch size 64 for both training and validation with the learning rate of $10^{-4}$ . We train the network with the loss functions described in Section 3.1 for 60 epochs until converge. + +We then train the distortion-guided generative adversarial network (DG-GAN) for restoring the distortion-free image. We first use the estimated distortion map to backward map the distorted image to an intermediate undistorted image, and then use it as input to the DG-GAN. We use the Adam optimizer to train DG-GAN with a fixed learning rate of $2 \times 10^{-4}$ . We train the network with the loss functions described in Section 3.2 for around 400 epochs that suffices to produce good predictions. + +# 4.2. Comparison with the State-of-The-Arts + +We compare our methods with the state-of-the-art underwater image restoration methods [34, 30, 23, 28, 24]. Specifically, Tian and Narasimhan [34], and Oreifej et al. [30] are two classical model-based approaches. Tian and + +Narasimhan[34] use parametric models of distortion to restore the images. Oreifej et al. [30] perform per-frame registration with the mean image. James et al. [24] is a recently proposed compressed sensing (CS) solver for underwater image restoration. All these methods require a long input sequence to achieve good performance. + +Isola et al. [23] and Li et al. [28] are learning-based methods for image generation/restoration. Isola et al. [23] is a general-purpose pixel-to-pixel image generation network. It has good performance on style transfer, image coloring and inpainting. Li et al. [28] is an adversarial network specifically for restoring refracted images, trained with $\sim 300\mathrm{k}$ images from the ImageNet. + +Testing datasets. We perform experiments on four dataset (one synthetic and three real): 1) SynSet: our own synthetic dataset with 9960 testing images (generated with 996 different reference patterns); 2) TianSet: a real captured dataset by Tian and Narasimhan [34]; 3) JamesSet: a real captured dataset by James et al. [24], in which we test on three videos: Cartoon, Elephant, and Eye; and 4) ThapaSet: a real captured dataset by Thapa et al. [33]. The TianSet contains four real captured videos with refractive distortions. The four sequences use different reference patterns and each sequence has 61 frames. In our experiments, we also test Tian et al. [34], Oreifej et al. [30] and James et al. [24] on shorter sequences with 10 consecutive frames. We take three real underwater scenes from the ThapaSet. We also test [34], [30], and [28] on the ThapaSet for further comparisons. We perform both qualitative and quantitative evaluations on the image restoration results. + +
MethodsPNSR↑SSIM↑SSD↓SSDG↓
SynSetIsola et al.18.6800.3000.01360.0068
Li et al.19.2500.4250.01180.0055
DG-Net (Ours)24.0690.8000.00390.0019
TianSetTian-6116.7780.8100.02100.0107
Tian-1016.4020.7400.02290.0112
Oreifej-6120.4570.8200.00900.0047
Oreifej-1015.8840.5500.02580.0125
Isola et al.10.0080.4000.09980.0490
Li et al.10.0870.5100.09850.0486
James-6120.2230.7530.00950.0049
James-1016.5560.7210.02210.0109
DG-Net (Ours)19.5860.8400.01100.0056
JamesSetTian-6117.0990.7870.01950.0095
Tian-1015.0860.5740.03100.0153
Oreifej-6115.2720.7650.02970.0141
Oreifej-1014.9480.5590.03150.0150
Li et al.12.2260.6620.05990.028
James-6120.7790.9270.00840.0041
James-1016.7850.5120.02090.0098
DG-Net (Ours)20.2270.9020.00950.0052
ThapaSetTian-6123.1870.8270.00480.0029
Tian-1022.0760.9090.00620.0031
Oreifej-6123.3720.8750.00460.0025
Oreifej-1020.5060.9030.00890.0034
Li et al.21.4260.9500.00720.0020
James-6126.7780.9480.02100.0013
James-1023.9790.9350.04010.0019
DG-Net (Ours)26.0210.9510.02510.0013
+ +Table 1. Quantitative comparison with the state-of-the-arts. + +Evaluation metrics. We use four standard image quality/ similarity metrics for quantitative evaluation: 1) Peak Signal-to-Noise Ratio (PSNR) [21], 2) Structural Similarity Index (SSIM) [18], 3) Sum Squared Difference (SSD) [30], and 4) SSD in Gradient (SSDG) [30]. See our supplementary material for equations of these metrics. + +Comparison results. Fig. 6 shows the qualitative comparisons between our method and the state-of-the-arts. We show comparison results on three real captured datasets. Please see our supplementary material for more visual comparison results on both synthetic and real datasets. Note that here we show results for Tian and Narasimhan [34], Oreifej et al. [30], and James et al. [24] with 10 input frames (referred to as Tian-10, Oreifej-10 and James-10 in Fig. 6). We can see that their recovered images are severely downgraded because the input sequence is too short. We can also see that our method, which uses only three input frames, outperforms all the other methods in terms of distortion correction capacity and image sharpness, and produces results with the best visual quality. For qualitative comparisons with [34, 30, 24] using 61 input frames, please refer to our supplementary material. + +![](images/660f03117a9b96c8c1206356c1eefa3e043ebaf89d0b46b41b70b70ef6b206c0.jpg) +Figure 7. Comparison on the "in-the-wild" data. The top two rows are from the aquarium scene captured by a cellphone camera. The bottom row is from the pool scene captured by a drone camera. + +Table 1 shows quantitative comparisons of all methods on both the synthetic and real captured datasets (SynSet, TianSet, JamesSet and ThapaSet). For fair comparison, Isola et al. [23] is trained on our dataset. We can see that this general purpose GAN [23] does not work well on refractive distortion correction. Our method achieves the best performance on most of the metrics. It's worth noting that in TianSet, the PSNR of our results is lower than some model-based methods [30, 24] with 61 input frames on several datasets because the PSNR favors blurry images. From the qualitative comparison, we can see that our results are much sharper than those methods and in fact have better visual appearance. Also, some of our results have higher SSIM but lower PSNR. This is because PSNR and SSIM have different degrees of sensitivity to different forms of image degradation. For the task of distortion correction, the estimated distortion-free might have slight misalignment. As our results are usually sharp, such misalignment may lead to drastic decrease in PSNR. On the other hand, SSIM is window-based and less sensitive to the misalignment. + +"In-the-wild" experiments. The existing methods refractive distortion correction [24, 34, 30] are mostly tested on static and planar image patterns because they require long sequence to restore the underwater image. However, in real scenarios, either the viewing camera or the underwater objects might be moving. To evaluate the robustness of our method on these challenging scenarios, we perform experiments under two settings 1) a moving camera looking at a static underwater scene and 2) a stationary camera looking at a dynamic underwater scene. For the first setting, we use the DJI Mavic Mini drone camera to capture videos (at 60 fps) of an outdoor swimming pool with static underneath patterns (see Fig. 1). For the second setting, we + +
MethodsImage Restoration
PSNR↑SSIM↑SSD↓SSDG↓
Dis-NetW15.0100.3580.03150.0162
Dis-NetR17.8530.4070.01640.0089
Dis-NetC18.0900.4220.01550.0077
Dis-Net20.0150.6100.00990.0052
DG-Net24.0690.8000.00390.0019
+ +use a cellphone camera to capture videos (at 120 fps) of an indoor aquarium with swimming fish. We compare our results with Li et al. [28] and James et al. [24] (with 10 input frames). The results are shown in Fig. 7 (more results are included in the supplementary material). We can see that our method works well on these challenging scenarios. In particular, our restoration results have consistent fish shape in the aquarium scenes. While Li et al. [28] fails to correct some distortions, and results of James et al. [24] are blurry. + +# 4.3. Ablation Studies + +Effect of the physical constrains. We first perform ablative experiments on the physics-based loss terms described in Section 3.1 to show their effectiveness. We compare our full network (DG-Net) with the Dis-Net (without the distortion-guided GAN), and three variants of the Dis-Net: 1) $\mathrm{Dis - Net}_W$ , which removes the last two terms of $\mathcal{L}_W$ (notice that these terms are constrained by our physical model); 2) $\mathrm{Dis - Net}_R$ , which removes the refraction loss $\mathcal{L}_R$ in Dis-Net; and 3) $\mathrm{Dis - Net}_C$ , which removes the consistency loss $\mathcal{L}_C$ in Dis-Net. The quantitative comparisons are shown in Table 2. Qualitative comparisons are shown in our supplementary material. We can see that all loss terms contribute to improve our network performance. + +Effect of the temporal constraint. To evaluate the effect of the temporal constraint, we create a single input version (DG-Net-S) of our full network by removing the recurrent layers and keeping only one CNN branch. Here we compare with Li et al. [28], as it takes a single image as input. We perform experiments on the SynSet. In addition to the recovered images, we also compare the estimated distortion map. We use the root mean square error (RMSE) and the absolute relative error (Abs Rel) to evaluate the distortion map estimation. The quantitative comparison is shown in Table 3. We can see that our full network achieves the best performance. Even our single input version achieves better result than Li et al. [28]. We therefore conclude that using the recurrent layer to exploit temporal consistency helps improve the performance. + +Effect of refraction distortion constraint. To evaluate the effect of using distortion map as guidance, we create two variants of our network: 1) our network without distortion guidance (noted as ours w/o DG) and 2) our network with- + +Table 2. Quantitative ablation on physics-based loss terms. + +
MethodsDistortion MapImage Restoration
RMSE↓AbsRel↓PSNR↑SSIM↑SSD↓SSDG↓
Li et al.0.10890.08219.2510.4250.01180.0055
DG-Net-S0.08720.07021.1980.5000.00760.0041
DG-Net0.06240.03824.0690.8000.00390.0019
+ +Table 3. Quantitative ablation on the temporal consistency. + +![](images/03cb7eb10778fe06a52899d1b73aac011929d69422ee6f9b926c0905a4e0d7ef.jpg) +Figure 8. Comparisons with respect to the distortion levels. + +out the DG-GAN (that leaves the Dis-Net alone). We compare our full network with the two variants, as well as Li et al. [28] and Isola et al. [23]. Experiments are performed on refracted images with different distortion levels. We categorize the SynSet into seven distortion levels (where level 0 indicates distortion-free, and level 7 indicates the strongest distortions). We quantify the distortion level using the average magnitude of the distortion map of the input image. Fig. 8 compares the PSNR of recovered images from all methods at different distortion levels. See our supplementary material for details on how we compute the distortion levels and the visual comparison results. We can see that, in contrast to the other methods without distortion guidance, our method stays relatively robust for all distortion levels. Although certain distortions still persist when the input images have high level of distortions, our method still largely improve the image quality and make the underwater scene discernible. This is especially important for text scenes. + +# 5. Conclusions + +We presented a physically constrained distortion-guided network (DG-Net) for correcting refractive distortions. We first use a convolutional network that exploits the physical model of refractive distortions for estimating the distortion map. We then use a GAN to restore sharp distortion-free image by using the estimated distortion map as guidance. Experimental results demonstrated that our method generalizes well on real scene and has the capacity of handling challenging scenarios. + +# Acknowledgements + +This project is supported by NSF award CRII-1948524, Louisiana Board of Regents grant LEQSF(2018-21)-RD-A-10, and a gift from DGene. + +# References + +[1] Martin Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In USENIX Symposium on Operating Systems Design and Implementation (OSDI), 2016. 6 +[2] John L. Barron, David J. Fleet, and Steven S. Beauchemin. Performance of optical flow techniques. International Journal of Computer Vision (IJCV), 12(1):43-77, 1994. 2 +[3] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018. 3 +[4] Adrian Bulat, Jing Yang, and Georgios Tzimiropoulos. To learn image super-resolution, use a GAN to learn how to do image degradation first. In Proceedings of the European conference on computer vision (ECCV), 2018. 3 +[5] Daniel J. Butler, Jonas Wulff, Garrett B. Stanley, and Michael J. Black. A naturalistic open source movie for optical flow evaluation. In Proceedings of the European Conference on Computer Vision (ECCV), 2012. 2 +[6] Jingwen Chen, Jiawei Chen, Hongyang Chao, and Ming Yang. Image blind denoising with generative adversarial network based noise modeling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 3 +[7] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. 5 +[8] Bo Dai, Sanja Fidler, Raquel Urtasun, and Dahua Lin. Towards diverse and natural image descriptions via a conditional GAN. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 3 +[9] Ugur Demir and Gozde Unal. Patch-based image inpainting with generative adversarial networks. arXiv preprint arXiv:1803.07422, 2018. 3 +[10] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. 1 +[11] Arturo Donate, Gary Dahme, and Eraldo Ribeiro. Classification of textures distorted by waterwaves. In Proceedings of the International Conference on Pattern Recognition (ICPR), 2006. 2 +[12] Arturo Donate and Eraldo Ribeiro. Improved reconstruction of images distorted by water waves. In International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISAPP), 2006. 2 +[13] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. FlowNet: Learning optical flow with convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2015. 2, 4 + +[14] Alexei Efros, Volkan Isler, Jianbo Shi, and Mirkó Visontai. Seeing through water. In Advances in Neural Information Processing Systems, 2005. 1, 2 +[15] David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multi-scale deep network. In Advances in Neural Information Processing Systems, 2014. 4 +[16] David L. Fried. Probability of getting a lucky short-exposure image through turbulence. JOSA, 68(12):1651-1658, 1978. 1 +[17] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014. 3 +[18] Alain Hore and Djemel Ziou. Image quality metrics: PSNR vs. SSIM. In Proceedings of International Conference on Pattern Recognition (ICPR), 2010. 7 +[19] Berthold K. P. Horn and Brian G. Schunck. Determining optical flow. In *Techniques and Applications of Image Understanding*. International Society for Optics and Photonics, 1981. 2 +[20] Rui Huang, Shu Zhang, Tianyu Li, and Ran He. Beyond face rotation: Global and local perception GAN for photorealistic and identity preserving frontal view synthesis. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 3 +[21] Quan Huynh-Thu and Mohammed Ghanbari. Scope of validity of PSNR in image/video quality assessment. *Electronics letters*, 44(13):800–801, 2008. 7 +[22] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, pages 448-456, 2015. 5 +[23] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 2, 5, 6, 7, 8 +[24] Jerin Geo James, Pranay Agrawal, and Ajit Rajwade. Restoration of non-rigidly distorted underwater images using a combination of compressive sensing and local polynomial image representations. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2019. 2, 6, 7, 8 +[25] Angjoo Kanazawa, David W Jacobs, and Manmohan Chandraker. WarpNet: Weakly supervised matching for single-view reconstruction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. 2 +[26] Orest Kupyn, Volodymyr Budzan, Mykola Mykhailych, Dmytro Mishkin, and Jiří Matas. DeblurGAN: Blind motion deblurring using conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. 3 +[27] Iosif M. Levin, Victor V. Savchenko, and Vladimir Ju. Osadchy. Correction of an image distorted by a wavy water surface: laboratory experiment. Applied Optics, 47(35):6650-6655, 2008. 2 +[28] Zhengqin Li, Zak Murez, David Kriegman, Ravi Ramamoorthi, and Manmohan Chandraker. Learning to see through tur + +bulent water. In Proceedings of IEEE Winter Conference on Applications of Computer Vision (WACV), 2018. 1, 2, 3, 6, 8 +[29] Peter Muller and Andreas Savakis. Flowmetry: An optical flow and deep learning based approach to visual odometry. In Proceedings of IEEE Winter Conference on Applications of Computer Vision (WACV), 2017. 2 +[30] Omar Oreifej, Guang Shu, Teresa Pace, and Mubarak Shah. A two-stage reconstruction approach for seeing through water. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011. 1, 2, 6, 7 +[31] R Shefer, M Malhi, and A Shenhar. Waves distortion correction using cross correlation. Tech. Report, Israel Institute of Technology, 2001. 1 +[32] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. Advances in Neural Information Processing Systems, pages 802-810, 2015. 4 +[33] Simron Thapa, Nianyi Li, and Jinwei Ye. Dynamic fluid surface reconstruction unsing deep neural network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2, 6 +[34] Yuandong Tian and Srinivasa G. Narasimhan. Seeing through water: Image restoration using model-based tracking. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2009. 1, 2, 3, 6, 7 +[35] Yuandong Tian and Srinivasa G. Narasimhan. A globally optimal data-driven approach for image distortion estimation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010. 2 +[36] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning GAN for pose-invariant face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. 3 +[37] Weiyue Wang, Qiangui Huang, Suya You, Chao Yang, and Ulrich Neumann. Shape inpainting using 3D generative adversarial network and recurrent convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 3 +[38] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. EsrGAN: Enhanced super-resolution generative adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), 2018. 3 +[39] Zhiying Wen, Donald Fraser, Andrew Lambert, and Hongdong Li. Reconstruction of underwater image by bispectrum. In Proceedings of IEEE International Conference on Image Processing (ICIP), 2007. 2 +[40] You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. TempoGAN: A temporally coherent, volumetric GAN for superresolution fluid flow. ACM Transactions on Graphics (TOG), 37(4):1-15, 2018. 3 +[41] Tianfan Xue, Michael Rubinstein, Neal Wadhwa, Anat Levin, Fredo Durand, and William T. Freeman. Refraction wiggles for measuring fluid depth and velocity from video. In Proceedings of the European Conference on Computer Vision (ECCV), 2014. 2 + +[42] Jianwei Yang, Anitha Kannan, Dhruv Batra, and Devi Parikh. Lr-GAN: Layered recursive generative adversarial networks for image generation. arXiv preprint arXiv:1703.01560, 2017. 3 +[43] Qingsong Yang, Pingkun Yan, Yanbo Zhang, Hengyong Yu, Yongyi Shi, Xuanqin Mou, Mannudeep K Kalra, Yi Zhang, Ling Sun, and Ge Wang. Low-dose ct image denoising using a generative adversarial network with wasserstein distance and perceptual loss. IEEE Transactions on Medical Imaging, 37(6):1348-1357, 2018. 3 +[44] Weidong Yin, Yanwei Fu, Leonid Sigal, and Xiangyang Xue. Semi-latent GAN: Learning to generate and modify facial images from attributes. arXiv preprint arXiv:1704.02166, 2017.3 +[45] Chenyu You, Guang Li, Yi Zhang, Xiaoliu Zhang, Hongming Shan, Mengzhou Li, Shenghong Ju, Zhen Zhao, Zhuiyang Zhang, Wenxiang Cong, et al. Ct super-resolution GAN constrained by the identical, residual, and cycle learning ensemble (GAN-circle). IEEE Transactions on Medical Imaging, 39(1):188-203, 2019. 3 +[46] Kaihao Zhang, Wenhan Luo, Yiran Zhong, Lin Ma, Wei Liu, and Hongdong Li. Adversarial spatio-temporal learning for video deblurring. IEEE Transactions on Image Processing, 28(1):291-301, 2018. 3 +[47] Lei Zhang, Paul Bao, and Quan Pan. Threshold analysis in wavelet-based denoising. *Electronics Letters*, 37(24):1485–1486, 2001. 3 \ No newline at end of file diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/images.zip b/learningtoremoverefractivedistortionsfromunderwaterimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9288b688e45559d65df5711a524cdd9c453137ea --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:882c799200313fd4399b5a5ccae8b5c1b1b6839fecbad1d5ff05bb5f4161f08f +size 664484 diff --git a/learningtoremoverefractivedistortionsfromunderwaterimages/layout.json b/learningtoremoverefractivedistortionsfromunderwaterimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..11e07c44bc78b93cec07e7f943a08624b3e0bd90 --- /dev/null +++ b/learningtoremoverefractivedistortionsfromunderwaterimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da745b0b25b1ce88eeef612f2f249fb4175f3c594c921be076c23e8974e00e10 +size 417881 diff --git a/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_content_list.json b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d362955d0433c2ee840edf410ee66d594d86e571 --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87eb8d2946ae5330fd99b0177326866b36d479acf9be1c500522c9351cc0b2ba +size 81897 diff --git a/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_model.json b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6b51ec0926441c8ced3a669cb90e3f6817aaaf4c --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4531797db5ea2889dc115812cd864e11fe2fac322c7e834179f3f41c1254b421 +size 96945 diff --git a/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_origin.pdf b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f693ec1841034c17549ec701c4b15ac07ba8cafc --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/4648f7d1-3478-4341-8527-3a8bfcf7493d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdfc4a4f4fe740f2b235cde4d486ac2355afb1f3aec0f16b30f56c1f547653ca +size 2519754 diff --git a/learningtoresizeimagesforcomputervisiontasks/full.md b/learningtoresizeimagesforcomputervisiontasks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..40cc7410aacbb1f45e0937faa3d273b30a22befc --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/full.md @@ -0,0 +1,300 @@ +# Learning to Resize Images for Computer Vision Tasks + +# Hossein Talebi and Peyman Milanfar +Google Research + +# Abstract + +For all the ways convolutional neural nets have revolutionized computer vision in recent years, one important aspect has received surprisingly little attention: the effect of image size on the accuracy of tasks being trained for. Typically, to be efficient, the input images are resized to a relatively small spatial resolution (e.g. $224 \times 224$ ), and both training and inference are carried out at this resolution. The actual mechanism for this re-scaling has been an afterthought: Namely, off-the-shelf image resize such as bilinear and bicubic are commonly used in most machine learning software frameworks. But do these resize limit the on-task performance of the trained networks? The answer is yes. Indeed, we show that the typical linear resize can be replaced with learned resize that can substantially improve performance. Importantly, while the classical resize typically result in better perceptual quality of the downscaled images, our proposed learned resize do not necessarily give better visual quality, but instead improve task performance. + +Our learned image resizer is jointly trained with a baseline vision model. This learned CNN-based resizer creates machine friendly visual manipulations that lead to a consistent improvement of the end task metric over the baseline model. Specifically, here we focus on the classification task with the ImageNet dataset [26], and experiment with four different models to learn resizers adapted to each model. Moreover, we show that the proposed resizer can also be useful for fine-tuning the classification baselines for other vision tasks. To this end, we experiment with three different baselines to develop image quality assessment (IQA) models on the AVA dataset [24]. + +# 1. Introduction + +The emergence of deep neural networks along with large scale image datasets has led to major breakthroughs in machine visual recognition. Images in such datasets are typically obtained from the web and as a result have gone through various capture pipelines and post-processing steps. Besides these generally unknown processing operations, ef + +![](images/71e3fe11b16fa40725d3cc343b59a053c024cbfeeef53ad2a544324c377e6a91.jpg) +Figure 1. Our proposed framework for joint learning of the image resizer and recognition models. + +
TaskModelTop-1 Error ↓
Bilinear ResizerProposed Resizer
ClassificationInception-v2 [34]26.7%24.0%
DenseNet-121 [9]33.1%29.8%
ResNet-50 [8]24.7%23.0%
MobileNet-v2 [28]29.5%28.4%
PLCC ↑
Bicubic ResizerProposed Resizer
IQAInception-v2 [34]0.6620.686
DenseNet-121 [9]0.6620.683
EfficientNet-b0 [38]0.6420.671
+ +Table 1. Summary of our results for image classification on ImageNet [26], and image quality assessment (IQA) on the AVA dataset [24]. + +ficient training of visual recognition CNNs requires additional image augmentations such as spatial resizing. + +Image down-scaling is the most commonly used preprocessing module in classification models. The main reasons for spatial resizing are: (1) mini-batch learning through gradient descent requires the same spatial resolution for all images in a batch, (2) memory limitations prohibit training CNNs at high resolutions, and (3) large image sizes lead to slower training and inference. Given a fixed memory budget, there is a trade-off between the memory occupied by the spatial resolution and the batch size. This trade-off can have a significant impact on the accuracy of recognition CNNs [27, 39, 10, 12]. + +Currently rudimentary resizing methods such as nearest neighbor, bilinear, and bicubic are among the top adopted image resize visual recognition systems. These resize + +are fast, and can be flexibly integrated into the train and test frameworks. However, these methods were developed decades before deep learning became the mainstream solution for visual recognition tasks, and hence are not optimized or adequate for machine perception. + +Recent research on recognition-aware image processing has shown promising results on improving accuracy of classification models and simultaneously preserving the perceptual quality [20, 29]. This class of methods keep the classification model fixed, and only train the enhancement module. Meanwhile, there has been some effort on joint learning of both the pre-processor and the recognition model [2, 44, 19, 30, 18, 16, 45]. These algorithms set up training frameworks with hybrid losses that allow for learning better enhancement and recognition, concurrently. In practice, however, a recognition pre-processing operation such as resizing should not be optimized for better perceptual quality, because the end goal is for the recognition network to produce accurate results, not for the intermediate image to "look good" to a human observer. + +In this paper we propose a novel image resizer that is jointly trained with classification models (see Figure 1), and is specifically designed to improve classification performance (see Table 1). To summarize our contributions: + +- We couple our resolver with various classification models and show that it effectively adapts to each model and consistently improves over the baseline image classifier. +- The proposed resizer is not constrained by any pixel or perceptual loss, therefore our results present machine adaptive visual effects that differ from conventional image processing and super-resolution results. +- The proposed resizer model allows for down-scaling images at arbitrary scaling factors, hence we can conveniently search for the most optimal resolution for an underlying task. +- We expand the application of the proposed resizer to image quality assessment (IQA) and show that it successfully adapts to this task. + +We purport the proposed method is the first preprocessing model that is specifically developed for vision tasks, and that aims to replace off-the-shelf resize. Perhaps remote machine learning inference can be mentioned as a distinguishing application of the proposed resolver. In remote inference, transferring full resolution Mega pixel images from clients to servers imposes a significant latency on the system. While down-scaling by off-the-shelf resize on the client side may reduce the latency issue, it may also negatively impact the recognition performance. The + +![](images/dd7b896f64c5b31c227653c5766a61bf5402b7e7caaa42684908c069a80ba2aa.jpg) +Figure 2. Example of the proposed resizer trained for image classification on the ImageNet dataset [26]. The baseline classification model is Inception-v2 [34], and it is jointly trained with the resizer model shown in Fig. 3. The resized image fits the classification task better than the existing pre-processing resizers such as bilinear and bicubic. + +proposed resizer, therefore, can be an alternative to the off-the-shelf resizers to effectively reduce the expected drop in the recognition performance. + +Next, we briefly survey the research works related to this paper. Then, in Section 3 the proposed resizer model is discussed in detail. In Section 4 our results are presented, and finally we conclude in Section 5. + +# 2. Related Work + +There is ample reason to believe, given the past literature, that an optimized pre-processing module can improve performance of computer vision systems. For example, concurrent optimization of object recognition and enhancement tasks dates back to Zeiler et al. [43], where they used deconvolutional networks to learn robust features for image synthesis and analysis. Namboodiri et al. [25] show that enhancement algorithms such as super-resolution should be evaluated by classification driven metrics. More recently, a super-resolution algorithm [7] trained using an object detection loss showed superior results compared to the conventional super-resolution algorithms. Gondal et al. [40] studied the impact of super-resolution on recognition tasks by super-resolving down-sampled ImageNet [26] images and comparing classification accuracy for various up-scaling methods. They concluded that the choice of resizing method has a significant impact on the performance. More recently, Singh et al. [31] introduced a method for up-scaling very small images to improve face and digit recognition. + +The impact of compression on recognition has also been studied in [21, 33, 35]. Luo et al. [21] show that JPEG quantization coefficients can be optimized to obtain lower bit-rates and at the same time preserve perceptual quality and recognition performance. Recently, several pre-editing methods for more efficient compression without sacrifice of the classification accuracy have been introduced [33, 36]. Typically these methods rely on some kind + +![](images/bc4d755def93863a49ed1325f52d52a5cc9868168347cbf87d554f5a5c6589a9.jpg) +Figure 3. Our proposed CNN model for resizing images. The bilinear feature resizer allows for arbitrary up/down-scaling factors. + +of rate-distortion-accuracy optimization. + +Sharma et al. [30] train a generic enhancement model through joint learning with the classification network. This enhancement model does not alter the spatial resolution, and is trained via an $L_{2}$ loss on the enhanced image added to a cross-entropy classification loss. Denosing is yet another enhancement operation that has been successfully employed to improve the perceptual quality and recognition accuracy [5, 42]. The approach of Diamond et al. [5] focuses on low light imaging scenarios and shows that the best image processing algorithms for computer vision tasks are different from existing methods developed to produce visually pleasing photos. Also, the algorithm of Li et al. [15] shows that, dehazing can boost object detection and recognition performance on natural hazy images. + +Recently Liu et al. [20] proposed an approach to improve machine interpretability of images by optimizing the recognition loss on the image processing network. They study super-resolution, denoising, and JPEG-deblocking as preprocessing operations, and show that the recognition performance gain can transfer when evaluated on different architectures and tasks. Our approach differs with [20] in that (1) we exclusively focus on improving the recognition performance, regardless of the perceptual quality, and (2) our pre-processing resizer is jointly trained with the recognition model, and consequently better adapts to the recognition architecture. This means the proposed model is not constrained to learn specific enhancements (e.g. denoising or deblurring), but rather it freely learns some unique machine friendly effects that result in a recognition gain (see Figure 2). This characteristic suits our model for applications where visually pleasing images are not the end goal. + +# 3. Proposed Framework + +In this section we introduce our resizer model, and discuss how we deploy it for training and testing image classification and IQA models. + +Our resizer model is designed to be easily trainable, so it can be plugged into various learning frameworks and tasks. Also, it handles any arbitrary scaling factor, including up and down-scaling. This allows us to explore the resolution vs batch size trade-off, and as a result find the optimal resolution for the task in hand. In terms of perfor + +
Blocks Filtersr=1r=2r=3r=4
n=1611.8716.4821.0825.69
n=3238.0856.5174.9493.37
+ +Table 2. Number of parameters in the proposed resizer model are given in thousands. The number of residual blocks and the number of convolutional filters in Figure 3 are varied in this table. + +mance, ideally, the net gain obtained by such adaptive resizing should surpass the extra computational complexity that the resizing adds to the system. These constraints make it almost impossible to use the existing super-resolution models [17, 14, 41, 46, 4, 23, 3]. On the other hand, image rescaling methods such as bilinear and bicubic are, on their own, not trainable, and hence not suitable for this task. To this end, we design a model that satisfies these criteria. + +# 3.1. Resizer Model + +Our proposed resizer architecture is shown in Figure 3. Perhaps the most important characteristics of this model are (1) the bilinear feature resizing, and (2) the skip connection that accommodates combining the bilinearly resized image and the CNN features. The former factor allows for incorporation of features computed at original resolution into the model. Also, the skip connection accommodates for an easier learning process, because the resizer model can directly pass the bilinearly resized image into the baseline task. Note that the bilinear feature resizer shown in Figure 3 acts as a feed-forward bottleneck (down-scaling), but in principle it can also act as an inverse bottleneck as well (up-scaling). It is worth noting that unlike typical encoder-decoder architectures [22], the proposed architecture allows for resizing an image to any target size and aspect ratio. It is also important to highlight that performance of the learned resizer is barely dependent on the bilinear resizer choice, meaning it can be safely replaced with other off-the-shelf methods such as bicubic or Lanczos. + +The residual blocks used in our model are inspired by [6, 14]. There are $r$ identical residual blocks in our model and in our experiments we set $r = 1$ or 2. All intermediate convolutional layers have $n = 16$ kernels of size $3 \times 3$ . The first and the last layers consist of $7 \times 7$ kernels. The larger kernel size in the first layer allows for a $7 \times 7$ receptive field on the original image resolution. We also use batch normalization layers [11] and LeakyReLU activations with + +a 0.2 negative slope coefficient. + +The proposed resizer model is relatively lightweight and does not add a significant number of trainable parameters to the baseline task. The number of trainable parameters for various configurations of the CNN are shown in Table 2. These CNNs are significantly smaller than a baseline model such as ResNet-50 [8] which has about 23 million parameters. Performance of these configurations are compared in Section 4.4, where we show that even the lightest configuration with $n = 16$ , $r = 1$ is quite effective. + +# 3.2. Learning Losses + +The resizer is jointly trained with the baseline model loss. Since our objective is to learn an optimal resizer for a baseline vision task, we do not apply any loss or regularization constraint on the resized image. A summary of the tasks explored in this paper is shown in Table 3. + +# 3.2.1 Image Classification + +The classification models are trained with the cross-entropy loss. More specifically, the loss is computed on the final logits with a Sigmoid layer. The ImageNet [26] classification challenge consists of 1000 object classes, hence, the final logits layer represents 1000 predicted classes. We also use the label-smoothing regularization proposed by Szegedy et al. [34]. The recognition loss can be expressed as + +$$ +L _ {\text {r e c o g}} = - \sum_ {k = 1} ^ {K} \log \left(p _ {k}\right) q _ {k} ^ {\prime} \tag {1} +$$ + +where $p$ and $q'$ are the predictions and the smoothed labels, respectively, and $K$ denotes the total number of classes. The smoothed label of an image with a ground truth label $y$ is computed as $q_k' = (1 - \epsilon)\delta_{k,y} + \epsilon / K$ , where $\delta_{k,y}$ is 1 when $k = y$ , and 0 otherwise. We keep $\epsilon$ fixed as 0.1. The label regularization prevents the largest logit from dominating the other logits, leading to a less confident model and less overfitting. + +# 3.2.2 Image Quality Assessment (IQA) + +Our quality assessment models are trained through regression loss. Each image in the AVA dataset [24] has a histogram of human ratings, with scores ranging from 1 to 10. Following the recent work in [37], we use the Earth Mover's Distance (EMD) as our training loss. More specifically, the last layer of the baseline model is modified to have 10 logits, with a Softmax layer. The EMD loss can be represented as + +$$ +L _ {\text {q u a l i t y}} = \left(\frac {1}{K} \sum_ {k = 1} ^ {K} | \mathrm {C D F} \left(p _ {k}\right) - \mathrm {C D F} \left(q _ {k}\right) | ^ {d}\right) ^ {1 / d} \tag {2} +$$ + +where $\mathrm{CDF}(.)$ is the cumulative distribution function. In our implementation we found $d = 2$ to be the most effective. Also, note that $K$ is equal to 10 for the AVA dataset [24]. The EMD loss accommodates learning the distribution of human ratings. This has proven to be more effective than regressing to the mean ratings. + +# 4. Experiments + +Table 3 shows a summary of the specifics of our experiments. First, we train the baseline models on each dataset without the proposed resizer. For these cases we use the bilinear and the bicubic methods. These models are used as benchmarks to measure performance of the learned resizer. We also use these baselines to initialize the classification and IQA CNNs. For each baseline model and task, a separate resizer CNN is jointly trained with the baseline model. The resizer weights are randomly initialized. + +To showcase the impact of the proposed resizer, we train the baseline model at various image resolutions with and without the resizer (shown in Table 4 and Table 5). More specifically, since the baseline models can be trained at any resolution, we vary the input size from the default $224 \times 224$ size to a larger $448 \times 448$ resolution. We use mini-batch learning, therefore the input image dimensions must be equal in each batch. To achieve this, and also allow the proposed resizer to train at higher resolutions, images in ImageNet and AVA are first resized by the bilinear or the bicubic method to a fixed resolution. The resizer's input resolution is always kept greater than or equal to its output resolution. Also, we apply the same resizing configuration at train and test time. + +Feeding higher resolution images to CNNs leads to higher usage of computational resources. In principle, this extra computation should be justified by a corresponding boost in performance. This applies to all our experimental models with and without the learned resizer. To provide a fair comparison from the computational standpoint, in our experiments the floating point operations per second (FLOPS) are also reported (shown in Table 4 and Table 5). + +We use Tensorflow [1] to train our networks with stochastic gradient descent with 4 NVIDIA V100 GPUs. Throughout our experiments we used the momentum optimizer [32] with a decay of 0.9. We used a learning rate of 0.05 when training from scratch, and 0.005 for fine-tuning. The learning rate is decayed every two epochs using an exponential rate of 0.94. Next, we discuss our results. + +# 4.1. Classification + +We select four baseline models to jointly train with the image resizing. We present our results for the ImageNet dataset in Table 4. We experiment with various resolutions and adjust the batch size to avoid exceeding our memory limits. The reported top-k error is the percentage of + +
TaskBenchmark DataResizer InitializationBaseline InitializationBaseline ModelsTraining Loss
ClassificationImageNet [26]RandomPre-trainedInception-v2 [34], DenseNet-121 [9], ResNet-50 [8], MobileNet-v2 [28]Cross-entropy
IQAAVA [24]RandomPre-trainedEfficientNet-b0 [38], Inception-v2 [34], DenseNet-121 [9]EMD
+ +Table 3. Summary of the tasks implemented in this paper. The learned resizer shown in Figure 3 is jointly trained with each baseline model. + +
Classification ModelResizerResizer's Input ResolutionResizer's Output ResolutionBatch SizeTop-1 Error ↓Top-5 Error ↓Total FLOPS (Billions)
Inception-v2 [34]Proposed224×224224×22412824.1%7.5%5.07
Proposed256×256224×2249624.0%7.4%5.15
Proposed320×320224×2246424.2%7.3%5.35
Proposed368×368224×2244824.5%7.4%5.52
Proposed448×448224×2243225.3%7.9%5.86
Bilinearoriginal224×224T2826.7%8.7%3.88
Bilinearoriginal256×2569627.3%9.1%5.07
Bilinearoriginal320×3206427.3%9.1%7.92
Bilinearoriginal368×3684829.6%10.4%10.6
Bilinearoriginal448×4483230.6%11.2%15.52
DenseNet-121 [9]Proposed224×224224×22412831.1%11.6%6.86
Proposed256×256224×2249631.0%11.4%6.95
Proposed320×320224×2246430.7%11.1%7.14
Proposed368×368224×2244830.2%10.9%7.31
Proposed448×448224×2243229.8%10.8%7.65
Bilinearoriginal224×224T2833.1%12.8%5.67
Bilinearoriginal256×2569630.9%11.7%7.41
Bilinearoriginal320×3206429.9%10.8%11.57
Bilinearoriginal368×3684829.7%10.7%15.26
Bilinearoriginal448×4483231.5%12.0%22.68
ResNet-50 [8]Proposed224×224224×22412823.7%7.0%8.16
Proposed256×256224×2249623.8%7.0%8.24
Proposed320×320224×2246423.4%6.8%8.43
Proposed368×368224×2244823.0%6.7%8.61
Proposed448×448224×2243223.7%6.9%8.95
Bilinearoriginal224×224T2824.7%7.5%6.97
Bilinearoriginal256×2569623.5%6.9%9.10
Bilinearoriginal320×3206422.5%6.3%14.21
Bilinearoriginal368×3684822.1%6.0%19.17
Bilinearoriginal448×4483221.9%5.8%27.85
MobileNet-v2 [28]Proposed224×224224×22412829.1%10.1%1.79
Proposed256×256224×2249629.0%10.1%1.87
Proposed320×320224×2246428.7%9.9%2.07
Proposed368×368224×2244828.4%9.8%2.24
Proposed448×448224×2243228.5%9.8%2.58
Bilinearoriginal224×224T2829.5%10.4%0.60
Bilinearoriginal256×2569628.7%9.6%0.78
Bilinearoriginal320×3206427.2%9.0%1.23
Bilinearoriginal368×3684826.6%8.6%1.66
Bilinearoriginal448×4483226.1%8.3%2.40
+ +Table 4. Classification errors on the ImageNet [26] validation set using various models. Each row represents a model trained with a different resizing configuration. The highlighted results represent the best performances among all models with $224 \times 224$ input resolution. Note that as the input resolution increases, the batch size is reduced to avoid memory consumption issues. Also, images are resized to fix resolutions before feeding them to the proposed resizing (shown under resizing's input resolution) to accommodate for mini-batch gradient descent. + +time that the classifier does not return the correct class in the top $k$ highest probability scores. We call the model trained with bilinear resizer and output resizing resolution $224 \times 224$ the default baseline. The highlighted results represent the best performances among models with $224 \times 224$ resolution. As can be seen, networks trained with the proposed resizer show an overall improvement over the default baseline. Comparing to the default baseline, DenseNet-121 and MobileNet-v2 baselines show the largest and smallest gains, respectively. Also, it is worth mentioning that for the Inception-v2, DenseNet-121, and ResNet-50 models, the proposed resizer performs better than the bilinear resizer with comparable FLOPS. However, training the MobileNet + +v2 model with bilinear resizer at higher resolutions is more effective than using the learned resizer with similar FLOPS. + +Table 4 also shows that with or without the proposed resizer, increasing the input resolution benefits the performance of DenseNet-121, ResNet-50, and MobileNet-v2. The Inception-v2 model is an exception as it gains the most performance boost from training with larger batch sizes. It is worth noting that training resizers with equal input and output resolutions also results in improvement over the default baselines. In most cases, however, the best performance is obtained when the resizer's input is larger than its output. + +We also present some examples to visually compare the + +![](images/2630bfe089399003f1eb280ee02af82435bceb4367fabb4cf7646a7504f97fae.jpg) + +![](images/26bccbb5580f4769b95367fba11dfcfdf20c83e52f84f9b4da281ffd2db9638e.jpg) + +![](images/0a9645984f4fc407bacdfb91cc8d171de86f967da5039f3c735f8a4e2c0fdbf2.jpg) + +![](images/00a123193793cc9a233d2e7df7a42fe153d606cc1ce5b5d42b5aa2518da2920f.jpg) +Figure 4. Examples of the proposed learned resizer trained together with various classification models on ImageNet [26]. The resizers lead to improved recognition performances. + +![](images/e52ac163071cdc588a6b361a60ab22ce850b9abe9d3a33cf97db93b33d1ef200.jpg) + +![](images/c3543c6f6334034b0d4520ef3fbd54b608fac675cd8f9494c45a31297e29bbdc.jpg) + +![](images/1a3b4132326dd5d39d04bce61325cc63f6552e0a3032ebd18dca4977b4d6e43a.jpg) + +![](images/d4d392a19ec1ae6bcc33b355d08db58517c5f675a1fbdf62be6566f559efbfca.jpg) +Figure 5. Examples of the proposed learned resizer trained with various classification models on ImageNet [26]. The resizers lead to improved recognition performances. + +![](images/138428106d5a2e299bc49972bbe8dbcab836efc1a293dc804c7b3ea5a574191e.jpg) + +![](images/8ee2bdea90aad21819343f728498715deaa19c818e65b29f7fdb9afe7a7d5df0.jpg) + +![](images/e77eef29481e8425da96d6478446d4c2aa88ca4a1cf6001f579f3df479130cff.jpg) + +![](images/1e608018425733b7048d17cfa85f47b99e5514d180542bb3bb64070f07245e8c.jpg) + +![](images/41097bc059a929ccb74b7de0d8b6bf7e3d6a7a36a5cf44321b03b0a4242b526c.jpg) + +![](images/ed1523b92d9054d35f01259bb9e9d223be1e9a4ab8da82fb6232204a5355327b.jpg) + +trained resizers in Figure 4 and Figure 5. Perhaps the common feature among these results is the boost of the high frequency details. Interestingly these effects tend to make the classification model more effective. Aside from the MobileNet-v2 results, the other models tend to create overly sharpened results. This may intuitively explain the low performance gain obtained for MobileNet-v2. Overall, these effects do not meet the perceptual bar for human vision, but they surely improve the machine vision task. + +# 4.2. Quality Assessment + +We use 3 different baseline models to train with the AVA dataset [24]. The baseline models are initialized from pretrained weights on ImageNet [26], and fine-tuned on the AVA dataset. Note that the resizer weights are initialized randomly. In this set of experiments we use the bicubic resizer as our baseline method. Our results are presented in Table 5. We measure the performance by reporting correlation between the mean ground truth score and mean predicted score. To this end, we use the Pearson linear correlation coefficient (PLCC), and Spearman rank correlation coefficient (SRCC). As can be seen, there is a consistent improvement over the baseline models. Also, it is worth noting that for Inception-v2 and DenseNet-121 models, the proposed resizer performs better than the bicubic resizer with comparable FLOPS. At higher FLOPS, EfficientNet seems to be a more challenging baseline for the learned resizer. + +Examples of the trained resizers are shown in Figure 6. + +The residual images show the difference between the bicubic and the learned resizing. As can be seen, the residual image for the Inception and the DenseNet models represent a lot of fine grain details. On the other hand, the EfficientNet resizing shows a strong color shift and modest detail manipulations. + +# 4.3. Generalization + +In this section generalization of the resizer model is discussed. To this end, we first jointly fine-tune the learned resizer with a target baseline that is different from the resizer's default baseline. Then, we measure performance of the target baseline on the underlying task. We observed that fine-tuning on about 4 epochs of the training data suffices to adapt the resizer to the target model. This validation is a reasonable indicator of how well the trained resizers generalize to various architectures. Our results for classification and IQA are presented in Table 6 and Table 7. Each column shows an initialization checkpoint for the resizer model, and each row indicates a target baseline. These results show that a resizer trained for one baseline can be effectively used to develop a resizer for another baseline with minimal fine-tuning. In some cases such as the DenseNet and MobileNet models the fine-tuned resizers actually surpass the classification performance obtained by random initialization (see Table 6). The same observation holds true for the EfficientNet model in the IQA application (see Table 7). These improvements are perhaps because of the transfer learning ef + +
Baseline ModelResizerResizer's Input ResolutionResizer's Output ResolutionBatch SizePLCC ↑SRCC ↑Total FLOPS (Billions)
Inception-v2 [34]Proposed224×224224×2241280.6730.6535.07
Proposed256×256224×224960.6740.6555.15
Proposed320×320224×224640.6860.6635.35
Proposed368×368224×224480.6770.6525.52
Proposed448×448224×224320.6770.6515.86
Bicubicoriginal224×2241280.6620.6433.88
Bicubicoriginal256×256960.6720.6525.07
Bicubicoriginal320×320640.6880.6647.92
Bicubicoriginal368×368480.6930.66810.6
Bicubicoriginal448×448320.7000.67215.52
DenseNet-121 [9]Proposed224×224224×2241280.6720.6446.86
Proposed256×256224×224960.6720.6456.95
Proposed320×320224×224640.6830.6557.14
Proposed368×368224×224480.6750.6447.31
Proposed448×448224×224320.6730.6427.65
Bicubicoriginal224×2241280.6620.6365.67
Bicubicoriginal256×256960.6720.6447.41
Bicubicoriginal320×320640.6940.66611.57
Bicubicoriginal368×368480.6950.66315.26
Bicubicoriginal448×448320.6920.65822.68
EfficientNet-b0 [38]Proposed224×224224×2241280.6460.6261.93
Proposed256×256224×224960.6500.6292.01
Proposed320×320224×224640.6710.6512.20
Proposed368×368224×224480.6540.6322.38
Proposed448×448224×224320.6440.6162.72
Bicubicoriginal224×2241280.6420.6200.74
Bicubicoriginal256×256960.6590.6370.97
Bicubicoriginal320×320640.6740.6521.51
Bicubicoriginal368×368480.6780.6552.05
Bicubicoriginal448×448320.6730.6482.96
+ +Table 5. IQA on the AVA dataset [24] with various models. Each row represents a model trained with a different resizing configuration. Performance of each model is quantified by the Pearson and Spearman correlations of the predicted and ground truth mean scores. The highlighted results represent the best performances among all models with $224 \times 224$ input resolution. Note that as the input resolution increases, the batch size is reduced to avoid memory consumption issues. Also, images are resized to fix resolutions before feeding them to the proposed resizer (shown under resizer's input resolution) to accommodate for mini-batch gradient descent. + +![](images/2ae046bb575514d9f685297344a35ec8d965996bababd9455a8266d3047507d0.jpg) + +![](images/5ef4e96ae5b83fec30f1200174557a736b5173e7639fe8073b7e5c00c7777339.jpg) + +![](images/b1f1cc2e0b6529004adb906f2f6c669603a2805e54603be4a7fc382518e89800.jpg) + +![](images/baac7d72c5511dd776a0f750d87f29fec09484216722e3efdfeeeafa8ce80a19.jpg) + +![](images/f332ab16e8c3efb8ba1a7f8cb89f26c8919a9f7ca4152831b5c4c611b5ef0e30.jpg) +Figure 6. Examples of the proposed learned resizer trained with various IQA models on the AVA dataset [24]. (c), (e), and (f) are results from trained resizers with respective base models. (d), (f), and (h) represent the difference between bicubic and learned resizers. + +![](images/cfdd4935ed97bbd631222d3fd7281a9b2aedd57357171404545972d204a5dee8.jpg) + +![](images/1ef61c1ff336039616bf5c731e12f65352bfb17c8842d85b950273bd094af408.jpg) + +![](images/bd39e90806ee386e7b19f096f0ee92ecdfc01dc357dc92782ca87a53a729b78f.jpg) + +fect. + +We also tried the above cross-model validation without fine-tuning, however, performance mostly degraded. This is likely because (1) the proposed resizer is exclusively trained for one baseline model, and (2) no intermediate pixel loss is used during training. + +For cross-dataset validation we train the resizer on Ima- + +geNet, and test it with a classifier trained on the CIFAR-10 benchmark [13]. With the addition of the learned resizer to the classification task on CIFAR-10, the top-1 error of ResNet-50 (6.9%) baseline drops by 0.4%. We observed a similar favorable trend in other baseline models. + +We also compare our performance with [20] in Table 9. We followed the authors instructions in [20] to generate + +
Target\InitialTop-1 Error ↓Top-5 Error ↓
Inception-v2DenseNet-121ResNet-50MobileNet-v2Inception-v2DenseNet-121ResNet-50MobileNet-v2
Inception-v224.5%24.6%24.5%24.6%7.4%7.5%7.5%7.4%
DenseNet-12129.7%30.2%29.7%30.1%10.7%10.9%10.6%10.9%
ResNet-5022.9%23.0%23.0%23.1%6.5%6.4%6.7%6.7%
MobileNet-v228.0%28.2%28.0%28.4%9.6%9.6%9.6%9.8%
+ +Table 6. Generalization of the resizer models for image classification [26]. The learned resizers are trained with the initial baseline and then jointly fine-tuned with the target baseline model. The resizer's input and output resolutions are $368 \times 368$ and $224 \times 224$ , respectively. + +
Target\InitialPLCC↑SRCC↑
Inception-v2DenseNet-121EfficientNet-b0Inception-v2DenseNet-121EfficientNet-b0
Inception-v2 [34]0.6770.6720.6700.6520.6490.649
DenseNet-121 [9]0.6720.6750.6710.6450.6440.642
EfficientNet-b0 [38]0.6600.6530.6540.6360.6320.632
+ +Table 7. Generalization of the resizer models for IQA [24]. The learned resizers are trained with the initial baseline and then jointly fine-tuned with the target baseline model. The resizer's input and output resolutions are $368 \times 368$ and $224 \times 224$ , respectively. + +
TaskModelTop-1 Error ↓Top-5 Error ↓
r = 1r = 2r = 1r = 2r = 1r = 2r = 1r = 2
n = 16n = 16n = 32n = 32n = 16n = 16n = 32n = 32
ClassificationInception-v2 [34]24.5%25.5%25.6%26.1%7.4%8.0%7.9%8.3%
DenseNet-121 [9]30.2%29.8%29.9%29.8%10.9%10.8%10.8%10.8%
ResNet-50 [8]23.0%23.4%23.4%23.3%6.7%6.6%6.7%6.8%
MobileNet-v2 [28]28.4%28.5%28.4%28.3%9.8%9.7%9.7%9.7%
PLCC ↑SRCC ↑
IQAInception-v2 [34]0.6770.6770.6750.6760.6520.6540.6430.643
DenseNet-121 [9]0.6750.6770.6700.6710.6440.6450.6290.630
EfficientNet-b0 [38]0.6540.6520.6460.6480.6320.6300.6250.628
+ +Table 8. Effect of the resizer model parameters on the classification [26], and image quality assessment (IQA) [24]. Parameters $r$ and $n$ denote the number of residual blocks and convolutional filters, respectively. These parameters are presented in Figure 3. The resizer's input and output resolutions are ${368} \times {368}$ and ${224} \times {224}$ ,respectively. + +
ModelPre-processorDown-scaled (4×)NoiseJPEG
ResNet-50[20]31.8%29.1%34.9%
ours31.1%28.6%34.5%
+ +Table 9. Top-1 classification error on distorted and then enhanced ImageNet images. Results from [20] are their best performing models. + +the distorted images with Gaussian noise (standard deviation 0.1), spatial down-scaling $(4\times)$ , and JPEG compression with quality factor 10. We trained the resizer to increase the resolution by a factor of 4 for the down-scaled inputs, and kept the resolution unchanged for the other distortions. As can be noted from Table 9, the proposed resizer outperforms [20] consistently. Also, it is worth pointing out that our preprocessor model obtains the largest margin of improvement for down-scaled images. + +# 4.4. Ablation + +In this section effects of our design choices in the responder model are discussed. We vary the number of residual blocks $r$ , and the number of filters $n$ (see Figure 3), and report the performance of the jointly trained baseline models. Note that so far in the experimental results we have employed CNN resizers with the default configuration in which $r = 1$ and $n = 16$ . + +Our results for the classification and IQA tasks with various configurations are presented in Table 8. In the classifi- + +cation task, as the resizer model gets bigger, the DenseNet and the MobileNet baselines show modest improvements over the default configuration. However, Inception and ResNet do not benefit from larger number of parameters in the resizer. A similar trend can be observed in the IQA task. + +Perhaps one of the reasons for the non-growing performance of the larger resizer models is the lowered batch size. Note that given limited memory, larger resizers have to be trained with smaller batch sizes. This factor may inadvertently limit the observed performance gain. + +# 5. Conclusions + +We presented a framework for learning pre-processing effects that boost the performance of image recognition models. We focused on image resizing, and did not apply an intermediate pixel or perceptual loss on the resized images, hence the results are exclusively optimized for machine vision tasks. Our experiments show that task-optimized deep vision models can benefit from replacing traditional image resizers with learned resizers. We believe that customized pre-processing algorithms for machine vision tasks have not been studied extensively, and given the impact shown in this paper, there is significant room for research in this area. As part of future work we will extend our model to other vision tasks. + +# References + +[1] Martin Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} symposium on operating systems design and implementation (\{OSDI\} 16), pages 265-283, 2016. 4 +[2] Yancheng Bai, Yongqiang Zhang, Mingli Ding, and Bernard Ghanem. Finding tiny faces in the wild with generative adversarial network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 21-30, 2018. 2 +[3] David Berthelot, Peyman Milanfar, and Ian Goodfellow. Creating high resolution images with a latent adversarial generator. arXiv preprint arXiv:2003.02365, 2020. 3 +[4] Jianrui Cai, Hui Zeng, Hongwei Yong, Zisheng Cao, and Lei Zhang. Toward real-world single image super-resolution: A new benchmark and a new model. In Proceedings of the IEEE International Conference on Computer Vision, pages 3086-3095, 2019. 3 +[5] Steven Diamond, Vincent Sitzmann, Stephen Boyd, Gordon Wetzstein, and Felix Heide. Dirty pixels: Optimizing image classification architectures for raw sensor data. arXiv preprint arXiv:1701.06487, 2017. 3 +[6] Sam Gross and Michael Wilber. Training and investigating residual nets. *Facebook AI Research*, 6, 2016. 3 +[7] Muhammad Haris, Greg Shakhnarovich, and Norimichi Ukita. Task-driven super resolution: Object detection in low-resolution images. arXiv preprint arXiv:1803.11316, 2018. 2 +[8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 1, 4, 5, 8 +[9] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700-4708, 2017. 1, 5, 7, 8 +[10] Yanping Huang, Youlong Cheng, Ankur Bapna, Orhan Firat, Dehao Chen, Mia Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, Yonghui Wu, et al. Gpipe: Efficient training of giant neural networks using pipeline parallelism. In Advances in neural information processing systems, pages 103-112, 2019. 1 +[11] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 3 +[12] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017. 1 +[13] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 7 +[14] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative ad + +versarial network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4681-4690, 2017. 3 +[15] Boyi Li, Xiulian Peng, Zhangyang Wang, Jizheng Xu, and Dan Feng. Aod-net: All-in-one dehazing network. In Proceedings of the IEEE international conference on computer vision, pages 4770-4778, 2017. 3 +[16] Boyi Li, Xiulian Peng, Zhangyang Wang, Jizheng Xu, and Dan Feng. End-to-end united video dehazing and detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. 2 +[17] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 136-144, 2017. 3 +[18] Ding Liu, Bihan Wen, Xianming Liu, Zhangyang Wang, and Thomas S Huang. When image denoising meets high-level vision tasks: A deep learning approach. arXiv preprint arXiv:1706.04284, 2017. 2 +[19] Feng Liu, Ronghang Zhu, Dan Zeng, Qijun Zhao, and Xiaoming Liu. Disentangling features in 3d face shapes for joint face reconstruction and recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5216-5225, 2018. 2 +[20] Zhuang Liu, Tinghui Zhou, Hung-Ju Wang, Zhiqiang Shen, Bingyi Kang, Evan Shelhamer, and Trevor Darrell. Transferable recognition-aware image processing. arXiv preprint arXiv:1910.09185, 2019. 2, 3, 7, 8 +[21] Xiyang Luo, Hossein Talebi, Feng Yang, Michael Elad, and Peyman Milanfar. The rate-distortion-accuracy tradeoff: Jpeg case study. arXiv preprint arXiv:2008.00605, 2020. 2 +[22] Xiao-Jiao Mao, Chunhua Shen, and Yu-Bin Yang. Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections. arXiv preprint arXiv:1603.09056, 2016. 3 +[23] Peyman Milanfar. Super-resolution imaging. CRC press, 2017. 3 +[24] Naila Murray, Luca Marchesotti, and Florent Perronnin. Ava: A large-scale database for aesthetic visual analysis. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 2408-2415. IEEE, 2012. 1, 4, 5, 6, 7, 8 +[25] Vinay P Namboodiri, Vincent De Smet, and Luc Van Gool. Systematic evaluation of super-resolution using classification. In 2011 Visual Communications and Image Processing (VCIP), pages 1-4. IEEE, 2011. 2 +[26] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. 1, 2, 4, 5, 6, 8 +[27] Carl F Sabottke and Bradley M Spieler. The effect of image resolution on deep learning in radiography. *Radiology: Artificial Intelligence*, 2(1):e190015, 2020. 1 +[28] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zh-moginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In Proceedings of the + +IEEE conference on computer vision and pattern recognition, pages 4510-4520, 2018. 1, 5, 8 +[29] Walter Scheirer, Rosaura VidalMata, Sreya Banerjee, Brandon RichardWebster, Michael Albright, Pedro Davalos, Scott McCloskey, Ben Miller, Asongu Tambo, Sushobhan Ghosh, et al. Bridging the gap between computational photography and visual recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 2 +[30] Vivek Sharma, Ali Diba, Davy Neven, Michael S Brown, Luc Van Gool, and Rainer Stiefelhagen. Classification-driven dynamic image enhancement. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4033-4041, 2018. 2, 3 +[31] Maneet Singh, Shruti Nagpal, Richa Singh, and Mayank Vatsa. Dual directed capsule network for very low resolution image recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 340-349, 2019. 2 +[32] Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pages 1139-1147. PMLR, 2013. 4 +[33] Satoshi Suzuki, Motohiro Takagi, Kazuya Hayase, Takayuki Onishi, and Atsushi Shimizu. Image pre-transformation for recognition-aware image compression. In 2019 IEEE International Conference on Image Processing (ICIP), pages 2686-2690. IEEE, 2019. 2 +[34] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818-2826, 2016. 1, 2, 4, 5, 7, 8 +[35] Khalid Tahboub, David Guera, Amy R Reibman, and Edward J Delp. Quality-adaptive deep learning for pedestrian detection. In 2017 IEEE International Conference on Image Processing (ICIP), pages 4187-4191. IEEE, 2017. 2 +[36] Hossein Talebi, Damien Kelly, Xiyang Luo, Ignacio Garcia Dorado, Feng Yang, Peyman Milanfar, and Michael Elad. Better compression with deep pre-editing. arXiv preprint arXiv:2002.00113, 2020. 2 +[37] Hossein Talebi and Peyman Milanfar. Nima: Neural image assessment. IEEE Transactions on Image Processing, 27(8):3998-4011, 2018. 4 +[38] Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019. 1, 5, 7, 8 +[39] Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Hervé Jégou. Fixing the train-test resolution discrepancy. In Advances in neural information processing systems, pages 8252-8262, 2019. 1 +[40] Muhammad Waleed Gondal, Bernhard Scholkopf, and Michael Hirsch. The unreasonable effectiveness of texture transfer for single image super-resolution. In Proceedings of the European Conference on Computer Vision (ECCV), pages 0–0, 2018. 2 +[41] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. Esrgan: Enhanced super-resolution generative adversarial networks. In + +Proceedings of the European Conference on Computer Vision (ECCV), pages 0-0, 2018. 3 +[42] Jonghwa Yim and Kyung-Ah Sohn. Enhancing the performance of convolutional neural networks on quality degraded datasets. In 2017 International Conference on Digital Image Computing: Techniques and Applications (DICTA), pages 1-8. IEEE, 2017. 3 +[43] Matthew D Zeiler, Dilip Krishnan, Graham W Taylor, and Rob Fergus. Deconvolutional networks. In 2010 IEEE Computer Society Conference on computer vision and pattern recognition, pages 2528-2535. IEEE, 2010. 2 +[44] Kaipeng Zhang, Zhanpeng Zhang, Chia-Wen Cheng, Winston H Hsu, Yu Qiao, Wei Liu, and Tong Zhang. Superidentity convolutional neural network for face hallucination. In Proceedings of the European conference on computer vision (ECCV), pages 183-198, 2018. 2 +[45] Chen Zhao and Bernard Ghanem. Thumbnet: One thumbnail image contains all you need for recognition. In Proceedings of the 28th ACM International Conference on Multimedia, pages 1506-1514, 2020. 2 +[46] Ruofan Zhou and Sabine Susstrunk. Kernel modeling superresolution on real low-resolution images. In Proceedings of the IEEE International Conference on Computer Vision, pages 2433-2443, 2019. 3 \ No newline at end of file diff --git a/learningtoresizeimagesforcomputervisiontasks/images.zip b/learningtoresizeimagesforcomputervisiontasks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..03100188121e6236d60a61c5c389099ecc4906d8 --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2342edcf4725e9ff740133b86c11e2901146a9c9edce8f73e4098d963e3990c8 +size 1097495 diff --git a/learningtoresizeimagesforcomputervisiontasks/layout.json b/learningtoresizeimagesforcomputervisiontasks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6f0d3433a0407eb67e62893847ecf805a25e503b --- /dev/null +++ b/learningtoresizeimagesforcomputervisiontasks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:311487585b7c1b7a13777e85b62c4507d5b906b154a510144f44617914e588d4 +size 345796 diff --git a/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_content_list.json b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..899aa51cf95956154dc1c0b54c9cc95fa63873bc --- /dev/null +++ b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08c5da6c85401d11bd6737bdcaa8fdec11074c4957bd31d90f294aeb30bb02f8 +size 71543 diff --git a/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_model.json b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b1fd30c84d48955596b489f6da5a696e22da8d54 --- /dev/null +++ b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c52019910a2ce94ac4584d7c2eebe6da10db05a4dfde0347276e317c29ba7eac +size 94247 diff --git a/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_origin.pdf b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..01b5a15032e966b28babb20b23906eab97f56931 --- /dev/null +++ b/learningtostylizenovelviews/689a5f40-227b-40d8-963d-add4b596773d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95b51b6ca9be89cc79bcddd8419ba2af3d735b8c3a5c22e43ac004ef2e4d891d +size 9196022 diff --git a/learningtostylizenovelviews/full.md b/learningtostylizenovelviews/full.md new file mode 100644 index 0000000000000000000000000000000000000000..454775802686616c568541d68fb68c2f01017854 --- /dev/null +++ b/learningtostylizenovelviews/full.md @@ -0,0 +1,318 @@ +# Learning to Stylize Novel Views + +Hsin-Ping Huang $^{1}$ , Hung-Yu Tseng $^{1}$ , Saurabh Saini $^{2}$ , Maneesh Singh $^{2}$ , Ming-Hsuan Yang $^{1,3,4}$ + +$^{1}$ UC Merced $^{2}$ Verisk Analytics $^{3}$ Google Research $^{4}$ Yonsei University + +https://hhsinping.github.io/3dscene_stylization + +![](images/d942602328568ac33daea77b4626d3975d67b33b8e6cd4910b9202ece4b3db83.jpg) + +![](images/360ceba0ba8e9c278d93b1a5a8358755895e4d3a1c3f39dee45b6a1472351c4f.jpg) + +![](images/8515477cfc30d4d96ca1a3589ce85cb35b59bc3f62c6ac7941bd6596b10c71e8.jpg) + +![](images/33494316b2323948a4425fffdd1653cc81af369b8641b9bf277b7897a16fa941.jpg) + +![](images/e7a53702d76073876cc5e3fdc72f573e559ec7b7b43711831470526bdb0feb54.jpg) +Input views + +![](images/516e0b59626931a1296a362c0da544415185a4c6ffda64626082e1bf9c2f71e3.jpg) +Style image + +![](images/22bb6f3bfa175b1443eac8e146701fa48f4c71dc61545b054c4039faf2e35a65.jpg) +Stylized novel views +Figure 1. 3D scene stylization. Given a set of images of a 3D scene (left) as well as a reference image of the desired style (middle), our method is able to modify the style of the 3D scene, and synthesize images of arbitrary novel views (right). The novel view synthesis results 1) contain the desired style and 2) are consistent across various novel views, e.g. the texture in the yellow boxes. + +![](images/faa8399a1a9cb38472b54f90e263e5d538ae611e9b76e84483b2205aa531b604.jpg) + +# Abstract + +We tackle a 3D scene stylization problem — generating stylized images of a scene from arbitrary novel views given a set of images of the same scene and a reference image of the desired style as inputs. Direct solution of combining novel view synthesis and stylization approaches lead to results that are blurry or not consistent across different views. We propose a point cloud-based method for consistent 3D scene stylization. First, we construct the point cloud by back-projecting the image features to the 3D space. Second, we develop point cloud aggregation modules to gather the style information of the 3D scene, and then modulate the features in the point cloud with a linear transformation matrix. Finally, we project the transformed features to 2D space to obtain the novel views. Experimental results on two diverse datasets of real-world scenes validate that our method generates consistent stylized novel view synthesis results against other alternative approaches. + +# 1. Introduction + +Visual content creation in 3D space has recently attracted increasing attention. Driven by the success of 3D scene representation approaches [38, 46, 64], recent methods make + +significant progress on various content creation tasks for 3D scenes, such as semantic view synthesis [16, 19] and scene extrapolation [34]. In this work, we focus on the 3D scene stylization problem. As shown in Figure 1, given a set of images of a target scene and a reference image of the desired style, our goal is to render stylized images of the scene from arbitrary novel views. 3D scene stylization enables a variety of interesting virtual reality (VR) and augmented reality (AR) applications, e.g. augment the street scene at user locations to the Cafe Terrace at Night style by van Gogh. + +Learning to modify the style of an existing 3D scene is challenging for two reasons. First, the synthesized novel views (i.e. 2D images) of the stylized 3D scene must contain the desired style provided by the reference image. Second, since our goal is to stylize the holistic 3D scene, the generated novel views need to be consistent across different viewpoints for the same scene, such as the texture in the yellow boxes shown in Figure 1. + +To handle these challenges, one plausible solution is to combine existing novel view synthesis [46, 64] and image stylization approaches [30, 53]. However, such straightforward approaches lead to problematic results since image stylization schemes are not designed to consider the consistency issue across different views for the same scene. + +![](images/9441331d4b4c439a92fc521144b982072f3b6906d72e9377c30d15dd2091b825.jpg) +Figure 2. Motivation. While the existing methods can be used for the 3D scene stylization task, these methods either produce blurry (image stylization $\rightarrow$ novel view synthesis), short-range inconsistent (novel view synthesis $\rightarrow$ image stylization), or long-range inconsistent (novel view synthesis $\rightarrow$ video stylization) results. + +We present the examples in Figure 2 where the results may be blurry if the input images of the target scene are stylized before conducting novel view synthesis. On the other hand, if we apply image stylization after novel view synthesis, the results are not consistent across different views. Another possible solution is to treat a series of novel view synthesis results as a video, and use the video stylization frameworks [9, 11, 56] to obtain temporally consistent results. However, as shown in Figure 2, these approaches are not able to enforce long-range consistency (i.e. between two far-away views) as the video stylization schemes only guarantee the short-term consistency. + +In this paper, we propose a point cloud-based method for consistent 3D scene stylization. To synthesize novel views that 1) match arbitrary style images and 2) render images with consistent appearance across different views, the core idea is to operate on the 3D scene representation, i.e. point cloud, of the target scene. Given a set of input images of the target scene, we first construct the point cloud by backprojecting the image features to the 3D space according to the pre-computed 3D proxy geometry. To transfer the style of the holistic 3D scene, we develop a point cloud transformation module. Specifically, we use a series of point cloud aggregation modules to gather the style information of the 3D scene. We then modulate the features in the point cloud with a linear transformation matrix [30] computed according to the style information of the point cloud and reference image. Finally, we project the transformed features from the point cloud to the 2D space to obtain the novel view synthesis results. Since our method synthesizes novel view images from the same stylized point cloud, the rendered results not only demonstrate the desired style, but also are consistent across different viewpoints. + +We evaluate the proposed 3D scene stylization method through extensive qualitative and quantitative studies. The experiments are conducted on two diverse datasets of real-world scenes: Tanks and Temples [25] and FVS [45]. We conduct a user preference study to evaluate the stylization quality, i.e. whether the novel view synthesis results match the style of the reference image. In addition, we use the Learned Perceptual Image Patch Similarity (LPIPS) [65] metric to measure the consistency of the results synthesized + +across different novel views. + +We make the following contributions in this paper: + +- We propose a point cloud-based framework for the 3D scene stylization task. +- We design a point cloud transformation module that learns to transfer the style from an arbitrary 2D reference image to the point cloud of a 3D scene. +- We validate that our method produces high-quality and consistent stylized novel view synthesis results on the Tanks and Temples as well as FVS datasets. + +# 2. Related Work + +Novel View Synthesis. Given a set of images for a scene, novel view synthesis aims to generate high-quality images at arbitrary viewpoints. It can be categorized by the number of input images that cover the scene. One line of work takes as input a single image or stereo images. These methods use multi-plane images [52, 54, 58, 67], layer depth image [27, 50], or point cloud [40, 57] representations to synthesize images at novel views near the input views, e.g. 3D photo. To enable the image synthesis at arbitrary novel views, several recent frameworks take hundreds of input images of a scene as the input. These frameworks leverage different 3D representations to accomplish the task. Image-based rendering approaches [45, 46] compute 3D proxy geometry of the scene, and generate images by warping the input frames to the desired novel views. Neural radiance field schemes [35, 38, 63, 64] use multi-layer perceptrons to implicitly encode the scene for novel view synthesis. Point cloud-based methods [37, 1] solve different optimization problems to construct the point cloud for a specific 3D scene. Different from these frameworks, our goal is to generate stylized novel view images of the 3D scene. As shown in Figure 2, while existing algorithms can be used for the 3D scene stylization task, they fail to generate high-quality novel view synthesis results with the desired style. + +Image and Video Stylization. Image stylization [12] aims to transfer the style of a reference image to the single input image. Existing methods [5, 22, 32, 49, 55] are designed based on feed-forward networks for transferring a set of pre-defined styles. For arbitrary image style transfer, + +![](images/56d645b38963e16817294aca4f593bf421a7ee4dae1c1f4db5be40ac6f92c42a.jpg) +Figure 3. Algorithmic overview. The proposed method consists of three steps: 1) constructing the 3D point cloud from the set of input images $\{\mathbf{I}_n\}_{n=1}^N$ , 2) transforming the point cloud according to the reference image $\mathbf{S}$ with the desired style, and 3) synthesizing the stylized image $\mathbf{O}_v$ at arbitrary novel view $v$ . The coloring of the point clouds is for visualization purposes only. In our approach, the point clouds store the features rather than RGB values. + +![](images/c85a4f2e0cc73e5fcfadd511ce05a07319ff24e62af86e0bb88221498d32c717.jpg) +Figure 4. Point cloud transformation. We model the 3D scene stylization process as the linear transformation between the constructed and stylized point clouds. Specifically, the constructed point cloud is modulated using the predicted linear transformation matrix $\mathbf{T}$ , as described in (1). We use a series of point cloud aggregation modules to gather the point cloud information, and the convolution layers to process the reference image feature $\mathbf{F}^s$ to compute the matrix $\mathbf{T}$ . + +Huang and Belongie [20] use first-order statistics to encode the style information, and transform the image style via the AdaIN normalization layers. The WCT [33] approach uses whitening and coloring transformation to match the second-order statistics of the input image to those of the reference image. In addition, the LST [30] scheme leverages the convolutional neural networks to reduce the computational cost of solving the transformation matrix in the WCT method for real-time universal style transfer. Most recently, the TPFR method [53] proposes a regularization layer to facilitate the generalization of image stylization models. + +Video stylization aims to transfer the style of a reference image to a sequence of video frames. To address the temporal flickering issue produced by the image stylization approaches, numerous approaches [4, 7, 10, 15, 18] incorporate optical flow modules to train feed-forward networks for transferring a particular style to the videos. Several recent frameworks [9, 11, 56] enable the video style trans + +fer to arbitrary styles. Although significant advances have been made, existing methods are designed specifically for transferring the style of 2D images or video sequences. As shown in Figure 2, simply applying these schemes for the 3D scene stylization task leads to problematic results, such as blurry or short/long-range inconsistent images across different novel views. + +Several efforts have been made to perform the stylization in 3D space. However, these approaches are only applicable to single objects [23], narrow-baseline stereo images [6, 13], or light field images [17]. In contrast, our method stylizes complex 3D scenes, and produces consistent results at arbitrary viewpoints. + +Deep neural networks for point clouds. Various deep neural network (DNN)-based models [24, 28, 29, 31, 41, 42, 59, 61, 66] that take point clouds as input are widely studied for vision recognition tasks including 3D semantic segmentation [2], 3D shape classification or normal estimation [60], and 3D object part segmentation [62]. Recently, Mallya et al. [36] proposes a point cloud colorization approach for the video-to-video synthesis task. In this work, we propose a DNN-based point cloud transformation model for the 3D scene stylization task. We note that the PSNet [3] model aims to transfer the style of the point cloud. Nevertheless, there are two issues for the PSNet method to be applied to the 3D scene stylization task. First, it does not support synthesizing high-quality stylized images at novel views, which makes the PSNet framework limited for real-world (e.g. AR) applications. Second, since the PSNet scheme requires the optimization process for each specific scene, it is time-consuming, and fails to handle large-scale scenes in the real-world with more than $60\mathrm{M}$ points, such as those in the Tanks and Temples dataset [25]. In contrast, we propose a feed-forward point cloud model that is efficient, capable of handling large-scale 3D scenes, and generating images with arbitrary styles at various novel views. + +# 3. Methodology + +We present the overview of the proposed 3D scene stylization framework in Figure 3. Given a set of $N$ input images $\{\mathbf{I}_n\}_{n=1}^N$ of a static scene, and a reference image $\mathbf{S}$ with the desired style, our goal is to synthesize the image $\mathbf{O}_v$ at the novel view $v$ with the camera pose $(\mathbf{R}_v, t_v)$ and intrinsic $\mathbf{K}_v$ . Specifically, the generated novel view image $\mathbf{O}_v$ needs to 1) match the style of the reference image $\mathbf{S}$ and 2) be consistent for different viewpoints $v$ . To handle such (especially the consistency) requirements, our core idea is to 1) construct a single 3D representation, i.e. point cloud, for the holistic scene, and 2) transform the representation to produce not only stylized but also consistent novel view synthesis results. The proposed approach consists of three steps: point cloud creation, point cloud transformation, and novel view synthesis, described in the following sections. + +# 3.1. Point Cloud Construction + +Pre-processing. Our method leverages camera pose and proxy geometry to construct the 3D point cloud. Given the input images $\{\mathbf{I}_n\}_{n=1}^N$ , we first use a structure-from-motion algorithm [47] to estimate the camera poses $\{\mathbf{R}_n, t_n\}_{n=1}^N$ and intrinsic parameters $\{\mathbf{K}_n\}_{n=1}^N$ . For each image $\mathbf{I}_n$ , we use the COLMAP [47, 48] and Delaunay-based reconstruction [21, 26] schemes to obtain the depth map $\mathbf{D}_n$ that can appropriately back-project the points from the image plane to the 3D space. + +Feature extraction and back-projection. Since our goal is to transform the point cloud representation for the 3D scene stylization purpose, we need the point cloud representation to encode the style information. Therefore, we use the VGG-19 model [51] pre-trained on the ImageNet [8] dataset to extract the relu3_1 feature maps $\{\mathbf{F}_n^c\}_{n=1}^N$ of the input images $\{\mathbf{I}_n\}_{n=1}^N$ . The width and height of each feature map is $H$ and $W$ . According to the depth map $\{\mathbf{D}_n\}_{n=1}^N$ , we back-project all the points in each feature map to build the 3D point cloud $\{f_p^c\}_{p=1}^P$ , where $P = NHW$ is the total number of points in the constructed point cloud. + +# 3.2. Point Cloud Transformation + +We model the 3D scene stylization process as a linear transformation [30] between the constructed and stylized point clouds. Intuitively, the goal is to match the covariance statistics of the stylized point clouds and those of the reference image $\mathbf{S}$ . To achieve this, we use the pre-trained VGG-19 network to extract the relu3_1 feature map from the reference image $\mathbf{S}$ as the style feature map $\mathbf{F}^s$ . Given the constructed point cloud $\{f_p^c\}_{p = 1}^P$ , we use a predicted linear transformation matrix $\mathbf{T}$ to compute the modulated point cloud $\{f_p^d\}_{p = 1}^P$ , namely + +$$ +f _ {p} ^ {d} = \mathbf {T} \left(f _ {p} ^ {c} - \bar {f} ^ {c}\right) + \bar {f} ^ {s} \quad \forall p \in [ 1, \dots , P ], \tag {1} +$$ + +where $\bar{f}^c$ is the mean of the features in the point cloud $\{f_p^c\}_{p = 1}^P$ , and $\bar{f}^s$ is the mean of the style feature map $\mathbf{F}^s$ . + +Linear transformation matrix $\mathbf{T}$ . The transformation matrix $\mathbf{T}$ is computed from the style feature map $\mathbf{F}^s$ and constructed point cloud $\{f_p^c\}_{p=1}^P$ . As shown in Figure 4, we adopt the strategy similar to the LST [30] method that uses the convolution layers, covariance computation, and fully-connected layers to compute the matrix $\mathbf{T}^s$ from the style feature map $\mathbf{F}^s$ . On the other hand, we develop a series of point cloud aggregation modules to process the point cloud $\{f_p^c\}_{p=1}^P$ , and use the covariance computation followed by the fully-connected layers to calculate the matrix $\mathbf{T}^c$ . Finally, we obtain the transformation matrix $\mathbf{T} = \mathbf{T}^s\mathbf{T}^c$ . + +Point cloud aggregation. It is challenging to gather the information contained in the constructed point cloud $\{f_p^c\}_{p = 1}^P$ due to the sparsity and non-uniformity. We note that the constructed point cloud is non-uniform if the input images cover a particular region of the 3D scene. In this work, we leverage the set abstraction [43] concept to aggregate the point cloud. The input $\{f_p^c\}_{p = 1}^P$ to a point cloud aggregation module is a set of $P$ points with feature dimension $c$ , and the output $\{f_p^{c'}\}_{p = 1}^{P'}$ is a set of $P'$ points with dimension $c'$ . We first sample a subset of $P'$ points $\{f_p^c\}_{p = 1}^{P'}$ using the iterative farthest point sampling algorithm [14, 39]. Viewing the sampled points as the centroids in the 3D space, we use a radius parameter $r$ to find the nearby points to form a point group. By using the MLP layers and the max pooling operator to map each point group to a vector, we obtain the aggregated point cloud $\{f_p^{c'}\}_{p = 1}^{P'}$ . The output $\{f_p^{c'}\}_{p = 1}^{P'}$ is then used as the input for the next module. We use three point cloud aggregation modules sequentially in our pipeline. + +# 3.3. Novel View Synthesis and Model Training + +We aim to synthesize stylized image $\mathbf{O}_v$ at an arbitrary novel view $v$ . Given the target camera pose $(\mathbf{R}_v, t_v)$ and intrinsic $\mathbf{K}_v$ , we use Pytorch3D [44, 57] to render the transformed 2D feature map $\mathbf{F}_v^d$ . We then use a decoder network to generate the stylized novel view image $\mathbf{O}_v$ from the 2D feature map $\mathbf{F}_v^d$ . + +Model training. We keep the pre-trained VGG-19 feature extractor fixed during the whole training phase. We first train the decoder network to perform the non-stylized novel view synthesis. Since the ground-truth (non-stylized) novel view image is available in the training sets, we use the $\ell 1$ reconstruction loss to optimize the decoder network. We then keep the decoder network fixed, and train the proposed point cloud transformation module with the following loss functions: + +- Content loss $\mathcal{L}_c$ ensures the preservation of the content information by measuring the distance between the pre-trained VGG-19 features of the generated stylized image $\mathbf{O}_v$ and the ground-truth (non-stylized) image $\mathbf{I}_v$ . +- Style loss $\mathcal{L}_s$ encourages the synthesized image $\mathbf{O}_v$ + +![](images/3e5b7c18d6f1d2ef9110ce8eb248205a580f79e5a6e2e887c4fd3c1284d61367.jpg) +Figure 5. Visual comparisons to image stylization-based approaches. We compare the stylized novel view images generated by the three image stylization alternative schemes and our model on Tanks and Temples dataset [25]. + +![](images/758fbabcac8b887006f4f67985b1794d6eefac5796edd0fb257e608ecbaae3c0.jpg) +Figure 6. Visual comparisons to video stylization-based approaches. We compare the stylized novel view images generated by the three video stylization alternative schemes and our model on Tanks and Temples dataset [25]. + +![](images/6946ac1075f73e0943ac21c19802f891e3d31c839dcb56ea0a36433c91f70807.jpg) +Input views & style images + +![](images/e63f8ce56c5f0f81fcb6bfb0fdd2c5f5eaa978390f0f2800bb0eb016988ec0b9.jpg) +Figure 7. Qualitative results on the FVS dataset. We demonstrate the generalization of the proposed approach by training on the Tanks and Temples dataset, then testing on the FVS dataset. + +![](images/f882d4f80668a6d677e6749f2ba1163fd8417eed93039efd95b4e7da52941bac.jpg) +Stylized novel views + +![](images/aa8bb8079f49ffa27fc045ac9a2bdf90cfef1c5a2d5d9b8d524090eec671a22a.jpg) + +to match the style of the reference image S. Similar to recent style transfer approaches [22, 30], we extract the features at different layers of the pre-trained VGG-19 model, and compute the gram matrix differences. + +The overall loss function for training the point cloud transformation module is + +$$ +\mathcal {L} = \mathcal {L} _ {c} \left(\mathbf {O} _ {v}, \mathbf {I} _ {v}\right) + \lambda \mathcal {L} _ {s} \left(\mathbf {O} _ {v}, \mathbf {S}\right), \tag {2} +$$ + +where $\lambda$ controls the importance of each loss term. + +# 4. Experimental Results + +We conduct extensive experiments on two real-world datasets to validate the efficacy of the proposed 3D scene stylization model. + +Datasets. We use the Tanks and Temples [25] dataset for quantitative evaluation. Similar to the setting in FVS [45], we use 17 out of the 21 scenes for the training. The four remaining scenes (Truck, Train, M60 and Playground) are used for testing. We also present qualitative results on the FVS [45] dataset, which consists of 6 scenes: Bike, Flowers, Pirate, Digger, Sandbox and Soccertable. Note that both datasets are collected by handheld cameras in un- + +constraint motions. + +Evaluated methods. As the 3D scene stylization task is a relatively new problem, we evaluate our method against alternative approaches built upon the state-of-the-art novel view synthesis NeRF++ [64], SVS [46], and image/video stylization schemes: + +- Image stylization $\rightarrow$ novel view synthesis: We first use image stylization schemes LST [30] or TPFR [53] to transfer the style to the input images $\{\mathbf{I}_n\}_{n=1}^N$ , then perform novel view synthesis. +- Novel view synthesis $\rightarrow$ image stylization: We apply image stylization to the novel view synthesis results. +- Novel view synthesis $\rightarrow$ video stylization: We use a series of novel view synthesis results to create a video, then apply video stylization methods Compound [56], FMVST [11], or MCC [9]. + +# 4.1. Qualitative Results + +Image stylization. Figure 5 presents the qualitative comparison between the stylized novel view images generated by the three image stylization alternative schemes and the proposed method. Since the images are stylized inde + +![](images/791270be9f345af6b03670c0dc72a6196ebf4d89535a21b892abbe87a6db6156.jpg) +(a) Consistency + +![](images/2b9d5fcab68a112c6e166cf7aa401f3401e2c1a5366a76cfdf00058dd5331ab7.jpg) +(b) Stylization + +![](images/2a35cc6ef28a49e0ebb92b2abdffcaa56ba7d02796f8d2ff6f0ebc812106606e.jpg) +Figure 8. User preference study. We conduct a user study and ask subjects to select the results that (a) have more consistent contents across different video frames (e.g. less flickering), (b) better match the style of the example image. The number indicates the percentage of preference. + +pendently without considering the consistency issue across different viewpoints, we observe two issues in the image stylization-based methods. First, LST $\rightarrow$ SVS generally produces blurry novel view images. Since the stylized input images are not consistent, the novel view synthesis approach tends to blend such inconsistency, which leads to blurry results. Second, the novel view synthesis results are not consistent if we operate in the reverse order, i.e. SVS $\rightarrow$ LST. We highlight the inconsistency using yellow boxes in Figure 5. Note that we observe the same problem if we replace SVS with NeRF++. + +Video stylization. We qualitatively evaluate the results by the proposed method and three video stylization alternative approaches in Figure 6. Specifically, we create the videos using a series of novel view synthesis results. All the alternative approaches generate inconsistent results between two relatively far-away viewpoints since the video stylization methods only guarantee short-term consistency in the video. Although SVS $\rightarrow$ Compound generates less inconsistent results, the style of the novel view images is bland and not aligned with that of the reference image. On the other hand, SVS $\rightarrow$ FMVST creates images that better match the desired style, but fails to preserve the content of the original scene. + +In contrast to the image and video stylization alternative approaches, our method 1) generates sharp novel view images with correct scene contents and the desired style, and 2) guarantees the short/long-range consistency. Furthermore, we demonstrate the generalization of the proposed + +Table 1. Short-range consistency. We compare the long-range consistency using the warping error $(\downarrow)$ between the viewpoints of $(t - 1)$ -th and $t$ -th testing video frames in the Tanks and Temples dataset [25]. We report the average errors of 15 diverse styles. The best performance is in bold and the second best is underscored. + +
MethodTruckPlaygroundTrainM60Average
NeRF++→LST0.2150.1680.2500.2740.231
SVS→LST0.1920.1590.2200.2410.206
NeRF++→TPFR0.2160.2140.2990.2790.258
SVS→TPFR0.2350.2370.2910.2760.264
NeRF++→Compound0.1880.1690.2290.2080.202
SVS→Compound0.1660.1560.1990.1600.172
NeRF++→FMVST0.3420.3000.4050.3480.354
SVS→FMVST0.3430.3040.4120.3370.354
NeRF++→MCC0.2500.2010.2690.2550.246
SVS→MCC0.2420.1980.2600.2240.232
Ours0.1840.1580.1700.1720.170
+ +Table 2. Long-range consistency. We compare the long-range consistency using the warping error $(\downarrow)$ between the viewpoints of $(t - 7)$ -th and $t$ -th testing video frames in the Tanks and Temples dataset [25]. We report the average errors of 15 diverse styles. The best performance is in bold and the second best is underscored. + +
MethodTruckPlaygroundTrainM60Average
NeRF++→LST0.5700.3490.5200.6390.521
SVS→LST0.5670.3270.4700.6030.489
NeRF++→TPFR0.5790.4360.5030.6550.541
SVS→TPFR0.6050.4300.4700.5810.513
NeRF++→Compound0.5860.3980.4770.5570.498
SVS→Compound0.5730.3880.4220.4600.449
NeRF++→FMVST0.7420.5250.6360.6950.644
SVS→FMVST0.7320.5190.6200.6620.626
NeRF++→MCC0.6910.4500.5350.6460.571
SVS→MCC0.6930.4470.5160.5840.548
Ours0.5590.3370.4120.4580.431
+ +framework in Figure 7, where we use the model trained on the Tanks and Temples dataset to perform the 3D scene stylization task on the FVS dataset. + +# 4.2. Quantitative Results + +Stylization quality. We conduct a user study to understand the user preference between the proposed and the alternative approaches. For each testing scene in the Tanks and Temples dataset, we create a video using a series of stylized novel view synthesis results. By presenting two videos generated by different methods for the same scene, we ask the participants to select the one that (1) has more consistent contents across different video frames (e.g., less flickering), and (2) better matches the style of the reference image. As the results shown in Figure 8, the synthesized images by the proposed method are consistent and close to the reference style. We observe that the users slightly prefer the style generated by SVS $\rightarrow$ FMVST. However, as illustrated in Section 4.1 and Figure 6, SVS $\rightarrow$ FMVST fails to preserve the content of the original scene. + +Short-range consistency. We use the warped LPIPS metric [65] to measure the consistency of the results across different viewpoints. Given a stylized image at a novel view + +![](images/66d56808748e825a8e72531ba933285cb532f7ea45f7f89a3cfbfea0f57784ab.jpg) + +![](images/5038cfae5129c6c2f543841427d4693ea9221a70856c96ac0826c41a79e466e1.jpg) + +![](images/14c42c34d4576f1dc434e4609886d0e34611a6d264286d4602ee60ef49281454.jpg) + +![](images/e3a5c69e6dc78faec06d96473523b65e3e30a0ef5cad9182563da6b47b0d31da.jpg) +w/o Point cloud aggregation Cluttered coloring + +![](images/5552d178a8d68b99c21966a0ecc497202ba7ffcc8be004b247fa03c39fb98bf6.jpg) + +![](images/1f8436ff2b2908ceeafc4e73f4b1b2d706048a2c109accc12f13ecda18bc13e0.jpg) +1 point cloud aggregation Imbalance + +![](images/61eaa28c503ef43c3e276e747cfeaffe01cee6035fa9a2895fafff61f1d12dd7.jpg) + +![](images/e24b0f83e621331e0303558cc5a877d528297d4b30a67610e58e2332e014e854.jpg) +3 point cloud aggregations + +![](images/290b041e5b1da41f56a5c456375a24c8424a5d217ac88876358d21eb26682f20.jpg) + +![](images/eced0ac20e69dc5e49e7cc4a6be4d201fb8a29da9c86c13c12f0b73816211c8f.jpg) +5 point cloud aggregations Low contrast + +![](images/ed6398e29e17a0154c87c1d8331b6d922769bd596b09660383c29332fc015760.jpg) +Figure 9. Ablation study on the number of point cloud aggregation modules. We compare the visual results of using 0/1/3/5 modules. We empirically decide to use 3 modules for better visual quality. +w/o Point cloud aggregation +Figure 10. Role of point aggregation. We visualize the point distribution before and after the point aggregation. Our point aggregation module obtains a more uniform-distributed point set to fairly estimate the transformation matrix $\mathbf{T}$ that achieves better 3D scene stylization results. + +![](images/185710b57c3a501063ddef018ecf32110754745e9a54455f1880bedf6338342c.jpg) +w/ Point cloud aggregation + +$v$ , we warp the results generated at another novel view $v'$ to the view $v$ according to the 3D proxy geometry described in Section 3.1. We then compute the score by + +$$ +E _ {\text {w a r p}} \left(\mathbf {O} _ {v}, \mathbf {O} _ {v} ^ {\prime}\right) = \operatorname {L P I P S} \left(\mathbf {O} _ {v}, W \left(\mathbf {O} _ {v} ^ {\prime}\right), \mathbf {M} _ {v ^ {\prime} v}\right), \tag {3} +$$ + +where $W$ is the warping function and $\mathbf{M}_{v'v}$ is the mask of valid pixels warped from the views $v'$ to $v$ . Note that we only use the values of valid pixels in the mask for the "spatial average" operation in [65]. For each of the testing scenes in the Tanks and Temples dataset, we use 15 style images [11] to compute the average warping error. + +We first present the short-range consistency comparison in Table 1. In this experiment, we use the nearby view for a specific novel view to compute the warping error. In general, the image stylization alternative methods produce short-range inconsistent results as they process each novel view independently. In contrast, the proposed method performs comparably against the video stylization-based approach SVS $\rightarrow$ Compound that considers the short-term consistency in videos. Nevertheless, SVS $\rightarrow$ Compound synthesizes bland styles that do not match the desired styles, as the results demonstrated in Figure 6 and Figure 8. + +Long-range consistency. We also consider the long-range + +consistency issue in our experiments. In this experiment, we compute the warping error between the results of two (relatively) far-away views. As demonstrated in Table 2, the proposed method performs favorably against the alternative approaches. Despite the capability of ensuring short-range consistency, video stylization-based schemes fail to maintain the long-range consistency. + +Number of point cloud aggregation modules. We conduct an ablation study to decide the number of point cloud aggregation modules described in Section 3.2. The results are presented in Figure 9. We empirically choose to use three modules for better visual quality. Moreover, we visualize the point distributions before and after the aggregation in Figure 10 to understand the role of the aggregation module. The point density before the aggregation is higher around the regions of the 3D scene where more input images cover. As a result, the prediction of the transformation matrix $\mathbf{T}$ is dominated by such regions, which leads to low-quality stylization results (2nd column in Figure 9). By using the point cloud aggregation modules, we obtain a more uniform-distributed point set that fairly estimates the matrix $\mathbf{T}$ for the 3D scene stylization task. + +# 5. Conclusions + +In this work, we introduce a 3D scene stylization problem that aims to modify the style of the 3D scene and synthesize images at arbitrary novel views. We construct a single 3D representation, i.e. point cloud, for the holistic scene, and design a point cloud transformation module to transfer the style of the reference image to the 3D representation. Qualitative and quantitative evaluations validate that our method synthesizes images that 1) contain the desired style and 2) are consistent across various novel views. + +# Acknowledgements + +This work is supported in part by the NSF CAREER Grant #1149783 and a gift from Verisk. + +# References + +[1] Kara-Ali Aliev, Artem Sevastopolsky, Maria Kolos, Dmitry Ulyanov, and Victor Lempitsky. Neural point-based graphics. In ECCV, 2020. 2 +[2] Iro Armeni, Sasha Sax, Amir R Zamir, and Silvio Savarese. Joint 2d-3d-semantic data for indoor scene understanding. arXiv preprint arXiv:1702.01105, 2017. 3 +[3] Xu Cao, Weimin Wang, Katashi Nagao, and Ryosuke Nakamura. Psnet: A style transfer network for point cloud stylization on geometry and color. In WACV, 2020. 3 +[4] Dongdong Chen, Jing Liao, Lu Yuan, Nenghai Yu, and Gang Hua. Coherent online video style transfer. In ICCV, 2017. 3 +[5] Dongdong Chen, Lu Yuan, Jing Liao, Nenghai Yu, and Gang Hua. Stylebank: An explicit representation for neural image style transfer. In CVPR, 2017. 2 +[6] Dongdong Chen, Lu Yuan, Jing Liao, Nenghai Yu, and Gang Hua. Stereoscopic neural style transfer. In CVPR, 2018. 3 +[7] Xinghao Chen, Yiman Zhang, Yunhe Wang, Han Shu, Chunjing Xu, and Chang Xu. Optical flow distillation: Towards efficient and stable video style transfer. In ECCV, 2020. 3 +[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 4 +[9] Yingying Deng, Fan Tang, Weiming Dong, haibin Huang, Ma chongyang, and Changsheng Xu. Arbitrary video style transfer via multi-channel correlation. In AAAI, 2021. 2, 3, 6 +[10] Chang Gao, Derun Gu, Fangjun Zhang, and Y. Yu. Reconet: Real-time coherent video style transfer network. In ACCV, 2018. 3 +[11] Wei Gao, Yijun Li, Yihang Yin, and Ming-Hsuan Yang. Fast video multi-style transfer. In WACV, 2020. 2, 3, 6, 8 +[12] Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. 2 +[13] Xinyu Gong, Haozhi Huang, Lin Ma, Fumin Shen, Wei Liu, and Tong Zhang. Neural stereoscopic image style transfer. In ECCV, 2018. 3 +[14] Teofilo F Gonzalez. Clustering to minimize the maximum intercluster distance. Theoretical computer science, 38:293-306, 1985. 4 +[15] Agrim Gupta, Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Characterizing and improving stability in neural style transfer. In ICCV, 2017. 3 +[16] Tewodros Habtegebrial, Varun Jampani, Orazio Gallo, and Didier Stricker. Generative view synthesis: From single-view semantics to novel-view images. In NeurIPS, 2020. 1 +[17] David Hart, Bryan Morse, and Jessica Greenland. Style transfer for light field photography. In WACV, 2020. 3 +[18] Haozhi Huang, Hao Wang, Wenhan Luo, Lin Ma, Wenhao Jiang, Xiaolong Zhu, Zhifeng Li, and Wei Liu. Real-time neural style transfer for videos. In CVPR, 2017. 3 +[19] Hsin-Ping Huang, Hung-Yu Tseng, Hsin-Ying Lee, and Jia-Bin Huang. Semantic view synthesis. In ECCV, 2020. 1 +[20] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017. 3 + +[21] Michal Jancosek and Tomas Pajdla. Multi-view reconstruction preserving weakly-supported surfaces. In CVPR, 2011. 4 +[22] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. 2, 6 +[23] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In CVPR, 2018. 3 +[24] Roman Klokov and Victor Lempitsky. Escape from cells: Deep kd-networks for the recognition of 3d point cloud models. In ICCV, 2017. 3 +[25] Arno Knapitsch, Jaesik Park, Qian-Yi Zhou, and Vladlen Koltun. Tanks and temples: Benchmarking large-scale scene reconstruction. ACM TOG (Proc. SIGGRAPH), 36(4), 2017. 2, 3, 5, 6, 7 +[26] Johannes Kopf, Michael Cohen, and Richard Szeliski. First-person hyper-lapse videos. ACM TOG (Proc. SIGGRAPH), 33:1-10, 07 2014. 4 +[27] Johannes Kopf, Kevin Matzen, Suhib Alsisan, Ocean Quigley, Francis Ge, Yangming Chong, Josh Patterson, Jan-Michael Frahm, Shu Wu, Matthew Yu, et al. One shot 3d photography. ACM TOG (Proc. SIGGRAPH), 39(4):76-1, 2020. 2 +[28] Truc Le and Ye Duan. Pointgrid: A deep network for 3d shape understanding. In CVPR, 2018. 3 +[29] Jiaxin Li, Ben M Chen, and Gim Hee Lee. So-net: Self-organizing network for point cloud analysis. In CVPR, 2018. 3 +[30] Xueting Li, Sifei Liu, Jan Kautz, and Ming-Hsuan Yang. Learning linear transformations for fast arbitrary style transfer. In CVPR, 2019. 1, 2, 3, 4, 6 +[31] Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In NIPS, 2018. 3 +[32] Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Diversified texture synthesis with feed-forward networks. In CVPR, 2017. 2 +[33] Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Universal style transfer via feature transforms. In NIPS, 2017. 3 +[34] Andrew Liu, Richard Tucker, Varun Jampani, Ameesh Makadia, Noah Snavely, and Angjoo Kanazawa. Infinite nature: Perpetual view generation of natural scenes from a single image. arXiv preprint arXiv:2012.09855, 2020. 1 +[35] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. In NeurIPS, 2020. 2 +[36] Arun Mallya, Ting-Chun Wang, Karan Sapra, and Ming-Yu Liu. World-consistent video-to-video synthesis. In ECCV, 2020. 3 +[37] Moustafa Meshry, Dan B. Goldman, Sameh Khamis, Hugues Hoppe, Rohit Pandey, Noah Snavely, and Ricardo Martin-Brualla. Neural rerendering in the wild. In CVPR, 2019. 2 +[38] Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. 1, 2 + +[39] Carsten Moenning and Neil A Dodgson. Fast marching farthest point sampling. Technical report, University of Cambridge, Computer Laboratory, 2003. 4 +[40] Simon Niklaus, Long Mai, Jimei Yang, and Feng Liu. 3d ken burns effect from a single image. ACM TOG (Proc. SIGGRAPH), 38(6):1-15, 2019. 2 +[41] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017. 3 +[42] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017. 3 +[43] Charles R Qi, Li Yi, Hao Su, and Leonidas J Guibas. Point-net++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017. 4 +[44] Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari. Accelerating 3d deep learning with pytorch3d. arXiv preprint arXiv:2007.08501, 2020. 4 +[45] Gernot Riegler and Vladlen Koltun. Free view synthesis. In ECCV, 2020. 2, 6 +[46] Gernot Riegler and Vladlen Koltun. Stable view synthesis. In CVPR, 2021. 1, 2, 6 +[47] Johannes L. Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In CVPR, 2016. 4 +[48] Johannes Schonberger, Enliang Zheng, Marc Pollefeys, and Jan-Michael Frahm. Pixelwise view selection for unstructured multi-view stereo. In ECCV, 2016. 4 +[49] Falong Shen, Shuicheng Yan, and Gang Zeng. Neural style transfer via meta networks. In CVPR, 2018. 2 +[50] Meng-Li Shih, Shih-Yang Su, Johannes Kopf, and Jia-Bin Huang. 3d photography using context-aware layered depth inpainting. In CVPR, 2020. 2 +[51] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. 4 +[52] Pratul P. Srinivasan, Richard Tucker, Jonathan T. Barron, Ravi Ramamoorthi, Ren Ng, and Noah Snively. Pushing the boundaries of view extrapolation with multiplane images. In CVPR, 2019. 2 +[53] Jan Svoboda, Asha Anoosheh, Christian Osendorfer, and Jonathan Masci. Two-stage peer-regularized feature recombination for arbitrary image style transfer. In CVPR, 2020. 1, 3, 6 +[54] Richard Tucker and Noah Snavely. Single-view view synthesis with multiplane images. In CVPR, 2020. 2 +[55] Dmitry Ulyanov, Vadim Lebedev, Andrea Vedaldi, and Victor Lempitsky. Texture networks: Feed-forward synthesis of textures and stylized images. In ICML, 2016. 2 +[56] Wenjing Wang, Jizheng Xu, Li Zhang, Yue Wang, and Jiaying Liu. Consistent video style transfer via compound regularization. In AAAI, 2020. 2, 3, 6 +[57] Olivia Wiles, Georgia Gkioxari, Richard Szeliski, and Justin Johnson. SynSin: End-to-end view synthesis from a single image. In CVPR, 2020. 2, 4 +[58] Suttisak Wizadwongsa, Pakkapon Phongthawee, Jiraphon Yenphraphai, and Supasorn Suwajanakorn. Nex: Real-time view synthesis with neural basis expansion. In CVPR, 2021. 2 + +[59] Wenxuan Wu, Zhongang Qi, and Li Fuxin. Pointconv: Deep convolutional networks on 3d point clouds. In CVPR, 2019. 3 +[60] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In CVPR, 2015. 3 +[61] Saining Xie, Sainan Liu, Zeyu Chen, and Zhuowen Tu. Attentional shapecontextnet for point cloud recognition. In CVPR, 2018. 3 +[62] Li Yi, Vladimir G Kim, Duygu Ceylan, I-Chao Shen, Mengyan Yan, Hao Su, Cewu Lu, Qixing Huang, Alla Sheffer, and Leonidas Guibas. A scalable active framework for region annotation in 3d shape collections. ACM TOG (Proc. SIGGRAPH), 35(6):1-12, 2016. 3 +[63] Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa. pixelNeRF: Neural radiance fields from one or few images. In CVPR, 2021. 2 +[64] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. Nerf++: Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020. 1, 2, 6 +[65] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018. 2, 7, 8 +[66] Hengshuang Zhao, Li Jiang, Chi-Wing Fu, and Jiaya Jia. PointWeb: Enhancing local neighborhood features for point cloud processing. In CVPR, 2019. 3 +[67] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: learning view synthesis using multiplane images. ACM TOG (Proc. SIGGRAPH), 37(4):1-12, 2018. 2 \ No newline at end of file diff --git a/learningtostylizenovelviews/images.zip b/learningtostylizenovelviews/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b78295eecd4762239dd70f81cfe3a137db0850d8 --- /dev/null +++ b/learningtostylizenovelviews/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5911151287c73abb71960ad63f81dc1c83798e489113f087e436c848163883d0 +size 1522040 diff --git a/learningtostylizenovelviews/layout.json b/learningtostylizenovelviews/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..49c901ad7abed08f7769d865cf57c1d966879d96 --- /dev/null +++ b/learningtostylizenovelviews/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd7a5d5241d9026988f71ab4ff4540a682fb4c02ebe5bfce742fb0bc5a23ded2 +size 451614 diff --git a/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_content_list.json b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..20604bdc1afd5c7cdbc57e916d2723512dce0ffc --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e43cfc92d7e8d007dfa0de0032b1bd4042659874c194e53246db1f3a7406b6f +size 75995 diff --git a/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_model.json b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1204c5eb8b765a118095193f56798815bc399630 --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a21e7c1eb9233a7abefcb981410eb0ab8bf7f415706a1f536b76ed6a2d03bf80 +size 94628 diff --git a/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_origin.pdf b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1bba2f9476950d97a4be7a98db7542db30cfea20 --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/c528d6a0-5eb8-4911-827c-01b0bb7abf80_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90f96fe851a8020fee5609ad1630ceb89955e0b9ca3ff2c9ef1edd1dc38a4dcc +size 1757534 diff --git a/learningtotrackobjectsfromunlabeledvideos/full.md b/learningtotrackobjectsfromunlabeledvideos/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5f5982b7960b207d095e6ba2f8d4788ea8d70828 --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/full.md @@ -0,0 +1,301 @@ +# Learning to Track Objects from Unlabeled Videos + +Jilai Zheng $^{1}$ Chao Ma $^{1*}$ Houwen Peng $^{2}$ Xiaokang Yang $^{1}$ $^{1}$ MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University + $^{2}$ Microsoft Research + +{zhengjilai,chaoma,xkyang}@sjtu.edu.cn,houwen.peng@microsoft.com + +# Abstract + +In this paper, we propose to learn an Unsupervised Single Object Tracker (USOT) from scratch. We identify that three major challenges, i.e., moving object discovery, rich temporal variation exploitation, and online update, are the central causes of the performance bottleneck of existing unsupervised trackers. To narrow the gap between unsupervised trackers and supervised counterparts, we propose an effective unsupervised learning approach composed of three stages. First, we sample sequentially moving objects with unsupervised optical flow and dynamic programming, instead of random cropping. Second, we train a naive Siamese tracker from scratch using single-frame pairs. Third, we continue training the tracker with a novel cycle memory learning scheme, which is conducted in longer temporal spans and also enables our tracker to update online. Extensive experiments show that the proposed USOT learned from unlabeled videos performs well over the state-of-the-art unsupervised trackers by large margins, and on par with recent supervised deep trackers. Code is available at https://github.com/VISION-SJTU/USOT. + +# 1. Introduction + +Visual object tracking is one of the most fundamental computer vision tasks with numerous applications, such as autonomous driving, intelligent surveillance, robot, and human-computer interaction. The past few years have witnessed considerable progress in visual object tracking, thanks to the powerful representation of deep learning. In spite of the success, the state-of-the-art deep tracking algorithms are data-hungry, requiring a huge number of annotated data for supervised training. As manually labeled data are expensive and time-consuming, exploiting ubiquitous unlabeled videos for visual tracking has drawn increasing attention recently. Following the classic pipeline of unsupervised learning, existing unsupervised trackers randomly crop template regions on unlabeled videos and employ ei + +![](images/725dd9df957d3eb2ab1870a75440de953e5add308967396a4df54dc71d87dbf0.jpg) +Figure 1: Comparison on the VOT2017/18 benchmark with recent deep trackers. The proposed trackers, USOT and USOT*, perform well over the state-of-the-art unsupervised deep trackers, including LUDT [38], LUDT+ [38], and S²SiamFC [34], and on par with recent supervised trackers. Notation: SiamFC [2], SiamDW [47], SiamRPN [26], C-RPN [12], DaSiamRPN [50], ATOM [8], SiamRPN++ [25], DiMP [3], KYS [4]. + +ther self consistency [34] or cycle consistency [37] as a pretext task for learning to track. Despite the promising results, there still exists a large performance gap between unsupervised and supervised trackers. In view of the great success of unsupervised learning on a number of other vision tasks, such as video object segmentation [23], optical flow [28] and depth estimation [14], it is of great interest to narrow the gap between unsupervised and supervised trackers. + +We identify three critical challenges that cause the performance bottleneck of unsupervised trackers. 1) Moving object discovery. As ground truth bounding boxes are not available, existing unsupervised trackers randomly sample regions in frames as pseudo templates [37, 34]. Random samples are far from precisely locating objects, not to mention learning to distinguish between objects and background. Moreover, as random samples do not contain clear edges of objects, they are not suitable for bounding box re + +gression learning. The lack of bounding box regression for scale change estimation heavily limits the performance of unsupervised trackers. 2) Rich temporal variation exploitation. Due to the lack of labels in the temporal span, existing unsupervised trackers struggle to learn from rich motion clues. For example, UDT [37] performs forward and backward tracking within at most 10 frames. In such a short clip, the foreground objects show highly correlated appearances with little variations, causing a failure to exploit rich temporal variations over a long span for training. 3) Online update. Online update helps to exploit the temporal smoothness and has demonstrated great success in leading supervised tracking methods [35, 3, 46, 48]. While supervised trackers usually collect multiple object samples in separated frames for learning online modules [3, 13], it is more challenging to train online branches for unsupervised trackers, due to lack of even coarse object locations in videos. + +To address these challenges, we propose to train a robust tracker from unlabeled videos. First, for data preparation, we develop a sequential box sampling algorithm to coarsely discover moving objects from unlabeled videos. Specifically, we use unsupervised optical flow to detect moving objects and apply dynamic programming to sequentially link candidate boxes. Second, we naively train from scratch an unsupervised Siamese tracker using single-frame pairs. That is, we train with each Siamese pair cropped based on the sampled box in a single frame. Despite its simplicity, we show that this strategy provides a great initialization for the unsupervised tracker, thus beneficial to future training in longer temporal spans. Third, we propose a cycle memory learning scheme to continue training the naive tracker. Specifically, we divide the whole video into a number of fragments according to the detected moving object trajectory. We then conduct forward tracking from a single frame to several other frames in the same fragment, and store all intermediate tracking results in a memory queue. We then track backward to the initial frame to compute the consistency loss. Since the length of video fragments is quite long (averaged 64.6 frames on VID [33]) compared with UDT [37] (<10 frames), our tracker can capture large motion and appearance variations. More importantly, the proposed cycle memory scheme allows updating the memory queue online for model update (see Sec. 4.3). + +We evaluate the proposed unsupervised tracker on six large-scale benchmarks. Extensive experiments show that our proposed tracker performs well over the state-of-the-art unsupervised trackers by large margins, and on par with the recent supervised trackers (see Fig. 1). The main contributions of this work are summarized as follows: + +- We coarsely discover moving objects from unlabeled videos for unsupervised learning. +- We train a naive Siamese tracker with single-frame pairs and gradually extend it to longer temporal spans. + +- We propose a cycle memory learning scheme, allowing unsupervised trackers to update online. + +# 2. Related Work + +Supervised Tracking. Deep learning has revolutionized the field of visual tracking by powerful representation. In the past few years, template-based deep trackers with Siamese networks have received increasing attention due to the promising results on benchmark datasets. These trackers regard the target object as a template and search over a cropped window to locate the target. SiamFC [2] first utilizes the same backbone network to extract deep features from both the template patch and the search patch, and computes the response map with cross-correlation. Since then, considerable efforts have been made to extend Siamese trackers. SiamRPN [26] incorporates a region proposal network (RPN) [31] into the Siamese framework. DiMP [3] proposes to attach an online module to Siamese trackers for template update. Other noticeable improvements in the Siamese framework involve advanced backbone network [47], correlation method [25], attention mechanism [45], re-detection module [36], mask generation [40], feature alignment [48], anchor-free regressor [6, 15], etc. With these efforts, Siamese trackers have shown the superior tracking performance thus far. However, training Siamese trackers requires a huge number of labeled training data. In this work, we aim at a novel unsupervised learning scheme, which helps to learn template-based trackers from unlabeled videos in the wild. + +Unsupervised Tracking. The pioneer unsupervised deep tracker (UDT) [37] suggests that a robust tracker is able to track an object forward and backward in a video and finally return to its initial location in the starting frame. UDT develops a tracker based on DCFNet [39], and computes a cycle consistency loss between forward and backward trajectories in the training phase. The contemporary method of UDT is TimeCycle [41], which proposes cycle consistency to generate unsupervised video representation. JSLTC [27] proposes to calculate an inter-frame affinity matrix to model the transitions between video frames and use such correspondence to track objects. $\mathrm{S}^2$ SiamFC [34] adopts the self-Siamese pipeline to train a foreground/background classifier like SiamFC [2] from single-frame pairs, showing comparable results to the supervised counterpart. Despite the promising results, there exists a large performance gap between the state-of-the-art unsupervised trackers and the top-performing supervised ones. We identify three critical challenges, moving object discovery, rich temporal variation exploitation, and online update, that cause the performance bottleneck of unsupervised trackers. By effectively tackling these challenges, the proposed unsupervised tracker outperforms the state-of-the-art unsupervised trackers by large margins, and is on par with recent supervised trackers. + +# 3. Proposed Method + +In this section, we present the proposed unsupervised tracker in detail. The unsupervised training scheme involves three stages. The first stage in Sec. 3.1 aims to produce a trajectory of moving objects from unlabeled videos. The second stage in Sec. 3.2 learns a naive Siamese tracker using single-frame pairs. The third stage in Sec. 3.3 continues training the naive tracker by means of cycle memory learning, which is performed in longer temporal spans and also enables the unsupervised tracker to update online. + +# 3.1. Moving Object Discovery + +Instead of randomly cropping objects, we propose to generate a smooth bounding box sequence for moving foreground objects in unlabeled videos. For discovering moving objects, we have two key observations: + +- Foreground objects tend to have distinguishing motion patterns in contrast to the background surroundings. This inspires us to discover candidate foreground objects by means of unsupervised optical flow. +- The trajectories of moving objects tend to be smooth. This motivates us to employ dynamic programming (DP) to get temporally reliable box sequences. + +Candidate Box Generation. Let an arbitrary video be $\mathcal{I}$ including $L$ successive frames with the same size $W\times H$ , namely $\mathcal{I} = \{I_t\mid 1\leq t\leq L\}$ , where $I_{t}$ is the $t^{th}$ frame in $\mathcal{I}$ . To locate the potential foreground object in frame $I_{t}$ , we first compute the optical flow map $F_{t}$ with frame $I_{t}$ and frame $I_{t + T_f}$ , i.e., $F_{t} = Flow_{t\to t + T_{f}}$ . $T_{f}$ is an interval for computing optical flow. As is illustrated in Fig. 2, we obtain $F_{t}$ from frame $I_{t}$ and frame $I_{t + T_f}$ using the off-the-shelf unsupervised ARFlow [28] algorithm, and then transform $F_{t}$ to a distance map $D_{t}$ . We binarize $D_{t}$ to get a mask $M_{t}$ as follows: + +$$ +\begin{array}{l} M _ {t} ^ {i} = \left\{ \begin{array}{l l} 1 & \text {i f} D _ {t} ^ {i} \geq \alpha \cdot \max _ {j} (D _ {t} ^ {j}) + (1 - \alpha) \cdot \operatorname {m e a n} _ {j} (D _ {t} ^ {j}) \\ 0 & \text {o . w .} \end{array} \right. \\ \text {w h e r e} D _ {t} ^ {i} = \left\| F _ {t} ^ {i} - \operatorname {m e a n} _ {j} \left(F _ {t} ^ {j}\right) \right\| _ {2}, \tag {1} \\ \end{array} +$$ + +and $\alpha \in (0,1)$ is a hyper-parameter. Here superscript denotes pixel-wise index. The maximum value and mean value within the spatial dimension are respectively indicated by max and mean. + +Every connected area with all internal pixels satisfying $M_t^i = 1$ corresponds to an area which has distinguishing motion compared with background in $I_t$ , and this area is more likely to cover a foreground object. To further filter out unreliable areas from these candidates, we take the circumscribed rectangles of all these areas as initial candidate boxes, and score the boxes according to their sizes and positions. Due to center bias, larger bounding boxes in the + +![](images/0fe3508b236b4132a8e309a34061eb6c72feb82f7042ac0a49addeab842e5112.jpg) +Figure 2: Candidate box generation via optical flow. The flow map $F_{t}$ contains the distinguishing motion patterns of moving objects. We binarize the flow map $F_{t}$ using a distance metric $D_{t}$ to generate the candidate box $B_{t}$ . + +middle of the image should have higher quality scores. Let $B = (x_0, y_0, x_1, y_1)$ denote the top-left and bottom-right corners of a box. The quality score $S_c$ of the box $B$ is defined as: + +$$ +\begin{array}{l} S _ {c} (B) = \left(x _ {1} - x _ {0}\right) \left(y _ {1} - y _ {0}\right) + \tag {2} \\ \beta \cdot \min (x _ {0}, W - x _ {1}) \min (y _ {0}, H - y _ {1}), \\ \end{array} +$$ + +where $\beta$ is a weight parameter. The box with the highest score is selected as the final candidate box $B_{t}$ for frame $I_{t}$ . We denote the set of all these selected candidate boxes in video $\mathcal{I}$ as $\mathcal{B} = \{B_t\mid 1\leq t\leq L\}$ . + +Box Sequence Generation. The generated candidate bounding boxes $\mathcal{B}$ may contain noisy boxes due to camera shake, occlusion, etc. To remove unreliable boxes, we apply dynamic programming to create a more reliable bounding box sequence $\mathcal{B}'$ . According to the second observation that the trajectory of a moving object in a video should be smooth, we select a subset of candidate bounding boxes from $\mathcal{B}$ , where the trajectory of the selected boxes is as smooth as possible. For dynamic programming, the most critical issue is how to measure the reward of transition in the box trajectory from one bounding box to another. We modify the DIoU [49] metric, which originally considers the overlap and distance between two boxes. Formally, the reward $R_{dp}$ for dynamic programming is defined as: + +$$ +R _ {d p} \left(B _ {t}, B _ {t ^ {\prime}}\right) = I o U \left(B _ {t}, B _ {t ^ {\prime}}\right) - \gamma \cdot R _ {D I o U} \left(B _ {t}, B _ {t ^ {\prime}}\right), \tag {3} +$$ + +where $\gamma$ is a hyper-parameter. To encourage a smooth trajectory, we set $\gamma > 1$ for the distance penalty on $R_{DIOU}$ [49]. Note that dynamic programming aims at discovering an optimal path in the box sequence $\mathcal{B}$ with the highest reward accumulation (see the supplementary document for the complete algorithm). As shown in Fig. 3, for the frames whose candidate boxes are not selected by DP, we use linear interpolation to generate pseudo boxes based on their adjacent candidate boxes selected by DP. + +![](images/8ca1b363ad9c59dd31dcc93337b2feeb75fade915722979dd3248e359e6d7218.jpg) +Trajectory via dynamic programming + +![](images/bdb26bd354a8105cc0bd605d9e6937095fd372b3923f22885032b33311aab823.jpg) +Figure 3: Box sequence generation. We use dynamic programming to generate a smooth and reliable box trajectory from candidate boxes in yellow. Pseudo boxes in green in the remaining frames are generated through linear interpolation. + +![](images/ba77978605e545a00e661359bd4adb128cfccdb410f8bf1fe8c12416bfae3fb7.jpg) +Candidate boxes + +![](images/f047cf507dcf0eafddf99efb84d75228c5f1893cbfed9bd566dca3880dfab0ac.jpg) + +# 3.2. Naive Siamese Tracker + +With the generated box sequences, we train a naive Siamese tracker using single-frame pairs from scratch. This pretext task is based on a simple observation that an image and any of its sub-region naturally form a training pair of the Siamese network [34]. However, randomly sampled pseudo boxes as in [34] fail to cover foreground objects for effectively training Siamese networks. Moreover, random samples are not suitable for learning bounding box regression. This significantly hinders the performance of unsupervised trackers. We propose to utilize the reliable box sequence $\mathcal{B}'$ as training data. To ensure that the most precise bounding boxes in $\mathcal{B}'$ are sampled by the data loader, we adopt a two-level scoring mechanism to filter out low-quality boxes at both the sequence and frame levels. We find that denser frame selection by DP in video $\mathcal{I}$ tends to imply a more successful moving object discovery. As such, we define the quality score $Q_{v}$ of video $\mathcal{I} = \{I_t\mid 1\leq t\leq L\}$ as: + +$$ +Q _ {v} (\mathcal {I}) = \frac {N _ {d p}}{L}, \tag {4} +$$ + +where $N_{dp}$ indicates the number of frames in video $\mathcal{I}$ selected by DP. + +Similarly, the frame quality score evaluating the box $B_{t}^{\prime}$ in frame $I_{t}$ can be measured by the percentage of frames selected by DP within all its adjacent frames. Let $T_{s}$ be a fixed frame interval. We formally define the frame quality score $Q_{f}$ as: + +$$ +Q _ {f} \left(B _ {t} ^ {\prime}\right) = \frac {N _ {d p} ^ {\prime}}{2 T _ {s} + 1}, \tag {5} +$$ + +where $N_{dp}^{\prime}$ indicates the number of frames between frame $I_{t - T_s}$ and frame $I_{t + T_s}$ selected by DP. + +When loading training pairs, we sequentially conduct video sampling and frame sampling. We sample a video only if its quality score $Q_{v}(\mathcal{I}) \geq \theta_{1}$ , where $\theta_{1}$ is a threshold. During frame sampling, we randomly sample several frames with their total number positively correlated with $1 / Q_{v}(\mathcal{I})$ from the selected video, and then select the frame with the highest frame quality score $Q_{f}(B_{t}^{\prime})$ for training. + +We follow the conventional training paradigm as in SiamFC [2]. The input template $z_{t}$ and the search area $x_{t}$ are respectively of size $127 \times 127$ and $255 \times 255$ , both + +cropped from $I_{t}$ based on $B_{t}^{\prime}$ . After extracting deep features from the input pair, we adopt PrPool [19] to pool the template feature, and then compute the multi-scale correlation map [48]. The output response map $\mathcal{R}_{cls}$ is of size $25 \times 25 \times 1$ for foreground/background classification. The other output response map $\mathcal{R}_{reg}$ is of size $25 \times 25 \times 4$ for regressing the distances from the center location to the four sides of the bounding box. The loss function $\mathcal{L}_{naive}$ is the sum of both the regression and classification losses: + +$$ +\mathcal {L} _ {\text {n a i v e}} = \mathcal {L} _ {\text {r e g}} + \lambda_ {1} \mathcal {L} _ {\text {c l s}}, \tag {6} +$$ + +where $\mathcal{L}_{reg}$ and $\mathcal{L}_{cls}$ are respectively the IoU loss [44] and the binary cross-entropy (BCE) loss [10]. $\lambda_{1}$ is a weight parameter. + +# 3.3. Cycle Memory Training + +We view the above unsupervised Siamese tracker as a naive tracker as it incurs two limitations. First, as the template and search area are cropped in the same frame, the tracker is not learned with large motion and appearance variations. Second, this tracker cannot update itself online, thus fails to track objects in long temporal spans or under complex scenes. + +We propose to continue training the naive tracker using a cycle memory learning scheme, aiming to enable the tracker to handle large variations as well as update the memory queue online. The main idea of cycle memory can be summarized as in Fig. 4. In brief, we first conduct forward tracking from a template $z_{t}$ to $N_{mem}$ adjacent memory frames, then store features of all intermediate tracking results as a memory queue, and finally conduct backward tracking to the original search area $x_{t}$ . A cycle memory loss $\mathcal{L}_{mem}$ is computed using the same ground truth as $\mathcal{L}_{cls}$ . + +Specifically, at every training step, we simultaneously crop a training pair $z_{t}$ and $x_{t}$ in frame $I_{t}$ (the same as training the naive Siamese tracker), as well as $N_{mem}$ memory search areas sampled from $\{x_{t} \mid T_{l} \leq t \leq T_{u}\}$ . These memory search areas are cropped from $N_{mem}$ adjacent frames of $I_{t}$ according to the box sequence $\{B_{t}^{\prime} \mid T_{l} \leq t \leq T_{u}\}$ . Here $T_{l}$ and $T_{u}$ are the lower and upper frame indices for sampling memory frames. Selecting these two indices is quite important. To learn from long-term variations, the frame interval between $T_{l}$ and $T_{u}$ + +![](images/0e44aa27a78f8b928b02b216b91ae8041b7eb11afc40fd7d33ec6ae378ac3003.jpg) +Training Pipeline +Figure 4: Overview of the proposed unsupervised tracking framework. Left: The overall training pipeline. Right: The detailed structure of the naive Siamese tracker for self tracking and forward tracking, and the online module learned with the cycle memory scheme. The naive tracker is trained with a template and a search area cropped from the same frame, while the online module aims to track backward from the memory search areas to the template frame following the cycle learning pipeline. The circle notations with $*$ denote multi-scale correlation [48] for deep features, where the same color indicates weight sharing. The circle with $W$ refers to the confidence-value module for integrating the correlation maps (Eqn. 8). + +![](images/7a852dfdee09e4425ef81de73076c205da97a6f620de90b60df91d874030ac77.jpg) +Naive Siamese Tracker + +![](images/9a660b0b86e6a9a0761e9f5c1d6f16ddbd57c7a54583ef3f66cad93a455d0c1a.jpg) +Cycle Memory Learning + +should be large enough. However, excessive frame interval does harm to the learning process as the target object may disappear in frames far from $I_{t}$ . In practice, we dynamically set $T_{l}$ and $T_{u}$ at frame $I_{t}$ . Since they are two mirror variables, we formally define $T_{u}$ as follows: + +$$ +\begin{array}{l} T_{u}(I_{t}) = \max_{t\leq k\leq L}\{k\} \\ \text {s . t .} \quad \forall t < t ^ {\prime} \leq k, R _ {d p} \left(B _ {t ^ {\prime} - 1} ^ {\prime}, B _ {t ^ {\prime}} ^ {\prime}\right) \geq \theta_ {2} \tag {7} \\ \forall t < t ^ {\prime} \leq k, Q _ {f} \left(B _ {t ^ {\prime}} ^ {\prime}\right) \geq \theta_ {3}, \\ \end{array} +$$ + +where $\theta_{2}$ and $\theta_{3}$ are two thresholds. The main idea of Eqn. 7 is that, as long as a box $B_{k}^{\prime}$ can be connected to $B_{t}^{\prime}$ through a smooth and reliable box sequence in $\mathcal{B}^{\prime}$ , search area cropped from $B_{k}^{\prime}$ can be used for cycle memory training. In other words, we take step changes in $\mathcal{B}^{\prime}$ to divide $\mathcal{I}$ into fragments, and the pseudo boxes of all frames in the same fragment tend to locate the same object. This scheme helps our tracker exploit long-term variations, while still ensuring the reliability of pseudo bounding boxes in the memory frames (see Sec. 4.3 for quantitative analysis). + +Let $N_{mem}$ denote the number of memory frames. We first utilize the tracker to predict $N_{mem}$ intermediate bounding boxes in the memory frames for the template $z_{t}$ . We adopt PrPool [19] to pool $N_{mem}$ features based on the in + +intermediate boxes. Then we use the pooled features as templates to conduct multi-scale correlation [48] with the deep feature of $x_{t}$ . Note that the original classification branch and the memory branch share the same weights in terms of the multi-scale correlation module. All $N_{mem}$ correlation maps, denoted as $\{C_{corr}^{u} \mid 1 \leq u \leq N_{mem}\}$ , are integrated together by a confidence-value strategy. Specifically, given a correlation map $C_{corr}^{u}$ , we utilize two $3 \times 3$ convolution layers to generate a confidence map $C_{conf}^{u}$ and a value map $C_{val}^{u}$ with the same dimension. We then normalize $C_{conf}^{u}$ element-wise across all confidence maps as weights on $C_{val}^{u}$ . The finally integrated correlation map $C$ is formulated as follows: + +$$ +C = \sum_ {1 \leq u \leq N _ {\text {m e m}}} \operatorname {s o f t m a x} \left(C _ {\text {c o n f}} ^ {u}\right) \odot C _ {\text {v a l}} ^ {u}, \tag {8} +$$ + +where $\odot$ denotes Hadamard product. As shown in Fig. 4, the integrated map $C$ is converted to $25 \times 25 \times 1$ via convolution, yielding the response map $\mathcal{R}_{mem}$ of the object in search area $x_{t}$ . The total loss function $\mathcal{L}$ for training is: + +$$ +\mathcal {L} = \mathcal {L} _ {r e g} + \lambda_ {1} \mathcal {L} _ {c l s} + \lambda_ {2} \mathcal {L} _ {m e m}, \tag {9} +$$ + +where $\lambda_{1}$ and $\lambda_{2}$ are weight parameters. We use the BCE loss [10] as the cycle memory loss $\mathcal{L}_{mem}$ , which shares the same pseudo ground truth label as in $\mathcal{L}_{cls}$ . + +Table 1: Results on the VOT benchmarks. The proposed trackers perform well over the state-of-the-art unsupervised trackers. Boldface denotes the best performance among all trackers built without video labels for offline training (the same below). + +
TrackerUnsup.VOT2016VOT2017/18VOT2020
A↑R↓EAO↑A↑R↓EAO↑A↑R↑EAO↑
SiamFC [2]No0.5320.4610.2350.5030.5850.1880.4180.5020.179
DaSiamRPN [50]No0.610.220.4110.560.340.326---
ATOM [8]No---0.5900.2040.4010.4620.7340.271
DiMP [3]No---0.5970.1530.4400.4570.7400.274
IVT [32]Yes0.4191.1090.1150.4001.6390.0760.3450.2440.092
MIL [1]Yes0.4070.7270.1650.3941.0110.1180.3670.3220.113
KCF [17]Yes0.4890.5690.1920.4470.7730.1350.4070.4320.154
ECO [7]Yes0.550.200.3750.480.270.280---
S2SiamFC [34]Yes0.4930.6390.2150.4630.7820.180---
LUDT [38]Yes0.5440.4220.2320.4630.6930.154---
LUDT+ [38]Yes0.5700.3310.2990.4900.4120.230---
USOT (Ours)Yes0.5930.3360.3510.5640.4350.2900.4580.6000.222
USOT* (Ours)Yes0.6000.2330.4020.5780.3040.3440.4480.6000.219
+ +# 4. Experiments + +This section presents the results of our unsupervised tracker on multiple benchmarks, with comparisons to the state-of-the-art tracking algorithms. Extensive ablation studies are provided to analyze the effectiveness of our design choices. + +# 4.1. Implementation Details + +Training. Our tracker is trained on the data collected from the training sets of four datasets including GOT-10k [18], ImageNet VID [33], LaSOT [11] and YouTube-VOS [43]. Note that the ground-truth labels of these training sets are not available in our method. The hyper-parameters for extracting the video box sequences are set as $\alpha = 0.3$ , $\beta = 0.5$ , $\gamma = 4.1$ respectively. Our network adopts ResNet50 [16] as the backbone network, and uses the third convolutional block to extract deep features for input images. We notice that existing CNN backbones pretrained on the ImageNet dataset [33] contain information from manual labels. For the sake of solid comparisons, we conduct all the experiments in two settings (i.e., w/o and w/ supervised backbone pretraining on ImageNet). During training, we use synchronized SGD [24] on 4 NVIDIA GeForce RTX 3090 GPUs. Each GPU hosts 12 groups of training instances. The whole end-to-end training phase takes 30 epochs in total, in which cycle memory is conducted only within the last 25 epochs. We start with a warm-up learning rate from $2.5 \times 10^{-3}$ to $5 \times 10^{-3}$ in the first 6 epochs, while the remaining epochs adopt an exponentially decreasing learning rate from $5 \times 10^{-3}$ down to $2 \times 10^{-5}$ . + +At each training step, we sample a template bounding box from $\mathcal{B}'$ with $\theta_{1} = 0.4$ and crop a template patch and a search area as SiamFC [2]. This image pair is augmented + +with horizontal and vertical flips. For training the online module with cycle memory, we input extra $N_{mem} = 4$ memory search areas together with the template-search pair. Other hyper-parameters for cycle memory are set to $\gamma = 2.5$ , $\theta_2 = 0.45$ and $\theta_3 = 0.40$ . The trade-off parameter in the loss function is fixed to $\lambda_1 = 0.2$ for naive Siamese training, and for cycle memory we keep $\lambda_1 + \lambda_2 = 0.9$ and gradually decrease $\lambda_1$ from 0.3, in order to make the tracker gently suit to the tracking task in longer temporal spans. + +Inference. The inference is performed on both the offline and online branches. The offline branch follows the conventional inference methodology of Siamese networks [25, 48]. Based on the template feature from frame $I_{1}$ , the offline response maps $\mathcal{R}_{cls}$ and bounding boxes $\mathcal{R}_{reg}$ in subsequent frames are generated by the offline classifier and regressor. On the other hand, the online branch maintains a memory queue of templates and dynamically updates this queue with new predictions. In practice, when tracking the object in frame $I_{t}$ , the memory queue consists of totally $N_{q}$ templates, including two ground-truth templates from frame $I_{1}$ (i.e., the original template and its horizontal flip), the latest predicted template from frame $I_{t-1}$ , and $N_{q}-3$ historical templates with the highest scores in $\mathcal{R}$ from frame $I_{2}$ to $I_{t-2}$ . The final response map $\mathcal{R}$ is a weighted sum of $\mathcal{R}_{cls}$ and $\mathcal{R}_{mem}$ , namely $\mathcal{R} = (1 - w)\mathcal{R}_{cls} + w\mathcal{R}_{mem}$ , where the weight $w$ is set to 0.7 throughout our experiments. + +# 4.2. State-of-the-art Comparison + +We compare our method with the state-of-the-art unsupervised and supervised trackers. The comparisons are conducted on six benchmarks, including VOT2016 [20], VOT2017/18 [22], VOT2020 [21], TrackingNet [29], OTB2015 [42] and LaSOT [11]. We denote by USOT the + +Table 2: Results on the TrackingNet [29] dataset. The proposed unsupervised trackers, USOT and USOT*, perform well over the state-of-the-arts. + +
TrackersUnsup.Succ. ↑Prec. ↑Norm P. ↑
SiamFC [2]No57.153.366.3
MDNet [30]No61.455.571.0
UpdateNet [46]No67.762.575.2
ATOM [8]No70.364.877.1
SiamRPN++ [25]No73.369.480.0
KCF [17]Yes44.741.954.6
DSST [9]Yes46.446.058.8
ECO [7]Yes56.148.962.1
LUDT [38]Yes54.346.959.3
LUDT+ [38]Yes56.349.563.3
USOT (Ours)Yes59.955.168.2
USOT* (Ours)Yes61.556.669.1
+ +proposed tracker trained with the unsupervised backbone initialization [5], while denoting by USOT* that with supervised ImageNet pretraining. It is worth mentioning that we keep all the hyper-parameters fixed throughout the experiments to report results on all the datasets. + +VOT2016. The VOT2016 dataset contains 60 video sequences. We adopt the Accuracy (A), Robustness (R) and Expected Average Overlap (EAO) [20] as the VOT-toolkit to evaluate the overall performance. Tab. 1 shows that the proposed trackers, both USOT and $\mathrm{USOT^{*}}$ , significantly outperform the state-of-the-art unsupervised trackers, with respectively 5.2 and 10.3 points increase in EAO over the top-performing unsupervised tracker LUDT+. + +VOT2017/18. The VOT2017/18 dataset consists of 60 more challenging video sequences. Tab. 1 shows that our USOT* obtains 8.8 and 11.4 points increase respectively in Accuracy and EAO compared with LUDT+. Our USOT without supervised backbone still outperforms LUDT+ by respectively 7.4 and 6.0 points in Accuracy and EAO. + +VOT2020. The VOT2020 dataset encodes targets with segmentation masks, and updates the calculation of Accuracy (A), Robustness (R) and Expected Average Overlap (EAO) [21]. Tab. 1 shows that our USOT* outperforms SiamFC by 3.0, 9.8 and 4.0 points respectively in A, R and EAO. Our USOT even achieves better performance compared with USOT* with an EAO of 0.222. + +TrackingNet. The TrackingNet dataset contains over 30000 videos, with 511 videos for testing. Tab. 2 shows that our USOT* outperforms LUDT+ with 5.2 points in Success and 7.1 points in Precision. Our USOT is comparable with USOT* on the TrackingNet dataset. This suggests that unsupervised representation learning has the potential to perform as well as supervised ImageNet pretraining. + +OTB2015. The OTB2015 dataset contains 100 videos. Tab. 3 shows that our USOT outperforms USOT*. This + +![](images/a8952f6835b99cd001a73757baf1bb92ae69411500a729165835339cbc9c2329.jpg) +Figure 5: Success plot and Precision plot on the LaSOT testing set [11]. + +affirms the potential of unsupervised representation learning from scratch. Furthermore, the proposed unsupervised trackers achieve comparable performance with LUDT and SiamFC. Our trackers perform slightly worse than LUDT+, because LUDT+ adopts some online tracking techniques in [7] over LUDT for better performance. + +LaSOT. The LaSOT testing set consists of 280 videos with an average length over 2000. LaSOT is important for measuring long-term tracking performance. Fig. 5 shows that our USOT* significantly outperforms LUDT+ with an increase of 5.3 and 5.2 on Success and Precision, respectively. Our USOT achieves comparable results to the supervised trackers SiamFC [2] and SiamDW [47]. + +# 4.3. Ablation Studies + +Training Stage Indispensability. We do extensive ablation studies on the importance of different stages in the training phase. Experiments are conducted on the VOT2017/18 benchmark with USOT*. Tab. 4 shows that training a naive tracker from single-frame pairs with random cropping causes a significant accuracy drop compared with our proposed box sequence generation. In addition, directly conducting cycle memory training without the naive Siamese tracker initialization also causes a large performance drop. + +Video Utilization Rate. We use the video quality score $Q_{v}(\mathcal{I})$ in Eqn. 4 to filter out noisy sequences during unsupervised training. On the GOT-10k dataset and the VID dataset, we utilize $50.8\%$ and $56.3\%$ videos respectively within all videos available for training, covering rich varieties of unlabeled videos. + +Frame Interval. Our proposed training method can learn the appearance information across long intervals. This facilitates unsupervised trackers to adapt to temporal appearance changes. Compared to the very short frame intervals in previous deep unsupervised trackers $\mathrm{S}^2$ SiamFC [34] (i.e., 0 frame) and UDT [37] (i.e., $< 10$ frames), the training instances sampled by our method possess an averaged long frame interval of 41.1 and 64.6 respectively on the GOT-10k and VID datasets. + +Table 3: Results on the OTB2015 [42] dataset. Our unsupervised trackers achieve comparable results with the previous supervised and unsupervised trackers. + +
TrackerDCFNet [39]SiamFC [2]SiamRPN [26]ATOM [8]DiMP [3]DSST [9]KCF [17]LUDT [38]LUDT+ [38]USOT (Ours)USOT* (Ours)
AUC success58.058.263.766.768.651.848.560.263.958.957.4
Distance precision-77.185.187.989.968.969.676.984.380.677.5
+ +Table 4: Ablation studies on our pseudo box generation module and naive Siamese tracker initialization before cycle memory training on the VOT2017/18 dataset. + +
OperationsA ↑R ↓EAO ↑
Random boxes0.4880.6460.195
Our gnereated boxes0.5670.5200.263
w/o naive Siamese learning0.5750.3890.306
w/ naive Siamese learning0.5780.3040.344
+ +Table 5: Quantitative results on the IoU success rates of the pseudo boxes in template frames and memory frames. + +
Dataset \ IoUTemplateMemory
0.30.50.30.5
GOT-10k63.2%45.5%62.0%43.8%
VID64.4%42.1%63.9%42.0%
+ +Pseudo Bounding Box Generation. To better investigate the precision of the pseudo bounding boxes, we collect over $10^{4}$ training instances and compute the IoU scores between the output pseudo bounding boxes and the ground truth bounding boxes on both the GOT-10k and VID datasets. Tab. 5 shows the success rates of the pseudo bounding boxes over different IoU scores in both template frames and memory frames. On both datasets, over $63\%$ sampled boxes in template frames cover at least parts of the foreground objects $(IoU > 0.3)$ , while over $42\%$ sampled boxes in template frames are precise enough to cover approximately the entire objects $(IoU > 0.5)$ . Besides, from the small difference between the IoU success rates of pseudo boxes in template frames and memory frames on both datasets, we conclude that using large frame intervals for cycle memory training only slightly decreases the reliability of memory frames compared to template frames. This explains why our unsupervised tracker can learn from large motions. + +Training Dataset. Since most existing unsupervised deep trackers are trained on the VID dataset, we investigate the impact of training data on USOT* on the VOT2017/18 benchmark. As is shown in Tab. 6, when only using VID as the training set, the proposed tracker still achieves 0.315 in EAO, with an 8.5 points increase over the state-of-the-art unsupervised tracker LUDT+ (i.e., 0.230 in EAO). Besides, our tracker benefits from training on more unlabeled videos, inferring the great potential of unsupervised tracking. + +Table 6: Ablation studies on training data. With more unlabeled videos used for training, the proposed USOT* achieves better results on the VOT2017/18 dataset. + +
Training DataA↑R↓EAO↑
VIDGOT-10kLaSOTYT-VOS
✓0.5760.3370.315
✓✓0.5870.3230.320
✓✓✓0.5790.3280.337
✓✓✓✓0.5780.3040.344
+ +Table 7: Parameter sensitivity of the length and weight of the online memory queue on the VOT2017/18 dataset. + +
Nq\w0.30.50.60.70.8
50.2890.3020.3230.3130.323
60.2940.3120.3120.3290.322
70.3100.3180.3360.3440.331
80.3020.3000.3190.3410.338
+ +Online Update. We study the parameter sensitivity of $N_{q}$ and $w$ in the online memory module. $N_{q}$ indicates the number of memorized features collected online in the memory queue, while $w$ indicates the weight for $\mathcal{R}_{mem}$ . Tab. 7 reports the EAO scores of USOT* on the VOT2017/18 dataset. The cooperation of offline and online modules with $w = 0.7$ benefits the proposed tracker most, and setting the length of the memory queue $N_{q}$ to 7 is most suitable. + +# 5. Concluding Remarks + +In this paper, we propose learning a robust tracker from unlabeled videos from scratch. We first generate candidate box sequences to cover moving objects in videos. We then train a naive Siamese tracker using single-frame pairs. We finally continue training the naive tracker in longer temporal spans with a novel cycle memory scheme, enabling the tracker to update online. Extensive experiments demonstrate that the proposed unsupervised tracker sets new state-of-the-art unsupervised tracking results, and even performs on par with recent supervised deep trackers. This work unveils the power of unsupervised learning for object tracking. + +Acknowledgements. This work was supported by NSFC (61906119, U19B2035), Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102), and Shanghai Pujiang Program. + +# References + +[1] Boris Babenko, Ming-Hsuan Yang, and Serge J. Belongie. Robust object tracking with online multiple instance learning. TPAMI, 2011. +[2] Luca Bertinetto, Jack Valmadre, João F. Henriques, Andrea Vedaldi, and Philip H. S. Torr. Fully-convolutional siamese networks for object tracking. In ECCV Workshop, 2016. +[3] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning discriminative model prediction for tracking. In ICCV, 2019. +[4] Goutam Bhat, Martin Danelljan, Luc Van Gool, and Radu Timofte. Know your surroundings: Exploiting scene information for object tracking. In ECCV, 2020. +[5] Xinlei Chen, Haoqi Fan, Ross B. Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv:2003.04297, 2020. +[6] Zedu Chen, Bineng Zhong, Guorong Li, Shengping Zhang, and Rongrong Ji. Siamese box adaptive network for visual tracking. In CVPR, 2020. +[7] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ECO: efficient convolution operators for tracking. In CVPR, 2017. +[8] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. ATOM: accurate tracking by overlap maximization. In CVPR, 2019. +[9] Martin Danelljan, Gustav Hager, Fahad Shahbaz Khan, and Michael Felsberg. Accurate scale estimation for robust visual tracking. In BMVC, 2014. +[10] Pieter-Tjerk de Boer, Dirk P. Kroese, Shie Mannor, and Reuven Y. Rubinstein. A tutorial on the cross-entropy method. Ann. Oper. Res., 2005. +[11] Heng Fan, Liting Lin, Fan Yang, Peng Chu, Ge Deng, Sijia Yu, Hexin Bai, Yong Xu, Chunyuan Liao, and Haibin Ling. Lasot: A high-quality benchmark for large-scale single object tracking. In CVPR, 2019. +[12] Heng Fan and Haibin Ling. Siamese cascaded region proposal networks for real-time visual tracking. In CVPR, 2019. +[13] Zhihong Fu, Qingjie Liu, Zehua Fu, and Yunhong Wang. Stmtrack: Template-free visual tracking with space-time memory networks. In CVPR, 2021. +[14] Clément Godard, Oisin Mac Aodha, and Gabriel J. Brostow. Unsupervised monocular depth estimation with left-right consistency. In CVPR, 2017. +[15] Dongyan Guo, Jun Wang, Ying Cui, Zhenhua Wang, and Shengyong Chen. Siamcar: Siamese fully convolutional classification and regression for visual tracking. In CVPR, 2020. +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +[17] João F. Henriques, Rui Caseiro, Pedro Martins, and Jorge Batista. High-speed tracking with kernelized correlation filters. TPAMI, 2015. +[18] Lianghua Huang, Xin Zhao, and Kaiqi Huang. Got-10k: A large high-diversity benchmark for generic object tracking in the wild. TPAMI, 2019. + +[19] Borui Jiang, Ruixuan Luo, Jiayuan Mao, Tete Xiao, and Yun-ting Jiang. Acquisition of localization confidence for accurate object detection. In ECCV, 2018. +[20] Matej Kristan, Ales Leonardis, Jiri Matas, Michael Felsberg, Roman P. Pflugfelder, Luka Cehovin, Tomás Vojír, Gustav Häger, Alan Lukezic, Gustavo Fernández, et al. The visual object tracking VOT2016 challenge results. In ECCV Workshop, 2016. +[21] Matej Kristan, Ales Leonardis, Jiri Matas, Michael Felsberg, Roman P. Pflugfelder, Joni-Kristian Kämäräinen, Martin Danelljan, Luka Cehovin Zajc, Alan Lukezic, Ondrej Drbohlav, Linbo He, et al. The eighth visual object tracking VOT2020 challenge results. In ECCV Workshop, 2020. +[22] Matej Kristan, Ales Leonardis, Jiri Matas, Michael Felsberg, Roman P. Pflugfelder, Luka Cehovin Zajc, Tomás Vojír, Goutam Bhat, Alan Lukezic, Abdelrahman Eldsokey, Gustavo Fernández, Álvaro García-Martín, Álvaro Iglesias-Arias, et al. The sixth visual object tracking VOT2018 challenge results. In ECCV Workshop, 2018. +[23] Zihang Lai, Erika Lu, and Weidi Xie. MAST: A memory-augmented self-supervised tracker. In CVPR, 2020. +[24] Yann LeCun, Bernhard E. Boser, John S. Denker, Donnie Henderson, Richard E. Howard, Wayne E. Hubbard, and Lawrence D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Comput., 1989. +[25] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. Siamrpn++: Evolution of siamese visual tracking with very deep networks. In CVPR, 2019. +[26] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In CVPR, 2018. +[27] Xueting Li, Sifei Liu, Shalini De Mello, Xiaolong Wang, Jan Kautz, and Ming-Hsuan Yang. Joint-task self-supervised learning for temporal correspondence. In NeurIPS, 2019. +[28] Liang Liu, Jiangning Zhang, Ruifei He, Yong Liu, Yabiao Wang, Ying Tai, Donghao Luo, Chengjie Wang, Jilin Li, and Feiyue Huang. Learning by analogy: Reliable supervision from transformations for unsupervised optical flow estimation. In CVPR, 2020. +[29] Matthias Müller, Adel Bibi, Silvio Giancola, Salman Al-Subaihi, and Bernard Ghanem. Trackingnet: A large-scale dataset and benchmark for object tracking in the wild. In ECCV, 2018. +[30] Hyeonseob Nam and Bohyung Han. Learning multi-domain convolutional neural networks for visual tracking. In CVPR, 2016. +[31] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NeurIPS, 2015. +[32] David A. Ross, Jongwoo Lim, Ruei-Sung Lin, and Ming-Hsuan Yang. Incremental learning for robust visual tracking. IJCV, 2008. +[33] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. IJCV, 2015. + +[34] Chon-Hou Sio, Yu-Jen Ma, Hong-Han Shuai, Jun-Cheng Chen, and Wen-Huang Cheng. S2siamfc: Self-supervised fully convolutional siamese network for visual tracking. In ACM MM, 2020. +[35] Yibing Song, Chao Ma, Xiaohe Wu, Lijun Gong, Linchao Bao, Wangmeng Zuo, Chunhua Shen, Rynson W. H. Lau, and Ming-Hsuan Yang. VITAL: visual tracking via adversarial learning. In CVPR, 2018. +[36] Paul Voigtlaender, Jonathon Luiten, Philip H. S. Torr, and Bastian Leibe. Siam R-CNN: visual tracking by re-detection. In CVPR, 2020. +[37] Ning Wang, Yibing Song, Chao Ma, Wengang Zhou, Wei Liu, and Houqiang Li. Unsupervised deep tracking. In CVPR, 2019. +[38] Ning Wang, Wengang Zhou, Yibing Song, Chao Ma, Wei Liu, and Houqiang Li. Unsupervised deep representation learning for real-time tracking. IJCV, 2021. +[39] Qiang Wang, Jin Gao, Junliang Xing, Mengdan Zhang, and Weiming Hu. Dcfnet: Discriminant correlation filters network for visual tracking. arXiv:1704.04057, 2017. +[40] Qiang Wang, Li Zhang, Luca Bertinetto, Weiming Hu, and Philip H. S. Torr. Fast online object tracking and segmentation: A unifying approach. In CVPR, 2019. +[41] Xiaolong Wang, Allan Jabri, and Alexei A. Efros. Learning correspondence from the cycle-consistency of time. In CVPR, 2019. +[42] Yi Wu, Jongwoo Lim, and Ming-Hsuan Yang. Object tracking benchmark. TPAMI, 2015. +[43] Ning Xu, Linjie Yang, Yuchen Fan, Jianchao Yang, Dingcheng Yue, Yuchen Liang, Brian L. Price, Scott Cohen, and Thomas S. Huang. Youtube-vos: Sequence-to-sequence video object segmentation. In ECCV, 2018. +[44] Jiahui Yu, Yuning Jiang, Zhangyang Wang, Zhimin Cao, and Thomas S. Huang. Unitbox: An advanced object detection network. In ACM MM, 2016. +[45] Yuechen Yu, Yilei Xiong, Weilin Huang, and Matthew R. Scott. Deformable siamese attention networks for visual object tracking. In CVPR, 2020. +[46] Lichao Zhang, Abel Gonzalez-Garcia, Joost van de Weijer, Martin Danelljan, and Fahad Shahbaz Khan. Learning the model update for siamese trackers. In ICCV, 2019. +[47] Zhipeng Zhang and Houwen Peng. Deeper and wider siamese networks for real-time visual tracking. In CVPR, 2019. +[48] Zhipeng Zhang, Houwen Peng, Jianlong Fu, Bing Li, and Weiming Hu. Ocean: Object-aware anchor-free tracking. In ECCV, 2020. +[49] Zhaohui Zheng, Ping Wang, Wei Liu, Jinze Li, Rongguang Ye, and Dongwei Ren. Distance-iou loss: Faster and better learning for bounding box regression. In AAAI, 2020. +[50] Zheng Zhu, Qiang Wang, Bo Li, Wei Wu, Junjie Yan, and Weiming Hu. Distractor-aware siamese networks for visual object tracking. In ECCV, 2018. \ No newline at end of file diff --git a/learningtotrackobjectsfromunlabeledvideos/images.zip b/learningtotrackobjectsfromunlabeledvideos/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4c31d75b1729ed75d28a61c39dc6d5e41d777066 --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c9cc7724d368e9b4eb5e6cc1f90feaa651f121be0c24fce087e7bae334d1f78 +size 596975 diff --git a/learningtotrackobjectsfromunlabeledvideos/layout.json b/learningtotrackobjectsfromunlabeledvideos/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0ea020901fb4cc9f3d98db4ba5553101f862aad9 --- /dev/null +++ b/learningtotrackobjectsfromunlabeledvideos/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a3e163d53b053fbe6b732b600c41db98e1feceba99bfc9a2f44a27da3526f28 +size 459321 diff --git a/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_content_list.json b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..82311a4f0d2afcf364ad020e3dd045836eecc851 --- /dev/null +++ b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82d2fae26ab6c2498db1cb77550a41dfe805210062a2d8c3c95cf0fc8dedf7f3 +size 83313 diff --git a/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_model.json b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2c88d374df9ed845f99cb45cdf43c9ee7ff58ebb --- /dev/null +++ b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c0b74a38a8253d058b0ea61b09c69a99d6cc80e2ad796afb9670fe77d8b3dc3 +size 103968 diff --git a/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_origin.pdf b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3991260e8dbeefa37b787c15880dca2a30d1009e --- /dev/null +++ b/learningtotrackwithobjectpermanence/28937c97-fa9c-4d3e-9ac4-0000c921d3bc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb895f8ab76efdffbb9f3ba574ea54a2872616f8700e8dd67bc3a3fb936b479b +size 9454371 diff --git a/learningtotrackwithobjectpermanence/full.md b/learningtotrackwithobjectpermanence/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cbcc9ea216a0ebf3594a340b0412523b1fb598a2 --- /dev/null +++ b/learningtotrackwithobjectpermanence/full.md @@ -0,0 +1,324 @@ +# Learning to Track with Object Permanence + +Pavel Tokmakov + +Jie Li Wolfram Burgard +Toyota Research Institute + +first.last@tri.global + +Adrien Gaidon + +# Abstract + +Tracking by detection, the dominant approach for online multi-object tracking, alternates between localization and association steps. As a result, it strongly depends on the quality of instantaneous observations, often failing when objects are not fully visible. In contrast, tracking in humans is underlined by the notion of object permanence: once an object is recognized, we are aware of its physical existence and can approximately localize it even under full occlusions. In this work, we introduce an end-to-end trainable approach for joint object detection and tracking that is capable of such reasoning. We build on top of the recent CenterTrack architecture, which takes pairs of frames as input, and extend it to videos of arbitrary length. To this end, we augment the model with a spatio-temporal, recurrent memory module, allowing it to reason about object locations and identities in the current frame using all the previous history. It is, however, not obvious how to train such an approach. We study this question on a new, large-scale, synthetic dataset for multi-object tracking, which provides ground truth annotations for invisible objects, and propose several approaches for supervising tracking behind occlusions. Our model, trained jointly on synthetic and real data, outperforms the state of the art on KITTI and MOT17 datasets thanks to its robustness to occlusions. + +# 1. Introduction + +Consider the video sequence from the KITTI dataset [24] shown in Figure 1. A man on the left walks behind the moving car and is not visible anymore. Yet, there is no question that he is still there, and did not simply vanish. Moreover, we can approximately infer his location at that moment. This capability is known to cognitive scientists as object permanence, and is observed in infants at a very early age [3, 53]. In adults, understanding that occluded objects do not disappear is important for tasks like driving. In this work, we propose a deep learning-based method for multi-object tracking that is capable of such reasoning. + +Virtually all modern multi-object tracking algorithms + +![](images/16b16d2b6e3c147e79cde56f8dd4ff171ce322aa9c200147feeccfa5a4e28173.jpg) + +![](images/6d845c6443958466ba3370b511dfa45d06a66a24bae4f8e36e56dbb34dd59213.jpg) + +![](images/b892517a042dcaa02624c9205e64d264c6b146bbc0e3b086d848c97301fee9fb.jpg) +Figure 1. Video frames from the KITTI dataset with outputs of CenterTrack [66] (above), and our method (below). By modeling object permanence, our approach is able to hallucinate trajectories of fully occluded instances, such as the person behind the car. + +![](images/2ea73076c6bd02a50a80cdac5c7e5e67f28918cfb2f7fde007d8381d460c701f.jpg) + +operate in the tracking-by-detection paradigm. That is, they use an existing object detector to localize objects of interest in every frame of a video, and then link them into tracks, either in an online [9, 11], or in an offline manner [5, 6, 10, 34, 42]. In this work we focus on the online setting, where a method needs to associate current detections with previously established trajectories [9, 54, 59, 62]. A major limitation of these methods is that the localization step is completely independent from the previous history, thus, once an object becomes partially or fully occluded, the detector fails and the trajectory gets broken (see Figure 1, top). Recently, several approaches combine detection and tracking in a single model [7, 66]. They take pairs of frames as input and output detections together with pairwise associations. While these methods improve tracking robustness, they can only handle single-frame occlusions. + +In this work, we propose an end-to-end trainable, online approach for multi-object tracking that leverages object permanence as an inductive prior. To this end, we first extend the recent CenterTrack architecture [66] from pairs of frames as input to arbitrary video sequences. The frames are processed by a convolutional gated recurrent unit (Con + +vGRU) [4] that encodes the spatio-temporal evolution of objects in the input video, taking the entire history into account. As a result, it can can reason about locations of partially and fully occluded instances using the object permanence assumption (see Figure 1, bottom). + +Supervising this behavior is a major challenge. No tracking dataset currently provides consistent annotations for occluded objects at a large scale (see Figure 5) because of the associated uncertainty. In this paper, we instead propose to use synthetic data. Using the Parallel Domain (PD) [1] simulation platform, we generate a dataset of synthetic videos that automatically provides accurate labels for all objects, irrespective of their visibility (see Figure 2). We then use this dataset to analyze various approaches for supervising tracking behind occlusions with both ground-truth and pseudo-ground-truth labels for occluded instances. + +Despite the progress in simulation, the domain gap between synthetic and real videos may limit performance. As we show in Section 4.3, a model directly trained on synthetic videos indeed underperforms when applied to real-world multi-object tracking benchmarks such as KITTI [24]. However, we find that this domain gap can be overcome by just training our model jointly on synthetic and real data, supervising invisible objects only on synthetic sequences. This allows to learn complex behaviors across domains, including trajectory hallucination for fully occluded instances although this was never labeled in the real world. + +Our contributions are three-fold. (1) We propose an end-to-end trainable architecture for joint object detection and tracking that operates on videos of arbitrary length in Sec. 3.2. (2) We demonstrate how this architecture can be trained to hallucinate trajectories of fully invisible objects in Sec. 3.3. (3) We show how to supervise our method with a mix of synthetic and real data in Sec. 3.4, and validate it on the KITTI [24] and MOT17 [38] real-world benchmarks in Sec. 4, outperforming the state of the art. Source code, models, and data are publicly available at https://github.com/TRI-ML/permatrack. + +# 2. Related Work + +Our approach addresses the problem of multi-object tracking by designing a joint model for object detection and tracking in videos and training it on synthetic data. Below, we review the most relevant works in each of these fields. + +Multi-object tracking is the problem of localizing objects from a predefined list of categories in a video and associating them over time based on identity. Most existing approaches treat these two tasks separately, in a paradigm known as tracking-by-detection. The main difference between the methods in this category is whether the association step is performed online or offline. + +State-of-the-art online object trackers [7, 9, 59, 62, 66] + +keep a set of active trajectories as they progress through a video. In every frame, a new list of object detections is processed by either associating them with an existing trajectory, or starting a new one. Early approaches, such as SORT [9], used Kalman filter to associate detections based on bounding box overlap, or appearance features from a deep network [59]. Recent methods proposed to utilize more complex features for association, such as human pose [54], or trajectory representations learned with spatio-temporal graph convolutions [62]. Although some of the methods in this category use a linear motion model [11, 40, 64] to propagate a trajectory hypothesis behind occlusions, this heuristic ignores changes in the scene context. In contrast, our approach learns to hallucinate trajectories of occluded objects in an end-to-end manner, outperforming the aforementioned heuristic. + +On the other hand, offline approaches [5, 6, 10, 34] first build a spatio-temporal graph spanning the whole video, with object detections as nodes [5]. Edge costs are defined based on overlap between detections [30, 42, 65], their appearance similarity [10, 39, 47, 62], or motion-based models [2, 13, 16, 34, 44]. The association can then be formulated as maximum flow [6] or, minimum cost problem [30, 34]. While these methods can handle complex scenarios, they are not practical due to their non-casual nature and computational complexity. In contrast, our approach does not require future frames and runs in real time. + +A few methods have recently attempted to combine object detection and tracking in a single end-to-end learnable framework. Bergman et al. [7] utilize the box regression branch in the Faster RCNN detector [45] to propagate objects from frame $t - 1$ to $t$ . Zhou et al. [66] take a pair of frames as input, and directly output the detections and association vectors, resulting in a simpler architecture. However, both these methods only capture short-term object correspondences. Our approach builds on top of [66], but modifies it to model spatio-temporal evolution of objects in video sequences of arbitrary length, and uses synthetic data to learn to detect and track even under full occlusions. + +Several classical methods [26, 28, 41] have attempted to capture the notion of object permanence through heuristics, such as correlation between the motion of visible and invisible instances in [26]. However, these rule-based methods lack in flexibility. Recently, Shamsian et al. [51] proposed a fully learning-based approach with promising results on toy, synthetic examples. In contrast, our method is capable of handling full occlusions in the wild. + +Video object detection is primarily concerned with improving the robustness of detectors in videos. Early approaches processed frames individually, but used a Siamese network to establish association between detections and smooth their scores [21]. Later, Kang et al. [31] proposed to pass a stack of several frames to a network and directly + +![](images/74b1c4cec8bd5160dd78f134927c8cf0d8efc9ee42badb741f1074573412645e.jpg) +Figure 2. A sample from our synthetic dataset (Section 4.1) with ground truth visibility labels. Unlike real datasets, virtual ones provide accurate annotations for all the objects, irrespective of their visibility. + +output short object tubelets. Finally, Xiao et al. [61] augmented an object detector with a spatio-temporal memory module, allowing it to process videos of arbitrary length. Notice that none of these methods tackled the problem of multi-object tracking. Instead, they used short-term associations to improve detection robustness. Similarly to [61], our architecture also combines an object detector with a spatio-temporal memory module, however, we use a more recent CenterPoint [67] detector framework and train the model to hallucinate trajectories of fully occluded objects using synthetic data. + +Synthetic data has been used in the past to circumvent the need for manually labeling images [18, 46, 48] or videos [19, 22, 55]. Most approaches have focused on the setting in which no labels are available in the real world, leveraging unsupervised domain adaptation techniques such as adversarial training [23, 27, 35, 56] and self-training [33, 50, 68, 69]. Although significant progress has been achieved, the performance of these models remains significantly below their counterparts trained on real data in a fully supervised way. In videos, the most successful approaches combined large amounts of synthetic data with small sets of labeled real videos [29, 55]. In this work, we follow a similar route and utilize synthetic data to obtain the expensive labels for occlusion scenarios, while relying on visible object annotations in multi-object tracking datasets to minimize the domain gap. Synthetic datasets with object track labels have been proposed in the past [20, 22]. We choose to capitalize on the recent progress in simulation tools and collect a new, more realistic one. + +# 3. Methodology + +# 3.1. Background + +We build our method on top of the recent CenterTrack [66] architecture. Their approach addresses tracking from a local perspective. In particular, CenterTrack takes a pair of frames $\{I^{t - 1}, I^t\}$ as input together with $H^{t - 1}$ + +- an encoding of locations of previously detected objects in frame $t - 1$ . Objects are represented with their center points $\mathbf{p} \in \mathbb{R}^2$ , thus $H^{t - 1}$ is compactly encoded with a heatmap. The three input tensors are concatenated and passed through a backbone network $f$ , producing a feature map $F^{t} = f(H^{t - 1}, I^{t - 1}, I^{t})$ , which is used to both localize the object centers in the current frame $\{\hat{\mathbf{p}}_{0}^{t}, \hat{\mathbf{p}}_{1}^{t}, \dots\}$ , regress their bounding box sizes $\{\hat{s}_{0}^{t}, \hat{s}_{1}^{t}, \dots\}$ , and predict their displacement vectors with respect to the previous frame $\{\hat{\mathbf{d}}_{0}^{t}, \hat{\mathbf{d}}_{1}^{t}, \dots\}$ . At test time, displacement vectors are used to project each center to the previous frame via $\hat{\mathbf{p}}_{i}^{t} - \hat{\mathbf{d}}_{i}^{t}$ , and then greedily match it to the closest available center $\hat{\mathbf{p}}_{*}^{t - 1}$ , thus recovering the tracks (see [66] for more details). + +The local nature of CenterTrack is both its strength and its weakness. While only considering a pair of consecutive frames simplifies the architecture of the model, it limits its representational power. In particular, it cannot capture the notion of object permanence in videos, and learn to localize and associate objects under full occlusions. To address this limitation, we first extend [66] to a video-level model in Section 3.2. We then describe how to train such a model to track invisible objects using synthetic data in Section 3.3, and detail our domain adaptation approach is Section 3.4. + +# 3.2. A video-level model for tracking + +Our model, shown in Figure 3, takes a sequence of frames $\{I^1, I^2, \dots, I^n\}$ as input. Each frame is passed through the backbone $f$ individually to obtain feature maps $\{F^1, F^2, \dots, F^n\}$ , which, per CenterTrack formalism, encode the locations of visible objects in that frame - an instantaneous representation. To learn a permanent representations of objects in a video, we augment our network with a convolutional gated recurrent unit (ConvGRU) [4]. It is an extension of the classical GRU [14], which replaces a 1D state vector with a 2D feature map $M$ , and fully connected layers, used to compute state updates, with convolutions. + +At each time step $t$ , the corresponding feature map $F^t$ is passed to the ConvGRU, together with the previous state $M^{t-1}$ to compute the updated state $M^t = GRU(M^{t-1}, F^t)$ . Intuitively, the state matrix $M$ represents the entire history of the previously seen objects $\{o_1, o_2, \ldots\}$ in frames $\{1, \ldots, t-1\}$ and is updated with the encoding of the visible objects in frame $t$ via a series of learnable, multiplicative transformations (see [4] for further details). It can thus model the spatio-temporal evolution of objects in the input video sequence by guiding their localization and association in frame $t$ using previous history. Moreover, it can predict locations of the objects that were seen in the past, but are currently occluded. Notice that with this architecture there is no need to pass the explicit encoding of the previous frame centers $H^{t-1}$ , since they are already captured in the ConvGRU state $M^{t-1}$ . + +In practice, to generate the tracks on-line, $M^t$ + +![](images/f844f27d16b7be57a1fb9479666a1f0b349d2b74ec065ff79a307345bd0f707c.jpg) +Figure 3. Our method takes a sequence of frames as input and processes them individually with a backbone network (shown in yellow). The resulting feature maps (shown in blue) are passed to the ConvGRU module which aggregates a representation of the scene, encoding all the previously seen objects, even if they are fully occluded in the current frame. The memory state at time $t$ , (shown in gold), is then used to decode object centers, and estimate their visibility (other outputs directly adapted from [66] are not shown for readability). + +is recurrently passed through separate sub-networks $f_{\mathbf{p}}$ , $f_{off}$ , $f_s$ , $f_{\mathbf{d}}$ , which following [66], are used to decode the bounding boxes of the objects and link them into tracks. We augment those with a new visibility head $f_{\mathbf{v}}$ , which produces an output map $V^t \in [0,1]^{H \times W}$ . It is a binary classifier, predicting whether the object center at a particular location corresponds to a visible, or a fully occluded instance. See, for example, the person walking behind the red SUV on the right in Figure 3. His location behind occlusion is supervised as a positive for the localization head $P^t$ , but as a negative for $V^t$ . This distinction is important for evaluation, since annotations for invisible objects are not provided (we also remove them from the validation set of PD for a fair comparison). To avoid being penalized for 'false positive' predictions, we only output bounding boxes that are classified as visible by our model, but use the invisible ones to recover object identities after occlusions. + +All the operations detailed here are fully differentiable, and thus the model can be trained in an end-to-end fashion with backpropagation through time [58]. Following [66], we use focal loss [36] to supervise $P^t$ and $V^t$ , and L1 loss for the latter three heads. The overall training objective is: + +$$ +L = \frac {1}{N} \sum_ {t = 1} ^ {N} L _ {\mathbf {p}} ^ {t} + L _ {\mathbf {v}} ^ {t} + \lambda_ {o f f} L _ {o f f} ^ {t} + \lambda_ {s} L _ {s} ^ {t} + \lambda_ {\mathbf {d}} L _ {\mathbf {d}} ^ {t}, \tag {1} +$$ + +where $N$ is the length of the input sequence, and $\lambda_{off},\lambda_s,\lambda_{\mathbf{d}}$ are hyper-parameters that balance the contribution of the corresponding losses in the overall objective. + +As we discuss in Section 4.3, training our model on visible objects alone results in noticeable improvements over [66] due to increased robustness to noise in instantaneous observations. Next, we discuss our approach to supervising fully occluded objects. + +# 3.3. Learning to track behind occlusions + +# 3.3.1 Disambiguating levels of visibility + +To generate training labels for a video sequence of length $N$ , our method takes object annotations $\{O^1,O^2,\dots,O^N\}$ + +with $O^t = \{o_1^t, o_2^t, \dots, o_m^t\}$ as input. Each object $o_i^t = (\mathbf{p}, \mathbf{s}, id, vis)$ is described by its center $\mathbf{p} \in \mathbb{R}^2$ , bounding box size $\mathbf{s} \in \mathbb{R}^2$ , identity $id \in \mathbb{I}$ , which is used, together with $\mathbf{p}$ , to supervise the displacement vectors $\mathbf{d}$ , and visibility level $vis \in [0, 1]$ , indicating what fraction of the object is visible in the current frame. Naively, one could simply ignore the visibility levels and supervise all the objects in every frame. This would, however, result in the model being forced to hallucinate objects trajectories before they first become visible (e.g. the car driving in front of the truck in Figure 2 for the whole duration of the video). As we show in our experiments (Table 2), such supervision is effectively label noise and decreases model's performance. + +To avoid this, we pre-process the annotations to only start supervising occluded objects after they have been visible for at least 2 frames. This is the minimal sufficient time for the model to both localize an object and estimate its velocity - the required information for predicting its position under occlusion. + +Concretely, we introduce two thresholds $T_{vis}$ and $T_{occl}$ . Then, starting from the first frame in a sequence $O^1$ , for every object $o_i^1$ , if $vis_i^1 < T_{vis}$ the object is treated as a negative, if $T_{vis} < vis_i^1 < T_{occl}$ it is ignored (the model is not penalized for predicting it), and finally, if $vis_i^1 > T_{occl}$ its marked as visible and used to produce the labels. The same procedure is repeated for every frame in a sequence, with the only difference that, starting from frame 3, objects that were marked as visible for two consecutive frames in the past are treated as positives regardless of their visibility status in the current frame. This procedure reduces the ambiguity of supervision for the model. In particular, the second threshold $T_{occl}$ allows for a soft transition between visible and invisible objects. + +# 3.3.2 Supervising the invisible + +The ambiguity of the location of an invisible object is not fully addressed by the algorithm above. Consider the ground truth trajectory of a person shown in white in Figure 4. She walks behind the bus stop, and then stops. In + +![](images/38f2c626ed96ff23de12828938a08111d8f41503968b6ebc4e6a6fe1a70cdead.jpg) +Figure 4. Illustration of the ambiguity of ground truth object locations under full occlusions. The woman, shown in white, walks behind the bus stop and then stops. Instead of trying to predict this random event, we propose to supervise the model with deterministic pseud-ground-truth in such scenarios (shown in green, matches the ground truth in the first two frames). + +![](images/20b94012d223b40a4e36be65d915efb01d270b0fa27a28babe8f98dc677e4581.jpg) + +![](images/134a386a51f9413a9c5f14883053c93410f0304682b86c149c8b9b61003e47c1.jpg) + +![](images/d070559160d93048949a7871dd560a54af4395afbca0b7129b872d30a39962db.jpg) + +the absence of observations it is impossible for the model to predict this behavior. Consequently, such examples also constitute label noise. In fact, the only deterministic assumption both a person and a neural network can make about the trajectory of an occluded object is that it will maintain constant velocity. + +Propagating the last observed object location with its constant velocity in the camera frame is also the state of the art approach for handling occlusions in multi-object tracking literature [7, 66]. It is however, not robust to changes in camera motion. Instead, we propose to generate pseudoground-truth labels for supervising our model by propagating the occluded object locations with their last observed velocity in 3D, and projecting the resulting centers to the camera frame, which is made possible by the availability of the full ground truth information in our synthetic dataset. + +Concretely, for an object $i$ getting occluded at time $t$ , we take its ground truth centers in the previous two frames in the world coordinate system $\mathbf{P}_i^{t - 1},\mathbf{P}_i^{t - 2}\in \mathbb{R}^3$ , and compute the object velocity $\mathbf{V}_i = \mathbf{P}_i^{t - 1} - \mathbf{P}_i^{t - 2}$ . We then use it to estimate the location of the object center at time $t$ under the constant velocity assumption via $\tilde{\mathbf{P}}_i^t = \mathbf{P}_i^{t - 1} + \mathbf{V}_i$ . Finally, this estimated center is projected to the camera frame via $\tilde{\mathbf{p}}_i^t = \mathbf{K}[\mathbf{R}|\mathbf{t}]\tilde{\mathbf{P}}_i^t$ , where $\mathbf{K}$ is the camera intrinsics, and $[\mathbf{R}|\mathbf{t}]$ is the camera extrinsic matrix, and is used to replaced the ground-truth center $\mathbf{p}_i^t$ in the corresponding label set $o_i^t$ . The same procedure is repeated for all the frames during which the object remains invisible. This principled approach, shown in green in Figure 4, results in a deterministic supervision for invisible objects. + +If the object does not re-appear at the expected location, the model is supervised to keep hallucinating the box as described above. Re-identification is then performed at the time of dis-occlusion $t$ by supervising the displacement vector $d_{t}$ to project the ground-truth, visible location to the hallucinated location at $t - 1$ . + +# 3.4. Bridging the sim-to-real domain gap + +Analyzing the approaches for supervising tracking behind occlusion described above requires a large video dataset with objects densely labeled regardless of whether they are visible, together with precise visibility scores, 3D + +coordinates and camera matrices. No real dataset with such labels exists due to the cost and complexity of collecting these annotations. + +Instead of going the expensive route, we use synthetic data for which it is easy to automatically generate physically accurate ground truth. However, generalization to real videos remains a challenge. A few approaches that used synthetic videos for training in the past addressed the domain discrepancy by simply finetuning the resulting model on a small real dataset [22, 29, 55]. Recall, however, that real datasets in our scenario do not provide consistent annotations for occluded objects, thus such finetuning would result in forgetting the trajectory hallucination behaviour. + +To mitigate this issue, we propose to jointly train our approach on synthetic and real data, where at each iteration a batch is sampled from one of the datasets at random. Moreover, we cannot use real sequences of length more than 2 for the same reason mentioned above (we want the invisible objects supervision to remain consistent). As a result, we sample synthetic clips of length $N$ and real ones of length 2 during training, with the final loss being: + +$$ +L = \frac {1}{N} \sum_ {t = 1} ^ {N} L _ {\text {s y m}} ^ {t} + \frac {1}{2} \sum_ {t = 1} ^ {2} L _ {\text {r e a l}} ^ {t}, \tag {2} +$$ + +where $L_{sym}$ and $L_{sym}$ are defined in the same way as in Equation 1. Effectively, we use synthetic videos to learn the desired behavior, and real frame pairs to minimize the domain discrepancy. + +# 4. Experiments + +# 4.1. Datasets and evaluation + +We use two real datasets in the experimental analysis to compare to prior work: KITTI [24] and MOT17 [38]. In addition, we use a virtual dataset - ParallelDomain (PD), to learn to track behind occlusions. Details of these datasets are provided in the supplementary material. While our work is focused on the 2D setting, our approach can be directly extended to 3D tracking, as we show on the nuScenes [12] benchmark in the supplementary. + +Evaluation metrics Traditionally, multi-object tracking datasets have been using the CLEAR MOT metrics for eval + +uation [8], with MOTA being the main metric used to compare the methods. It has recently been shown, however, that it overemphasizes detection over association [37]. Instead, supplementary metrics, such as fraction of tracks that are maintained for at least $80\%$ of their duration ('mostly tracked') have to be used in conjunction with MOTA. + +The lack of a single metric that combines detection and association accuracy has been addressed by track intersection-over-union (IoU) based metrics [17, 49, 63], and HOTA [37]. In our analysis we use the former due to its larger emphasis on association accuracy. To formally define track IoU, let $G = \{g_1,\dots ,g_T\}$ and $D = \{d_{1},\ldots ,d_{T}\}$ be a groundtruth and a corresponding predicted track for a video with $T$ frames. Importantly, only one predicted track can be assigned to each ground truth trajectory, and all the unassigned ones are treated as false positives. Track IoU is then defined as: $\mathrm{IoU}(D,G) = \frac{\sum_{t = 1}^{T}g_t\cap d_t}{\sum_{t = 1}^{T}g_t\cup d_t}$ . Similarly to standard object detection metrics, track IoU together with track confidence can be used to compute mean average precision (mAP) across categories using a predefined IoU threshold. Following [17] we use a threshold of 0.5, referring to this metric as Track AP. When comparing to the state of the art, we report the standard metrics for each dataset. + +# 4.2. Implementation details + +For the components of our model shared with CenterTrack [66] we follow their architecture and protocol exactly. Here we only provide the values of the new hyperparameters. Additional details, such as joint training on synthetic and real data, are reported in the supplementary. + +The ConvGRU has a feature dimension of 256, and uses $7 \times 7$ convolutions. We train the model on synthetic sequences of length 17 for 21 epochs with a batch size 16 using the Adam optimizer. The choice of the clip length is defined by GPU memory constraints. The learning rate is set to $1.25\mathrm{e} - 4$ and decreased by a factor of 10 every 7 epochs for 1 epoch. It is then increased back to the original value. We have found such a periodic schedule to speed up convergence. We set the visibility threshold $T_{vis}$ to 0.05 and the occlusion threshold $T_{occl}$ to 0.15, corresponding to $5\%$ and $15\%$ of the object being visible respectively. During evaluation, our model is applied in a fully online way, processing all the frames from a video one by one. It runs on a single Tesla V100 GPU at around 10FPS. + +# 4.3. Ablation analysis + +In this section, we analyze our proposed approach. All the variants are trained using exactly the same hyperparameters and learning rate schedules. Invisible object annotations are ignored in the validation set of PD, so only visible parts of the trajectories are used for evaluation. This allows to fairly compare methods that do and do not have access to invisible object labels during training. + +
GRUHt-1InputCar APPerson APmAP
CenterTrack-✓2 fr66.254.460.3
Ours3 × 3✓2 fr64.649.757.1
Ours7 × 7✓2 fr65.254.059.6
Ours7 × 7X2 fr65.755.660.6
Ours7 × 7XVideo66.857.962.4
+ +Table 1. Analysis of the architecture of our our model using Track AP on the validation set of PD. We ablate the effect of the filter size in ConvGRU, explicitly passing the encoding of object centers in the previous frame $H^{t-1}$ , and training on videos vs frame pairs. + +
Invis. sup.Post-proc.Car APPerson APmAP
OursAll GT-66.058.362.2
OursFiltered GT-71.160.665.9
Ours2D const v-70.760.865.7
Ours3D const v-71.063.067.0
CenterTrack-2D const v67.654.961.2
Ours3D const v2D const v72.763.167.9
+ +Table 2. Comparison of different approaches for handling full occlusions using Track AP on the validation set of PD. We evaluate several supervision strategies, and compare the best variant to the heuristic-based constant velocity track propagation. + +Model variants. We begin by studying the variants of our video-level tracking model. To this end, we first train CenterTrack on PD using the code provided by the authors and report the results in row 1 of Table 1. The basic variant our model, shown in row 2, like CenterTrack, takes pairs of frames as input together with $H^{t-1}$ , the encoding of detections in the previous frame, but processes them recurrently with a ConvGRU. It performs significantly worse than the baseline, due to the fact that CenterTrack uses a deep network with a large field-of-view to combine the two frames and establish associations between the objects, whereas our model relies on a few convolutional layers in the ConvGRU with $3 \times 3$ filters. Increasing the filter size (row 3 in Table 1) indeed results in a noticeable performance improvement. + +Next, we observe that the additional $H^{t-1}$ input is redundant in our case. Moreover, removing this input allows to avoid the corresponding heat map augmentation strategy proposed by [66]. This simplification (show in row 4 in Table 1) further improves the performance of our model, matching CenterTrack. Finally, training and evaluating on longer sequences (last row in Table 1) unlocks the full potential of our architecture to capture object permanence in videos. Even when trained only on visible objects, this variant significantly outperforms the baseline due to its robustness to the noise in instantaneous observations. + +Tracking behind occlusions. In Table 2 we now compare various strategies for supervising full occlusion scenarios. Firstly, we observe that the naive approach of training the model to detect and track all the invisible object results in a slight decrease in performance compared to variant trained only on visible ones (last row in Table 1). As discussed in Section 3.3, such supervision is highly ambiguous, as the model cannot localize the fully occluded objects it has not seen before. Accounting for this fact with our proposed an- + +![](images/3f631c02b0cc9d33d17e27da25f963cb0b0f95015f57c705df44d1252457b83c.jpg) +Figure 5. Evaluation of the effect of the number of training videos using Track mAP on the validation set of PD. The gap between our full approach (shown in green), and the variant trained without invisible object labels (shown in blue), increases consistently with the dataset size. This demonstrates that a large dataset is required to learn to hallucinate trajectories of fully occluded objects, and KITTI (shown in yellow) would not be sufficient. + +notation filtering strategy (second row in Table 2) results in a $3.5\mathrm{mAP}$ improvement, validating its importance. + +Next, we compare using ground truth location of invisible object to pseudo-ground-truth obtained via propagating the occluded object with its constant velocity in 2D, or in 3D (see Section 3.3 for details). Constant velocity in 2D (row 3 in Table 2) is not robust to camera changes and results in a lower performance than the ground truth locations. In contrast, propagating the target with its last observed velocity in 3D world coordinates (row 4 in the table), results in labels which are both consistent with the observations and fully deterministic, further improving the performance. + +Finally, we compare our learning-based approach to the constant velocity post-processing, which is a common way of handling occlusions in the tracking literature [7, 66], in the last two rows in Table 2. Firstly, this heuristic-based step does indeed improve the performance of [66], but it remains $5.8\mathrm{mAP}$ points below our principled method. Secondly, applying this post-processing to the outputs of our method also improves its performance. We do not use any post-processing in the remainder of the experiments. + +Effect of the dataset size. In Figure 5 we plot the validation performance of two variants of our model: the full one, and the one trained on visible objects only, while increasing the number of videos in the training set of PD. One can easily see that the gap between the two variants consistently increases. In fact, below 75 videos it is close to 0. This demonstrates that a large number of examples is required to learn the tracking behind occlusions behaviour. + +Yellow dashed line corresponds to the number of videos in the training set of KITTI, and illustrates that even if this dataset provided all required annotations, it would not be sufficient to train our model. MOT17 contains only 7 train- + +
KITTIPDCar APPerson APmAP
CenterTrack [66]✓✗73.839.456.6
Ours✗✓83.338.260.8
Ours (tune)✓✓75.744.660.2
Ours (joint)✓✓84.756.370.5
CenterTrack (joint)✓✓77.251.664.4
+ +Table 3. Domain adaptation analysis using Track AP on the validation set of KITTI. We demonstrate the effectiveness of our simple strategy, and confirm that the improvements mainly come from better occlusion handling. + +ing videos, making it even less practical for our purposes. + +Domain adaptation. We now demonstrate how the model learned on the large-scale, synthetic PD dataset can be transferred to a real-world benchmark such as KITTI in Table 3, and compare to the CenterTrack model released by the authors. Firstly, we directly evaluate our model trained on PD (fourth row in Tabel 2) and report the results in the second row of Table 3. Despite the significant domain gap between the synthetic and real videos, this variant manages to outperform CenterTrack without seeing a single frame from KITTI. The gap in performance on the Person category remains large, due to its higher visual variability. + +Directly fine-tuning our model on KITTI (shown in the third row in the table), helps to reduce the domain discrepancy, improving the Person performance, but also results in un-learning the tracking behind occlusions behaviour, as reflected in the drop in Car AP. In contrast, jointly training on the two datasets achieves the best results overall, validating the effectiveness of the proposed approach. + +Finally, we apply our domain adaptation approach to the CenterTrack model trained on PD (first row in Table 1), and report the results in the last row of Table 3. One can see that synthetic data also improves CenterTrack results, but they remain $6.1\mathrm{mAP}$ point below those of our approach. This demonstrates that the improvements mainly come from our model's ability to better handle occlusions. + +# 4.4. Comparison to the state of the art + +In this section, we compare our full method, which we refer to as PermaTrack, to the state of the art on the KITTI [24], and MOT17 [38] benchmarks. All our models are pre-trained on PD and adapted to the real domain using the training set of the corresponding dataset. + +KITTI. Table 4 lists the results on the KITTI test set, comparing to vision-based, online methods. Our method outperforms the state of the art on all metrics on both categories, except for ML (Mostly Lost) on Car, where we are 0.4 points below [43]. Notice that we are 5.7 point above this method on the main HOTA metric, and are outperforming it by a large margin on all metrics on Person. Our improvements over the state-of-the-art CenterTrack are 5 HOTA points on Car and 8.4 on Person, which is notable, given that typical differences between the methods on the + +![](images/176e22c3589cdcd79ddd0a3b520c29e2cdf770921b18b5ee64a25e53c877ec38.jpg) +Figure 6. Qualitative results on a test sequence from the KITTI benchmark. Our approach is able to successfully track a fully occluded car on the left (id 6, highlighted in white). Please see supplementary video for a more comprehensive analysis on both datasets. + +![](images/b5f5fb381c84330f975f490d47d4ef2e4dbc32cc55103788f1c729faae1d9f5f.jpg) + +![](images/2d8cc3d2e65c34a8b01668eee30c4349b4ab67ba50cdd8a124e9e9bbe4901d1a.jpg) + +![](images/bf2e4034fa34ee21946e402c8e2dcb97dd883c134fac1c35ca0cde4ec5bee106.jpg) + +
CarPerson
HOTA ↑MOTA ↑MT ↑PT ↓ML ↓HOTA ↑MOTA ↑MT ↑PT ↓ML ↓
MASS [32]68.384.674.023.12.9-----
IMMDP [60]68.782.860.327.512.2-----
AB3D [57]69.883.567.121.511.435.638.917.241.641.2
TuSimple [15]71.686.371.122.06.945.957.630.644.325.1
SMAT [25]71.983.662.831.26.0-----
TrackMPNN [43]72.387.384.513.42.239.452.135.146.118.9
CenterTrack [66]73.088.882.215.42.540.453.835.443.321.3
PermaTrack (Ours)78.091.385.711.72.648.666.048.835.415.8
+ +Table 4. Comparison to the state of the art on the test set of the KITTI benchmark using aggregate metrics. Some methods only report results on Car. Our approach outperforms all the other methods by a significant margin on all the metrics except for ML on Car. + +
T.R.IDF1 ↑MOTA ↑MT ↑PT ↓ML ↓
PublicCenterTrack [66]X63.263.137.538.124.5
PermaTrack (Ours)X67.067.843.736.320.1
CenterTrack [66]✓66.463.837.238.124.8
PermaTrack (Ours)✓71.168.241.039.519.5
PrivateCenterTrack [66]X64.266.141.337.521.2
PermaTrack (Ours)X68.269.446.336.017.7
CenterTrack [66]✓69.466.239.538.322.1
PermaTrack (Ours)✓71.969.542.539.817.7
+ +Table 5. Comparison to the state of the art on the validation set of the MOT17 using private and public detections. Our method outperforms the state-of-the-art CenterTrack approach on all metrics both with and without the Track Rebirth (T.R.) post-processing. + +leader-board are within 1 point, and that CenterTrack is pretrained on a large-scale, real-world nuScenes dataset [12]. + +MOT17. The policy on this dataset is that only methods that don't use external data for training can be evaluated on the test server with public detections. With just 7 videos in the training set, MOT17 is not sufficient to learn the complex tracking behind occlusions behaviour. For fairness, we compare our method to the variant of the state-of-the-art CenterTrack which is pre-trained on the real-world CrowdHuman dataset [52] using the validation set of MOT17 in Table 5. The results on the test set using private detections are reported in the supplementary material. + +Without post-processing, our approach outperforms [66] using both public and private detections. The improvements are especially significant in the public evaluation (the same bounding boxes used by both methods), emphasizing our method's better tracking abilities. Finally, adding Track Rebirth post-processing from [66] (T.R. in the table, a variant + +of constant velocity) improves the performance of both approaches and does not change the conclusions. + +Qualitative results. We provide an example of the output of our method on a sequence from the test set of KITTI in Figure 6. In this challenging scenario, as the ego-vehicle drives forward, the car on the left (id 6, highlighted in white) is fully occluded by another moving vehicle (id 2), but our method manages to correctly localize it and maintain the trajectory. A more comprehensive analysis of our approach is presented in the supplementary video1. + +# 5. Conclusion + +In this work, we propose PermaTrack, an end-to-endtrainable approach for joint object detection and tracking. Thanks to its recurrent memory module, it is capable of reasoning about the location of objects using the entire previous history, and not just the current observation. Combined with supervision from synthetic data, this allows to train the model to track objects when they are fully occluded - a key concept in cognitive science known as object permanence. + +Our method obtains state-of-the-art results on the KITTI and MOT17 multi-object tracking benchmarks. While the ablation analysis demonstrates that hallucinating trajectories of invisible objects is a crucial factor in the final performance, knowledge about the full history also increases robustness to partial occlusions, and other low visibility scenarios, such as motion blur. + +# References + +[1] Parallel domain. https://paralleldomain.com/, March 2021. 2 +[2] Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social LSTM: Human trajectory prediction in crowded spaces. In CVPR, 2016. 2 +[3] Renee Baillargeon, Elizabeth S Spelke, and Stanley Wasserman. Object permanence in five-month-old infants. Cognition, 20(3):191-208, 1985. 1 +[4] Nicolas Ballas, Li Yao, Chris Pal, and Aaron Courville. Delving deeper into convolutional networks for learning video representations. In ICLR, 2016. 2, 3 +[5] Jerome Berclaz, Francois Fleuret, and Pascal Fua. Robust people tracking with global trajectory optimization. In CVPR, 2006. 1, 2 +[6] Jerome Berclaz, Francois Fleuret, Engin Turetken, and Pascal Fua. Multiple object tracking using k-shortest paths optimization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(9):1806-1819, 2011. 1, 2 +[7] Philipp Bergmann, Tim Meinhardt, and Laura Leal-Taixe. Tracking without bells and whistles. In ICCV, 2019. 1, 2, 5, 7 +[8] Keni Bernstein and Rainer Stiefelhagen. Evaluating multiple object tracking performance: the clear mot metrics. EURASIP Journal on Image and Video Processing, 2008:1-10, 2008. 6 +[9] Alex Bewley, Zongyuan Ge, Lionel Ott, Fabio Ramos, and Ben Upcroft. Simple online and realtime tracking. In ICIP, 2016. 1, 2 +[10] Guillem Brasó and Laura Leal-Taixe. Learning a neural solver for multiple object tracking. In CVPR, 2020. 1, 2 +[11] Michael D Breitenstein, Fabian Reichlin, Bastian Leibe, Esther Koller-Meier, and Luc Van Gool. Robust tracking-by-detection using a detector confidence particle filter. In ICCV, 2009. 1, 2 +[12] Holger Caesar, Varun Bankiti, Alex H. Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuScenes: A multimodal dataset for autonomous driving. In CVPR, 2020. 5, 8 +[13] Boyu Chen, Dong Wang, Peixia Li, Shuang Wang, and Huchuan Lu. Real-time 'actor-critic' tracking. In ECCV, 2018. 2 +[14] Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014. 3 +[15] Wongun Choi. Near-online multi-target tracking with aggregated local flow descriptor. In ICCV, 2015. 8 +[16] Wongun Choi and Silvio Savarese. Multiple target tracking in world coordinate with single, minimally calibrated camera. In ECCV, 2010. 2 +[17] Achal Dave, Tarasha Khurana, Pavel Tokmakov, Cordelia Schmid, and Deva Ramanan. TAO: A large-scale benchmark for tracking any object. In ECCV, 2020. 6 + +[18] César Roberto de Souza, Adrien Gaidon, Yohann Cabon, Naila Murray, and Antonio Manuel López. Generating human action videos by coupling 3D game engines and probabilistic graphical models. *IJCV*, pages 1–32, 2019. 3 +[19] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In CVPR, 2015. 3 +[20] Matteo Fabbri, Fabio Lanzi, Simone Calderara, Andrea Palazzi, Roberto Vezzani, and Rita Cucchiara. Learning to detect and track visible and occluded body joints in a virtual world. In ECCV, 2018. 3 +[21] Christoph Feichtenhofer, Axel Pinz, and Andrew Zisserman. Detect to track and track to detect. In ICCV, 2017. 2 +[22] Adrien Gaidon, Qiao Wang, Yohann Cabon, and Eleonora Vig. Virtual worlds as proxy for multi-object tracking analysis. In CVPR, 2016. 3, 5 +[23] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015. 3 +[24] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? The KITTI vision benchmark suite. In CVPR, 2012. 1, 2, 5, 7 +[25] Nicolas Franco Gonzalez, Andres Ospina, and Philippe Calvez. SMAT: Smart multiple affinity metrics for multiple object tracking. In ICIAR, 2020. 8 +[26] Helmut Grabner, Jiri Matas, Luc Van Gool, and Philippe Cattin. Tracking the invisible: Learning where the object might be. In CVPR, 2010. 2 +[27] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. Cycada: Cycle-consistent adversarial domain adaptation. In ICML, 2018. 3 +[28] Yan Huang and Irfan Essa. Tracking multiple objects through occlusions. In CVPR, 2005. 2 +[29] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. FlowNet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017. 3, 5 +[30] Hao Jiang, Sidney Fels, and James J Little. A linear programming approach for multiple object tracking. In CVPR, 2007. 2 +[31] Kai Kang, Hongsheng Li, Tong Xiao, Wanli Ouyang, Junjie Yan, Xihui Liu, and Xiaogang Wang. Object detection in videos with tubelet proposal networks. In CVPR, 2017. 2 +[32] Hasith Karunasekera, Han Wang, and Handuo Zhang. Multiple object tracking with attention to appearance, structure, motion and size. IEEE Access, 7:104423-104434, 2019. 8 +[33] Jiaqi Zou Ke Mei, Chuang Zhu and Shanghang Zhang. Instance adaptive self-training for unsupervised domain adaptation. In ECCV, 2020. 3 +[34] Laura Leal-Taixe, Michele Fenzi, Alina Kuznetsova, Bodo Rosenhahn, and Silvio Savarese. Learning an image-based motion context for multiple people tracking. In CVPR, 2014. 1, 2 +[35] Kuan-Hui Lee, German Ros, Jie Li, and Adrien Gaidon. SPI-GAN: privileged adversarial learning from simulation. In ICLR, 2019. 3 + +[36] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In ICCV, 2017. 4 +[37] Jonathon Luiten, Aljosa Osep, Patrick Dendorfer, Philip Torr, Andreas Geiger, Laura Leal-Taixe, and Bastian Leibe. HOTA: A higher order metric for evaluating multi-object tracking. International Journal of Computer Vision, pages 1-31, 2020. 6 +[38] Anton Milan, Laura Leal-Taixe, Ian Reid, Stefan Roth, and Konrad Schindler. MOT16: A benchmark for multi-object tracking. arXiv preprint arXiv:1603.00831, 2016. 2, 5, 7 +[39] Anton Milan, Seyed Hamid Rezatofighi, Anthony Dick, Ian Reid, and Konrad Schindler. Online multi-target tracking using recurrent neural networks. In AAAI, 2017. 2 +[40] Dennis Mitzel, Esther Horbert, Andreas Ess, and Bastian Leibe. Multi-person tracking with sparse detection and continuous segmentation. In ECCV, 2010. 2 +[41] Vasilis Papadourakis and Antonis Argyros. Multiple objects tracking in the presence of long-term occlusions. Computer Vision and Image Understanding, 114(7):835-846, 2010. 2 +[42] Hamed Pirsiavash, Deva Ramanan, and Charless C Fowlkes. Globally-optimal greedy algorithms for tracking a variable number of objects. In CVPR, 2011. 1, 2 +[43] Akshay Rangesh, Pranav Maheshwari, Mez Gebre, Siddhesh Mhatre, Vahid Ramezani, and Mohan M Trivedi. TrackMPNN: A message passing graph neural architecture for multi-object tracking. arXiv preprint arXiv:2101.04206, 2021. 7, 8 +[44] Liangliang Ren, Jiwen Lu, Zifeng Wang, Qi Tian, and Jie Zhou. Collaborative deep reinforcement learning for multi-object tracking. In ECCV, 2018. 2 +[45] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NIPS, 2015. 2 +[46] Stephan R Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for data: Ground truth from computer games. In ECCV, 2016. 3 +[47] Ergys Ristani and Carlo Tomasi. Features for multi-target multi-camera tracking and re-identification. In CVPR, 2018. 2 +[48] German Ros, Laura Sellart, Joanna Materzynska, David Vazquez, and Antonio M Lopez. The Synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In CVPR, 2016. 3 +[49] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-252, 2015. 6 +[50] Antoine Saporta, Tuan-Hung Vu, M. Cord, and P. Pérez. Esl: Entropy-guided self-supervised learning for domain adaptation in semantic segmentation. ArXiv, 2020. 3 +[51] Aviv Shamsian, Ofri Kleinfeld, Amir Globerson, and Gal Chechik. Learning object permanence from video. In ECCV, 2020. 2 +[52] Shuai Shao, Zijian Zhao, Boxun Li, Tete Xiao, Gang Yu, Xiangyu Zhang, and Jian Sun. CrowdHuman: A bench + +mark for detecting human in a crowd. arXiv preprint arXiv:1805.00123, 2018. 8 +[53] Elizabeth S Spelke. Principles of object perception. Cognitive science, 14(1):29-56, 1990. 1 +[54] Siyu Tang, Mykhaylo Andriluka, Bjoern Andres, and Bernt Schiele. Multiple people tracking by lifted multicut and person re-identification. In CVPR, 2017. 1, 2 +[55] Pavel Tokmakov, Cordelia Schmid, and Karteek Alahari. Learning to segment moving objects. International Journal of Computer Vision, 127(3):282-301, 2019. 3, 5 +[56] Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Mathieu Cord, and Patrick Pérez. DADA: Depth-aware domain adaptation in semantic segmentation. In ICCV, 2019. 3 +[57] Xinshuo Weng and Kris Kitani. A baseline for 3D multi-object tracking. arXiv preprint arXiv:1907.03961, 2019. 8 +[58] Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550-1560, 1990. 4 +[59] Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In ICIP, 2017. 1, 2 +[60] Yu Xiang, Alexandre Alahi, and Silvio Savarese. Learning to track: Online multi-object tracking by decision making. In ICCV, 2015. 8 +[61] Fanyi Xiao and Yong Jae Lee. Video object detection with an aligned spatial-temporal memory. In ECCV, 2018. 3 +[62] Jiarui Xu, Yue Cao, Zheng Zhang, and Han Hu. Spatial-temporal relation networks for multi-object tracking. In ICCV, 2019. 1, 2 +[63] Linjie Yang, Yuchen Fan, and Ning Xu. Video instance segmentation. In ICCV, 2019. 6 +[64] Qian Yu, Gérard Medioni, and Isaac Cohen. Multiple target tracking using spatio-temporal markov chain monte carlo data association. In CVPR, 2007. 2 +[65] Li Zhang, Yuan Li, and Ramakant Nevatia. Global data association for multi-object tracking using network flows. In CVPR, 2008. 2 +[66] Xingyi Zhou, Vladlen Koltun, and Philipp Krahenbuhl. Tracking objects as points. In ECCV, 2020. 1, 2, 3, 4, 5, 6, 7, 8 +[67] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. arXiv preprint arXiv:1904.07850, 2019. 3 +[68] Yang Zou, Zhiding Yu, Xiaofeng Liu, B.V.K. Vijaya Kumar, and Jinsong Wang. Confidence regularized self-training. In ICCV, 2019. 3 +[69] Yang Zou, Zhiding Yu, BVK Vijaya Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In ECCV, 2018. 3 \ No newline at end of file diff --git a/learningtotrackwithobjectpermanence/images.zip b/learningtotrackwithobjectpermanence/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f2a726e67aa15479322a7045980c692e31d7af39 --- /dev/null +++ b/learningtotrackwithobjectpermanence/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb8f30acef990dcdd3192ba3819bb4a9f2bdf1247202719956e12f26d4318987 +size 434367 diff --git a/learningtotrackwithobjectpermanence/layout.json b/learningtotrackwithobjectpermanence/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2a9aec216c53ba1d2900f7f93060e8d1f4d130f2 --- /dev/null +++ b/learningtotrackwithobjectpermanence/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28fe274657acea6127c3849a81c32bbcc7f87219e15777bbdd28c09798e5591e +size 412408 diff --git a/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_content_list.json b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0c65a2f583ecaffdf72b1f877c0f95b3eaa39ca5 --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:711c39896e03d49efb1359bb77b84dd3ea9920f5c7adc280aba72a79e1eca200 +size 73837 diff --git a/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_model.json b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7030e81925937053c01ae235f06d20fe062a4e06 --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a7b7da1772f4ad434aa939dbf8c6980dd64ca825365cd69bdfd0780120841db +size 89102 diff --git a/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_origin.pdf b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fac601e33562e98c5e42dc131e7144451fc207c8 --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/6e8f6593-e41f-4b93-8702-776fc4bf1072_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2acd7c0c99c907c29e8d8bc09c0257861b07be5cad68e2654a80365041f4b7e +size 5060893 diff --git a/learningunsupervisedmetaformerforanomalydetection/full.md b/learningunsupervisedmetaformerforanomalydetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8f2c9f7df0449dd8b2ccc69ff22c45532db912db --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/full.md @@ -0,0 +1,289 @@ +# Learning Unsupervised Metaformer for Anomaly Detection + +Jhih-Ciang Wu $^{1,2}$ , Ding-Jie Chen $^{1}$ , Chiou-Shann Fuh $^{2}$ , and Tyng-Luh Liu $^{1}$ + +$^{1}$ Institute of Information Science, Academia Sinica, Taiwan + +$^{2}$ Department of Computer Science and Information Engineering, National Taiwan University, Taiwan + +# Abstract + +Anomaly detection (AD) aims to address the task of classification or localization of image anomalies. This paper addresses two pivotal issues of reconstruction-based approaches to AD in images, namely, model adaptation and reconstruction gap. The former generalizes an AD model to tackling a broad range of object categories, while the latter provides useful clues for localizing abnormal regions. At the core of our method is an unsupervised universal model, termed as Metaformer, which leverages both meta-learned model parameters to achieve high model adaptation capability and instance-aware attention to emphasize the focal regions for localizing abnormal regions, i.e., to explore the reconstruction gap at those regions of interest. We justify the effectiveness of our method with SOTA results on the MVTec AD dataset of industrial images and highlight the adaptation flexibility of the universal Metaformer with multi-class and few-shot scenarios. + +# 1. Introduction + +The principal goal of image Anomaly Detection (AD) is to classify whether an image depicts an abnormal version of the target object and if exist, localize those regions of anomaly. The technique to detect the various anomalies of interest is crucial for industrial inspection to ensure that the resulting products meet the required standards [15]. However, since the anomalies (or the defects) can deviate from the normal ones in numerous ways, it is hard to exhaustively pre-define an anomaly prior and collect enough anomaly data for training an anomaly detection model. Instead, most of the previous methods use anomaly-free data to construct its representative distribution for indirectly discriminating the deviated data as anomalies. Hence, the AD task is also known as out-of-distribution detection. + +Driven by the attempt to model the one-class distribution of the anomaly-free data, the embedding-based [5, 28] and the reconstruction-based methods [24, 35, 39] comprise the two main trends for tackling the AD problem. The former seeks to learn an embedding function for making + +![](images/ce7d22728342f79447c23593628ccc91e37047dc3fd4a7ea08563e013222cd4f.jpg) +Figure 1. Model adaptation and reconstruction gap are two pivotal issues of reconstruction-based anomaly detection. Top: most AD techniques train a specific model for each category. Such an approach would become demanding as the number of categories increases. Bottom: we instead propose to train a universal model, Metaformer with instance-aware ability to simultaneously address the two key issues. Note that $I - \hat{I}$ and $I - \tilde{I}$ respectively denote the reconstruction errors with or without instance-aware attention. + +the anomaly-free data close to each other in the embedding space, and the latter aims to leverage a neural network for reconstructing each sample of the normal class. To determine the anomalies, the embedding-based methods draw on the resulting learned metrics, while the reconstruction-based ones employ reconstruction errors by contrast. + +We resolve the AD problem from the reconstruction-based point of view. Our formulation particularly pays attention to explore two key factors, reconstruction gap and model adaptation, in designing an effective AD framework. (See Figure 1.) Most of the reconstruction-based AD techniques include an autoencoder component. As the training data are typically sufficient and all from the "normal" class, a well-trained autoencoder is expected to satisfactorily re + +construct such samples not only in training but also in inference. The assumption implies that the reconstruction gap can be used to detect anomalies if a given image is out of the distribution of the normal class. Different from most existing reconstruction-based AD methods merely predicting the image-level anomalies, our approach introduces the instance-aware attention to further regulate the reconstruction gap for precisely localizing the pixel-level abnormal regions. Regarding the issue of model adaptation, we observe that prior arts on AD often need to collect a large number of anomaly-free examples to train an additional AD model for classifying a new object category. In real-world applications, an AD system could be deployed on edge devices of limited computational power, and such a data-eager training strategy may not be practical. To overcome the concern, we design a meta-learning strategy that enables our universal AD model to be fine-tuned with only a few anomaly-free supporting examples for handling a novel category. + +The cornerstone of our method is the Metaformer, which leverages the meta-learned model parameters to effectively carry out the few-shot fine-tuning for performing AD of a novel object category and employs the instance-aware attention to emphasize the abnormal focal regions. Briefly speaking, the proposed Metaformer is a transformer-based instance-aware autoencoder that learns its model parameters using an unsupervised meta-learning strategy. Figure 1 overviews the proposed AD model. Figure 2 illustrates the steps of our meta-training, meta-testing, and inference. Figure 3 sketches the key components of our Metaformer. + +To enable the Metaformer for efficient model adaptation, we learn its model parameters with an unsupervised metatraining strategy. Namely, the training comprises numerous few-shot image reconstruction tasks to obtain the parameters for the universal model, which can be rapidly fine-tuned using a few anomaly-free examples from each underlying novel class in meta-testing. It follows that the fine-tuned Metaformer is ready for performing the AD inference for the novel object category. We note that the meta-training stage does not have access to any of the images used in the meta-testing stage and the testing/inference stage of a novel category. In addition, to empower the Metaformer to more precisely uncover the abnormal regions, we introduce instance-aware attention to regularize the autoencoder (AE) to focus on the instance area while reconstructing an image. In our formulation, we first establish the instance prior based on saliency prediction and then carry out the AE regularization via an attention mechanism. + +To the best of our knowledge, the proposed method is the first to address the image AD task by employing an adaptive instance-aware reconstruction method. We characterize our main contributions as follows: + +- We introduce unsupervised few-shot meta-training to learn the universal Metaformer that exhibits the effi + +cient flexibility of model adaptation to an arbitrary object category of interest. + +- We couple the instance-aware attention mechanism with the autoencoder such that anomaly detection based on reconstruction gap can emphasize the area of target object rather than the distracting background. +- We provide extensive experimental results and comparisons to demonstrate that our method achieves the overall SOTA performance on both the anomaly classification and anomaly localization. + +# 2. Related Work + +In this section, we concisely review the recent research efforts relevant to the tasks of anomaly detection, meta-learning, and instance-aware attention. + +Anomaly Detection The task of anomaly detection involves either image-level anomaly classification, which classifies whether an image is abnormal [2, 5, 13, 28, 35, 36], or pixel-level anomaly localization, which further localizes the abnormal regions [4, 5, 32]. + +Previous methods for anomaly detection are mostly cast as a one-class problem [1, 29] due to the scarcity of anomaly samples. For example, [14] introduces the memory block that enforces reconstructive images more like the given regular class. There are also several GAN-based approaches [2, 3, 7, 24, 25, 30] that apply adversarial training to enhance the performance of AD. + +The MVTec AD dataset is recently introduced in [4], which includes the annotations of abnormal regions for evaluating an AD task about industrial inspection. Methodology-wise, techniques to deal with the AD problems can be divided into several essential types. The most popular one is the reconstruction-based approach that is conventionally established based on an autoencoder. The benchmark presented in MVTec AD comprises the convolutional autoencoder with $\ell_2$ loss and structural similarity (SSIM) loss named $\ell_2$ -AE and SSIM-AE, respectively. GANomaly [2] extends the general autoencoder architecture and proposes an encoder-decoder-encoder network that reconstructs both the input image and the bottleneck with the adversarial training technique. Another autoencoder variant for AD [36] employs energy based model (EBM) and uses the energy score and the reconstruction error as the scoring function. Reconstruction-by-inpainting anomaly detection (RIAD) [35] treats AD as a self-supervised task that randomly crops patches for every instance and inpaints it via an autoencoder. A similar work [13] utilizes transformation in geometry and trains a multi-class model. Even though these autoencoder-based models achieve good AD accuracy, their reconstructed images generally tend to be + +blurry. The shortcoming could cause detecting many abnormal regions, but most of them are not relevant to the AD task. In [32], the authors adopt an attention mechanism and designs an attention expansion loss to preserve spatial information. In comparison with this work, we address this issue by integrating the instance-aware attention mechanism with the autoencoder to improve the AD localization. + +More recently, DifferNet [28] adopts the normalizing flow [26] as a density estimation of the image features extracted by convolutional neural networks. Then the anomaly score is computed based on the likelihoods of multiple transformations per image. Using the teacher-student knowledge distilling approach, US [5] learns a discriminative embedding for making the student networks produce regression errors and uncertainties. To compare the effectiveness of feature distribution for anomaly localization, the US model is further evaluated by fitting different algorithms such as K-Means, OC-SVM, and 1-NN into the teacher network. Observe that existing methods perform data augmentation or model ensemble, which results in relatively high cost. Moreover, they usually train a single model per category in the dataset. We tackle this issue by applying meta-learning to train an adapted universal model. + +To address the AD task on retinal images, P-Net [39] employs the external edge-structure information to encode the relation between structure and texture for the subsequent image reconstruction to detect the abnormal regions. They obtain structure information using an off-the-shelf edge detector. In comparison and to be explained later, we learn an instance-prior generator and Metaformer using the same dataset in an unsupervised manner. This advantage brings more flexibility and less cost for real-world applications. + +Meta-learning The objective of meta-learning is to enable a model for fast adaptability by training it on various learning tasks. The learned model is hence able to adapt to novel tasks with a few supporting examples. To this end, one sort of meta-learning method [11, 12, 19, 22] aims to explicitly maximize the model sensitivity concerning the novel-task losses against the model parameters. To borrow the fast model adaptability for addressing the model adaptation issue in the AD task, we employ Model-Agnostic Meta-Learning (MAML) [11] to train parameters of Metaformer for sensitivity on a given task distribution. Note that we explicitly train the Metaformer in an unsupervised manner. Precisely, the task distribution for use is defined without any additional annotations or attributes. + +Instance-aware Attention To address the reconstruction gap for precisely localizing the pixel-level abnormal regions, we introduce the instance-aware attention to regulate the reconstructed image focusing on the instance regions. In practice, we factor the instance-aware attention into an + +![](images/793cce2e4b16db4f5f39c8036d533e067297cdbb0715daca24883a7788618504.jpg) +Figure 2. The model learning pipeline. We first train Metaformer using various tasks $T_{i}$ from MSRA10K in the meta-training phase. The learned universal model $\mathcal{M}_{\theta}$ updates parameters efficiently to obtain $\mathcal{M}_{\theta'}$ in the meta-testing stage. The fine-tuned model $\mathcal{M}_{\theta'}$ measures the performance using the original testing split $\tilde{S}_c$ in MVTec AD. The green boxes and red boxes indicate the anomaly-free examples and anomalous examples, respectively. + +instance-aware generator and an attention mechanism. The former depicts the region of interest, and the later enable our image reconstruction focusing on these instance regions. + +Our instance-aware generator considers the saliency detection approach [8, 18, 20, 37, 38] to depict the region of interest for anomaly detection. A saliency detection method aims at finding salient objects in an image. For concerning the unsupervised learning, we employ the generator within the Visual-Effect GAN [8] as our instance-aware generator, which is trained by using the annotation-free Flickr images. Though the other methods [18, 20, 37] are unsupervised ones, the hand-crafted methods [18, 20] generate noisy results, and the deep detection [37] needs to ensemble multiple saliency detection results retrieved from other methods. + +Our attention mechanism aims to leverage the instance-aware prior for making the autoencoder pay attention to reconstructing the region of interest. To this end, we form the dependencies between the instance-aware prior and the AE output via the transformer [31], which is devised for addressing the machine translation task yet shows its convincing improvement on various tasks such as image caption [10], instance segmentation [21], sketch classification [27], and image super-resolution [34]. + +# 3. Method + +We introduce the Metaformer, which aims to tackle the issues of model adaptation and reconstruction gap, to classify the image-level anomalies and localize the pixel-level abnormal regions. For dealing with the model adaption issue, we learn one single Metaformer model by leveraging the meta-learning strategy, which comprises the steps of meta-training and meta-testing. For the reconstruction gap issue, we propose an instance-aware image reconstruction accomplished within Metaformer. To illustrate our method, we first elaborate on our model learning strategy and then show the components of the Metaformer. + +# 3.1. Model Learning Strategy + +Our model learning strategy includes the meta-training step and meta-testing step. The learned model is then available for tackling AD tasks in the inference step. Figure 2 shows the pipeline and required data in these steps. Briefly, the unsupervised meta-training is used to learn the universal Metaformer for capturing the concept of the general category-independent instance-aware image reconstruction. While dealing with a category-dependent AD task, i.e., one specific novel image category, the meta-trained model's fast adaptive tuning ability enables the universal Metaformer to be rapidly fine-tuned with a few anomaly-free examples of that category in the meta-testing step. Therefore, the finetuned model is ready to carry out the anomaly detection of that image category from AD dataset in the inference step. + +# 3.1.1 Unsupervised Meta-training & Meta-testing + +In meta-learning, a meta-task implies the application that needs to be achieved by the learned model, and we define the meta-task as a few-shot image reconstruction. We employ the MAML algorithm to carry out the meta-training step and the meta-testing step, yet the unsupervised clustering is considered for sampling a meta-task while learning the universal Metaformer within the meta-learning step. + +Meta-task In our meta-learning, each meta-task mimics one few-shot image reconstruction, i.e., only a few supporting examples are allowed for model tuning per reconstruction. The standard AD datasets often evaluate an AD model through category by category testing, which implies that a single meta-task is formulated on an image group of a specific category. Without losing generality, we assume that a meta-task is defined on a set of similar-structure images. + +Our unsupervised meta-training uses numerous few-shot image reconstruction meta-tasks to train the model to capture the general category-independent image reconstruction concept. Precisely, given a meta-training dataset $\mathcal{D}^{meta}$ , we first extract features using ResNet18 [16] and perform k-means algorithm on feature space to divide $\mathcal{D}^{meta}$ into $N$ + +Algorithm 1 Unsupervised meta-learning for Metaformer +Hyperparameters: $\alpha, \beta$ +Input: Wild dataset $D^{meta}$ , training split $S_{c}$ of AD dataset +1: Construct $T_{i}$ via grouping images in $D^{meta}$ into $N$ clusters +2: Initialize $\theta$ and build Metaformer $\mathcal{M}_{\theta}$ /* Unsupervised meta-training for Metaformer */ +3: for $i = 1$ to $N$ do +4: Evaluate $\nabla_{\theta} \mathcal{L}(T_{i})$ +5: Compute gradients for adaptive parameters with the optimizer: $\theta_{i}' = \theta - \alpha \nabla_{\theta} \mathcal{L}(T_{i})$ +6: end for +7: Update $\theta \gets \theta - \beta \nabla_{\theta} \sum_{i=1}^{N} \mathcal{L}(\{\mathcal{M}_{\theta_{i}',}, \mathcal{G}_{i}\})$ /* Meta-testing for task adaptation */ +8: Update $\theta' \gets \theta - \alpha \nabla_{\theta} \mathcal{L}(T_{c})$ + +coarse groups. We then trim the groups according to the structural similarity to the center features and form the fine image groups $\{\mathcal{G}_i\}$ . For a meta-task $T_{i}$ dealing with one specific image category, we formally define the meta-task $T_{i} = \{\mathcal{M}_{\theta},\mathcal{G}_{i}\subset \mathcal{D}^{meta}\}$ comprises an AD model $\mathcal{M}_{\theta}$ and a fine image group $\mathcal{G}_i$ . The structural similarity between images $x$ and $y$ derived from [33] is defined as + +$$ +s s i m (x, y) = \frac {4 \mu_ {x} \mu_ {y} \sigma_ {x y} + \epsilon}{\left(\mu_ {x} ^ {2} + \mu_ {y} ^ {2}\right) \left(\sigma_ {x} ^ {2} + \sigma_ {y} ^ {2}\right) + \epsilon}, \tag {1} +$$ + +where $\mu, \sigma$ are average intensity and standard deviation of the given image. $\epsilon$ is a small constant that prevents zero division. Note that the structure-based clustering is carried out according to the structural similarity among images, and the ground-truth for each reconstructed image is essentially its original one without accessing any annotations. Hence, given an image $I \in \mathcal{G}_i$ , our meta-training step aims to learn the Metaformer $\mathcal{M}_{\theta}$ for reconstructing the image $I$ as $\hat{I} = \mathcal{M}_{\theta}(I)$ , where the $\theta$ denotes the model parameters. + +To capture the category-dependent image reconstruction concept of a specific image category $c$ in an AD dataset, the universal model $\mathcal{M}_{\theta}$ simply fine-tunes its parameters with the training split $\mathcal{S}_c \subset \mathcal{D}^{AD}$ of AD dataset (see Figure 2). We define the meta-task $T_c = \{\mathcal{M}_{\theta'}, \mathcal{S}_c \subset \mathcal{D}^{AD}\}$ comprises a fine-tuned AD model $\mathcal{M}_{\theta'}$ that is trained with the subgroup $\mathcal{S}_c$ . + +Meta-training The meta-training aims to learn a universal AD model with high adaptation capability. To this end, our unsupervised meta-training employs numerous few-shot image reconstructions as meta-tasks to capture the general concept of the reconstruction, where each image group for the corresponding meta-task results from an unsupervised image clustering. + +Given the Metaformer $\mathcal{M}_{\theta}$ , the meta-training process adapts $\mathcal{M}_{\theta}$ concerning numerous meta-task $T_{i}$ . Intuitively, + +![](images/db586aafe1d705b1d91f638a7a5827971239d658271b65787a8f44a2b4984109.jpg) +Figure 3. An overview of our Metaformer. The Metaformer consists of three modules: a generator, an autoencoder, and a transformer. We train a GAN (green dashed boxes) using MSRA10K and Flickr online images with specific visual effect (black dashed box). All parameters of the generator are fixed and put into Metaformer after training. Next, we start to train the remaining modules (blue dashed boxes). + +the image reconstruction loss is derived from the difference between the reconstructed image $\hat{I} = \mathcal{M}_{\theta}(I)$ and the input image $I$ . We then define the meta-task loss $\mathcal{L}(T_i)$ as + +$$ +\mathcal {L} \left(T _ {i}\right) = \sum_ {I \in \mathcal {G} _ {i}} L \left(\mathcal {M} _ {\theta} (I); I\right), \tag {2} +$$ + +where the loss function $L(a; b)$ measures the difference between $a$ and $b$ . With the loss, the model parameters can thus be updated from $\theta$ to $\theta_i'$ concerning the meta-task $T_i$ via gradient updates: + +$$ +\theta_ {i} ^ {\prime} = \theta - \alpha \nabla_ {\theta} \mathcal {L} \left(T _ {i}\right), \tag {3} +$$ + +where $\alpha$ is the learning rate. Since meta-training aims to learn robust model parameters $\theta$ to form the universal model $\mathcal{M}_{\theta}$ , the task-adapted parameters $\theta^{\prime}$ in (3) will be minimized its reconstruction loss among all meta-tasks via loss calculation for retrieving the best $\theta$ . Therefore, the objective function of meta-training is formulated as + +$$ +\min _ {\theta} \sum_ {i = 1} ^ {N} \mathcal {L} \left(\left\{\mathcal {M} _ {\theta_ {i} ^ {\prime}}, \mathcal {G} _ {i} \right\}\right). \tag {4} +$$ + +As a result, the meta-training loss in (4) is summing over all tasks, yet we sample a mini-batch of meta-tasks per training iteration as MAML. Therefore, the meta-training optimization across meta-tasks and the model parameters are hence updated as + +$$ +\theta \leftarrow \theta - \beta \nabla_ {\theta} \sum_ {i = 1} ^ {N} \mathcal {L} \left(\left\{\mathcal {M} _ {\theta_ {i} ^ {\prime}}, \mathcal {G} _ {i} \right\}\right), \tag {5} +$$ + +where $\beta$ is the meta learning rate. + +Meta-testing In the meta-testing step, the meta-trained Metaformer $\mathcal{M}_{\theta}$ is expected to reconstruct a given image from a category-dependent AD task after performing the fast adaptation with a few supporting examples. In this paper, each novel meta-task is defined on the specific-category set of the anomaly-free training images in the MVTec AD dataset. Similar to the updating function in (3), the model parameters are updated concerning the image group $S_{c}$ in MVTec AD dataset via one gradient update: + +$$ +\theta_ {c} ^ {\prime} = \theta - \alpha \nabla_ {\theta} \mathcal {L} \left(\left\{\mathcal {M} _ {\theta_ {c}}, \mathcal {S} _ {c} \right\}\right). \tag {6} +$$ + +We summarize the meta-learning procedure in Algorithm 1. + +Loss We define loss function as a couple of the mean squared error $l_{mse}$ and the structural similarity loss $l_{ssim}$ [33] as + +$$ +L (\hat {I}; I) = l _ {m s e} (\hat {I}, I) + \lambda l _ {s s i m} (\hat {I}, I), \tag {7} +$$ + +where $\lambda$ is the weight between the loss terms. + +# 3.1.2 Inference + +After a few-shot model tuning with the specific-category supporting images, the tuned Metaformer $\mathcal{M}_{\theta'}$ is ready to reconstruct the specific-category images in testing split $\tilde{\mathcal{S}}_c$ for inference. + +# 3.2. Instance-aware Metaformer + +To resort to the reconstruction gap issue for precisely localizing anomaly regions, we design the Metaformer as a transformer-based instance-aware autoencoder consisting of three modules: autoencoder, instance-prior generator, and transformer. The details of Metaformer are illustrated in Figure 3. We describe each component as follows. + +Autoencoder Most conventional AD methods utilize the autoencoder-like models to deal with anomaly detection since only anomaly-free images allowed for model training. Our autoencoder module employs the similar model designed in [5], which is symmetrical with five layers in both the encoder and decoder. The detailed architectures are provided in the supplementary material. The autoencoder $\mathcal{A}$ first encodes an input image $I$ into a latent representation, and then it decodes the latent representation $\mathcal{Z}$ into an intermediate image $\tilde{I}$ . Briefly, we represent this module as $\tilde{I} = \mathcal{A}(I)$ . + +Instance-prior Generator We employ a module trained in an unsupervised manner for extracting the instance-prior to depict the foreground regions. Inspired by [8], our instance-prior generator $\mathcal{P}$ employs the generator part within the Visual-Effect GAN, which comprises a generator, an editor, and a discriminator. We use the same architecture as [8], and we use 4,061 Flickr online images with color selective visual effects (see Figure 3) to learn to extract the internal representations for discriminating the image foreground from the image background. Please refer to [8] for the details of training the GAN model. + +Briefly, we represent the response map $R$ generated from this module as $R = \mathcal{P}(I)$ . Note that once the Visual-Effect GAN has been trained, we directly use its generator as our instance-prior generator without any parameter fine-tuning. Namely, only the model parameters within the autoencoder module and the transformer module will be tuned during our meta-learning process. + +Transformer Our attention mechanism is the transformer [31], which is purposely to solve the language translation problem. The transformer comprises an encoder-decoder pair, which performs the intra-attention on both the encoder and decoder, and also carries out the inter-attention between the encoder-decoder pair. In practice, the transformer's attention mechanism reformulates the feature representation of the encoder's input by concerning the decoder's input, hence enabling the encoder's input to simulate the feature representation possessed by the decoder's input. + +In an image reconstruction process within our AD task, we propose to train an instance-aware autoencoder for addressing the reconstruction gap issue. Our idea is leveraging an instance-prior to highlight the reconstruction errors locating in the foreground area. In this way, we can guide autoencoder parameters focusing on the image foreground due to the relatively large reconstruction errors compared to the image background. Instead of directly applying the instance-prior to the reconstructed image, our transformer module reformulates the feature representation of the instance-prior by concerning the reconstructed image. Hence, the reformulated instance-prior can be treated as a + +re-weighting indicator to be applied onto the reconstructed image by element-wise multiplication. Here, we represent the reformulated instance-prior $R'$ generated from this module as $R' = \mathcal{T}(R)$ . Therefore, the instance-aware reconstructed image $\hat{I}$ is obtained as + +$$ +\hat {I} = \mathcal {A} (I) \otimes \mathcal {T} (\mathcal {P} (I); \mathcal {A} (I)) \tag {8} +$$ + +where $\mathcal{A}$ , $\mathcal{P}$ , and $\mathcal{T}$ denote the autoencoder, instance-prior generator, and transformer, respectively. The transformer $\mathcal{T}(a; b)$ denotes that feature $a$ is reformulated concerning feature $b$ . In practice, we use the vanilla transformer of eight heads in three layers. + +The anomalous regions can be determined by the difference between $I$ and $\tilde{I}$ in a self-supervised manner once the reconstructed image is generated. + +# 4. Experiments + +Implementation Details. Our meta-learning formulates the meta-tasks by using the MSRA10K dataset [9] as $\mathcal{D}^{meta}$ and MVTec AD dataset [4] as $\mathcal{D}^{AD}$ . Before the meta-learning step, we use structural similarity and k-means to construct meta-tasks that contain around 200 images per group in our experiment. We set hyperparameters $\alpha = \beta = 0.0001$ and $\lambda = 0.1$ . The optimizer is Adam, with learning rates decaying $10\%$ every 20 epochs in meta-training stage. The total epochs in meta-training and meta-testing are 100 and 30, respectively. Note that our instance-aware generator is trained on its own. We train the Visual-Effect GAN for 200 epochs. The optimizer is Adam, with learning rates of 0.0002 decaying $10\%$ every 50 epochs. All of our networks are trained under the batch size of 64. + +Dataset. We evaluate our method's performance with state-of-the-art methods selected from anomaly classification and anomaly localization on MVTec AD [4] and Magnetic Tile Defects (MTD) dataset [17]. Each image from the two datasets is resized to $256 \times 256$ , and only the anomaly-free images are used for training. The MVTec AD contains 5,354 images in 15 categories of textures and objects. Each category comprises anomaly-free and several defect types such as broken, contamination, and bent objects. The various cases of irregular defects cause the MVTec AD challenging for anomaly detection. The MTD dataset comprises 1,344 instances of 952 being anomaly-free ones and 392 anomalous. The MTD dataset has five defect types of break, blowhole, crack, fray, and uneven. While evaluating this dataset, we adopt the equivalent setting of [28] to reserves $20\%$ anomaly-free instances randomly and all the anomalous images for evaluation. + +Metrics. For assessing the performance in image-level anomaly classification, we calculate the Area Under Curve (AUC), which is the standard threshold-independent metric used as [2]. For comparing the performance in pixel-level + +Table 1. Comparison the methods of image-level anomaly classification and pixel-level anomaly localization on the MVtec AD dataset. + +
CategoryImage-level Anomaly Classification Methods (AUC metric)Pixel-level Anomaly Localization Methods (PRO metric)
GeoTransGANomalyDSEBMUSRIADDifferNetMetaformer\( \ell_2-AE \)1-NNOC-SVMK-MeansSSIM-AEUSp=65Metaformer
Texturescarpet0.4370.6990.4130.9160.8420.9290.9400.4560.5120.3550.2530.6470.6950.878
grid0.6190.7080.7170.8100.9960.8400.8590.5820.2280.1250.1070.8490.8190.865
leather0.8410.8420.4160.8821.0000.9710.9920.8190.4460.3060.3080.5610.8190.959
tile0.4170.7940.6900.9910.9870.9940.9900.8970.8220.7220.7790.1750.9120.881
wood0.6110.8340.9520.9770.9300.9980.9920.7270.5020.3360.4110.6050.7250.848
Objectsbottle0.7440.8920.8180.9900.9990.9900.9910.9100.8980.8500.4950.8340.9180.888
cable0.7830.7570.6850.8620.8190.9590.9710.8250.8060.4310.5130.4780.8650.937
capsule0.6700.7320.5940.8610.8840.8690.8750.8620.6310.5540.3870.8600.9160.879
hazelnut0.3590.7850.7620.9310.8330.9930.9940.9170.8610.6160.6980.9160.9370.886
metal nut0.8130.7000.6790.8200.8850.9610.9620.8300.7050.3190.3510.6030.8950.869
pill0.6300.7430.8060.8790.8380.8880.9010.8930.7250.5440.5140.8300.9350.930
screw0.5000.7460.9990.5490.8450.9630.9750.7540.6040.6440.5500.8870.9280.954
toothbrush0.9720.6530.7810.9531.0000.9861.0000.8220.6750.5380.3370.7840.8630.877
transistor0.8690.7920.7410.8180.9090.9110.9440.7280.6800.4960.3990.7250.7010.926
zipper0.8200.7450.5840.9190.9810.9510.9860.8390.5120.3550.2530.6650.9330.936
Mean0.6720.7620.7090.8770.9170.9490.9580.7910.6400.4790.4230.6940.8570.901
+ +Table 2. Comparison the methods of image-level anomaly classification on the MTD dataset. + +
MethodGeoTransGANomalyDSEBMADGANOCSVM1-NNDifferNetMetaformer
mAUC0.7550.7660.5720.4640.5870.8000.9770.993
+ +anomaly localization, we use the per-region-overlap (PRO) metric proposed by Bergmann et al. [6]. We follow [5] to compute the PRO value that scans over false-positive rates by increasing the thresholds to keep the false-positive rates within the range $[0, 0.3]$ . The main property of the PRO metric is that the weights for each overlap region are equal. Hence, the localization that is only focusing on the large regions will be penalized. + +# 4.1. Anomaly Classification + +In the image-level anomaly classification task, we compare our model to GeoTrans [13], GANomaly [2], DSEBM [36], US [5], RIAD [35], and DifferNet [28]. + +The left part in Table 1 shows the comparison results of anomaly classification on the MVTec AD dataset. As seen in Table 1, our model outperforms the other state-of-the-art models in seven classes and matches in the toothbrush category. Recent works involve MTD for AD problems with proper data splits. We follow the setting described in [28] to form training/testing splits. Our mean AUC, as shown in Table 2, achieves new art on both MVTec AD and MTD, improving around $1\%$ and $1.6\%$ , respectively. + +# 4.2. Anomaly Localization + +We consider the AD methods in the PRO metric for the pixel-level anomaly localization task, including $\ell_2$ -AE [4], 1-NN [23], OCSVM, K-Means, SSIM-AE, and US [5]. The results we compared are all reported by [5]. + +The right part in Table 1 shows the comparison results of anomaly localization on the MVTec AD dataset. In particular, $p = 65$ is the hyperparameter of receptive field size for training the teacher network in US. As shown in Ta + +ble 1, Metaformer achieves the highest score in nine classes, which implies that Metaformer can detect both small and large defects better. Besides, our method improves the current score by about $4.4\%$ . + +# 4.3. Ablation Study + +Model Configuration To verify the effectiveness of each module in the Metaformer, we consider three model configurations, i.e., autoencoder $(\mathcal{A})$ , autoencoder with a generator $(\mathcal{A} + \mathcal{P})$ , and the full Metaformer model $(\mathcal{A} + \mathcal{P} + \mathcal{T})$ . Table 3 shows the ablation study on these configurations. All the three model configurations are trained in our meta-learning strategy, as shown in Algorithm 1. Precisely, the reconstruction errors of the configuration $(\mathcal{A})$ are merely derived from the stand-alone autoencoder. The configuration $(\mathcal{A} + \mathcal{P})$ employs the additional instance-prior yet directly affects the reconstructed image $\tilde{I}$ using the element-wise multiplication. Our full Metaformer model $(\mathcal{A} + \mathcal{P} + \mathcal{T})$ employs the transformer to reformulates the instance-prior concerning the reconstructed image $\tilde{I}$ before such the element-wise multiplication. The full model obtains the best score in all categories and further enhances the mean PRO score by $1.8\%$ compared to $(\mathcal{A} + \mathcal{P})$ . Besides, the result shows that all the modules bring positive contributions, and using such the instance-prior helps the AD task as demonstrated on the performance improvement from $1.9\%$ to $3.7\%$ mPRO metric. + +Few-shot Scenario As we mentioned in the introduction, the edge devices for deploying the AD systems prefer the fast model adaptation in real-world AD applications. Intuitively, an AD model using fewer supporting examples for + +Table 3. Effect of each module in the proposed Metaformer. + +
CategoryModel Configuration
AA + PA + P + T
Texturescarpet0.8520.8770.878
grid0.8440.8520.865
leather0.9010.9400.959
tile0.8500.8610.881
wood0.7970.8240.848
Objectsbottle0.8520.8560.888
cable0.8800.9140.937
capsule0.8610.8780.879
hazelnut0.8400.8510.886
metal_nut0.8170.8460.869
pill0.9170.9150.930
screw0.9410.9430.954
toothbrush0.8470.8640.877
transistor0.8280.8860.926
zipper0.9390.9350.936
mPRO0.8640.8830.901
+ +![](images/de595c585db01fd15d6dbae7470c145faa2b5558e31d81f25f24514df006513b.jpg) +Figure 4. Effect of available supporting examples on model's performance. The green and the blue lines indicate the mAUC values (given by the left y-axis) of Metaformer and DifferNet for various k-shot settings, respectively. The yellow dotted line shows the mAUC differences (by the right y-axis) between the two methods. + +its model adaptation shows the lower cost of model training or training-data collection. Here we experiment with a few-shot configuration on MVtec AD dataset to discuss such a model adaption issue. The main AD competitor is DifferNet in this experiment, and we reproduce its results of the few-shot setting with its released code. Figure 4 shows the experimental results, in which each k-shot indicates that there are only $k$ supporting images available for model training. In Figure 4, our Metaformer outperforms DifferNet in all numbers of $k$ , especially the performance gap is more noticeable when using fewer supporting examples. The results demonstrate that our model shows the robust ability of the few-shot model adaptation for dealing with the AD task. + +# 4.4. Visualization + +The visualization for qualitative analysis with the corresponding instance-prior is presented in Figure 5. We show + +![](images/bab6365b8d4fa746ebcc6e2c8f9f75a24b1eb03a93a5617a79c00964015368d0.jpg) +Figure 5. Qualitative results of the proposed Metaformer. (a) The selected images from the MVTec AD dataset. (b) The instances-priors obtained by the generator $\mathcal{P}$ . (c) The thresholded predictions from Metaformer. (d) The ground-truths. + +that the response map $R$ provides a compelling clue that enhances the reconstruction in focal regions. On the other hand, the Metaformer is trained with a wild dataset consisting of various anomaly-free images. Our method, therefore, can reconstruct various low-level features and manifest abnormal regions. We provide some failure cases in the supplementary material for more discussions. + +# 5. Conclusion + +We have presented our universal Metaformer trained via unsupervised meta-learning to tackle the two common issues existing in most previous reconstruction-based AD methods, i.e., model adaptation and reconstruction gap. Rather than maintaining one specific model per image category as other AD methods, our Metaformer resolves the model adaptation issue by an unsupervised meta-learning strategy to learn one universal model. With such a universal model, our Metaformer is able to tackle a novel category via few-shot fine-tuning. To deal with the reconstruction gap issue for precisely localizing the abnormal regions, our Metaformer employs an instance-aware transformer to leverage the instance-priors for guiding the image reconstruction. With such guidance, the autoencoder can focus on the instance area for precisely reconstructing its detail regions. The experimental results on the MVTec AD dataset show the notable performance gain over current state-of-the-art methods, demonstrating that our Metaformer can detect real-world anomaly images for industrial inspection. + +Acknowledgement. This work was supported in part by the MOST grants 110-2634-F-001-009 and 110-2221-E-001-017 of Taiwan. We are grateful to National Center for High-performance Computing for providing computational resources and facilities. + +# References + +[1] Davide Abati, Angelo Porrello, Simone Calderara, and Rita Cucchiara. Latent space autoregression for novelty detection. In CVPR, pages 481-490, 2019. 2 +[2] Samet Akcay, Amir Atapour-Abarghouei, and Toby P Breckon. Ganomaly: Semi-supervised anomaly detection via adversarial training. In ACCV, pages 622–637. Springer, 2018. 2, 6, 7 +[3] Samet Akçay, Amir Atapour-Abarghouei, and Toby P Breckon. Skip-ganomaly: Skip connected and adversarially trained encoder-decoder anomaly detection. In IJCNN, pages 1-8. IEEE, 2019. 2 +[4] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection. In CVPR, pages 9592-9600, 2019. 2, 6, 7 +[5] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Uninformed students: Student-teacher anomaly detection with discriminative latent embeddings. In CVPR, pages 4183–4192, 2020. 1, 2, 3, 6, 7 +[6] Paul Bergmann, Sindy Löwe, Michael Fauser, David Sattlegger, and Carsten Steger. Improving unsupervised defect segmentation by applying structural similarity to autoencoders. In VISAPP, pages 372-380. SciTePress, 2019. 7 +[7] Philippe Burlina, Neil Joshi, and I-Jeng Wang. Where's wally now? deep generative and discriminative embeddings for novelty detection. In CVPR, June 2019. 2 +[8] Ding-Jie Chen, Jui-Ting Chien, Hwann-Tzong Chen, and Tyng-Luh Liu. Unsupervised meta-learning of figure-ground segmentation via imitating visual effects. In AAAI, volume 33, pages 8159-8166, 2019. 3, 6 +[9] Ming-Ming Cheng, Niloy J. Mitra, Xiaolei Huang, Philip H. S. Torr, and Shi-Min Hu. Global contrast based salient region detection. IEEE Trans. Pattern Anal. Mach. Intell., 37(3):569-582, 2015. 6 +[10] Marcella Cornia, Matteo Stefanini, Lorenzo Baraldi, and Rita Cucchiara. Meshed-memory transformer for image captioning. In CVPR, pages 10578-10587, 2020. 3 +[11] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, pages 1126–1135, 2017. 3 +[12] Chelsea Finn, Aravind Rajeswaran, Sham M. Kakade, and Sergey Levine. Online meta-learning. In ICML, pages 1920-1930, 2019. 3 +[13] Izhak Golan and Ran El-Yaniv. Deep anomaly detection using geometric transformations. In NeurIPS, pages 9758-9769, 2018. 2, 7 +[14] Dong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha, Moussa Reda Mansour, Svetha Venkatesh, and Anton van den Hengel. Memorizing normality to detect anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection. In ICCV, pages 1705-1714, 2019. 2 +[15] Saeed Hosseinzadeh Hanzaei, Ahmad Afshar, and Farshad Barazandeh. Automatic detection and classification of the ceramic tiles' surface defects. Pattern Recognit., 66:174-189, 2017. 1 + +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, June 2016. 4 +[17] Yibin Huang, Congying Qiu, and Kui Yuan. Surface defect saliency of magnetic tile. Vis. Comput., 36(1):85-96, 2020. 6 +[18] Bowen Jiang, Lihe Zhang, Huchuan Lu, Chuan Yang, and Ming-Hsuan Yang. Saliency detection via absorbing markov chain. In ICCV, pages 1665-1672, 2013. 3 +[19] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521-3526, 2017. 3 +[20] Xiaohui Li, Huchuan Lu, Lihe Zhang, Xiang Ruan, and Ming-Hsuan Yang. Saliency detection via dense and sparse reconstruction. In ICCV, pages 2976-2983, 2013. 3 +[21] Justin Liang, Namdar Homayounfar, Wei-Chiu Ma, Yuwen Xiong, Rui Hu, and Raquel Urtasun. Polytransform: Deep polygon transformer for instance segmentation. In CVPR, pages 9131-9140, 2020. 3 +[22] Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Gradient-based hyperparameter optimization through reversible learning. In ICML, pages 2113-2122, 2015. 3 +[23] Tiago S Nazare, Rodrigo F de Mello, and Moacir A Ponti. Are pre-trained cnns good feature extractors for anomaly detection in surveillance videos? arXiv preprint arXiv:1811.08495, 2018. 7 +[24] Pramuditha Perera, Ramesh Nallapati, and Bing Xiang. Ocean: One-class novelty detection using gans with constrained latent representations. In CVPR, pages 2898-2906, 2019. 1, 2 +[25] Stanislav Pidhorskyi, Ranya Almohsen, and Gianfranco Doretto. Generative probabilistic novelty detection with adversarial autoencoders. In NeurIPS, pages 6822-6833, 2018. 2 +[26] Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In ICML, pages 1530-1538, 2015. 3 +[27] Leo Sampaio Ferraz Ribeiro, Tu Bui, John Collomosse, and Moacir Ponti. Sketchformer: Transformer-based representation for sketched structure. In CVPR, pages 14153-14162, 2020. 3 +[28] Marco Rudolph, Bastian Wandt, and Bodo Rosenhahn. Same same but differnet: Semi-supervised defect detection with normalizing flows. In WACV, Jan. 2021. 1, 2, 3, 6, 7 +[29] Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Müller, and Marius Kloft. Deep one-class classification. In ICML, pages 4393-4402, 2018. 2 +[30] Thomas Schlegl, Philipp Seebock, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In IPMI, pages 146-157. Springer, 2017. 2 + +[31] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pages 5998-6008, 2017. 3, 6 +[32] Shashanka Venkataramanan, Kuan-Chuan Peng, Rajat Vikram Singh, and Abhijit Mahalanobis. Attention guided anomaly localization in images. In ECCV, pages 485-503, 2020. 2, 3 +[33] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004. 4, 5 +[34] Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In CVPR, pages 5791-5800, 2020. 3 +[35] Vitjan Zavrtanik, Matej Kristan, and Danijel Skçaj. Reconstruction by inpainting for visual anomaly detection. Pattern Recognition, page 107706, 2020. 1, 2, 7 +[36] Shuangfei Zhai, Yu Cheng, Weining Lu, and Zhongfei Zhang. Deep structured energy based models for anomaly detection. In ICML, pages 1100-1109, 2016. 2, 7 +[37] Jing Zhang, Tong Zhang, Yuchao Dai, Mehrtash Harandi, and Richard Hartley. Deep unsupervised saliency detection: A multiple noisy labeling perspective. In CVPR, pages 9029-9038, 2018. 3 +[38] Ting Zhao and Xiangqian Wu. Pyramid feature attention network for saliency detection. In CVPR, pages 3085-3094, 2019. 3 +[39] Kang Zhou, Yuting Xiao, Jianlong Yang, Jun Cheng, Wen Liu, Weixin Luo, Zaiwang Gu, Jiang Liu, and Shenghua Gao. Encoding structure-texture relation with p-net for anomaly detection in retinal images. In ECCV, volume 12365, pages 360-377. Springer, 2020. 1, 3 \ No newline at end of file diff --git a/learningunsupervisedmetaformerforanomalydetection/images.zip b/learningunsupervisedmetaformerforanomalydetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a83ea1ee2c78af46db0274bb9fc66e8e9e2e4349 --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5282b2d82c55a3fa66931956b97db5cce6221c9110019beb2b3ebd412a34cccd +size 473775 diff --git a/learningunsupervisedmetaformerforanomalydetection/layout.json b/learningunsupervisedmetaformerforanomalydetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f7c7539d9ae5d583c3816387a2925601fc878d11 --- /dev/null +++ b/learningunsupervisedmetaformerforanomalydetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68b64c10d3e3a39b70e57acefe3c998f29bfd18c5a7d8e6f2e64f96c3c1ff09d +size 373313 diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_content_list.json b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a0db565ddeddbdaddb4b87ebd93ce3a7a83a4199 --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef943a61c9c04ff58f71825aab691716de226195c4c058f567623c9366a025e2 +size 77863 diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_model.json b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3bb0aaf374937b11c068f585b1d87986bfd58021 --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58d09514b0191eb498fb28c482459e4a2d43f1b73339e0faf07e6745a222070d +size 98926 diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_origin.pdf b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3822c54ae4c471046b4280cbc12cc8fbd075b231 --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/401b7e25-62eb-4227-b3de-49508c3dbf6f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63eb46451cd3aaa0596cfa454efd94ce44f48c05a1461585d0b83cf8e20b5744 +size 2115015 diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/full.md b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0734d941564704687c20886532f00baf4b280eab --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/full.md @@ -0,0 +1,346 @@ +# Learning with Memory-based Virtual Classes for Deep Metric Learning + +Byungsoo Ko\* Naver/LINE Vision + +kobiso62@gmail.com + +Geonmo Gu‡ +NAVER/LINE Vision + +korgm403@gmail.com + +Han-Gyu Kim +NAVER Clova Speech + +hangyu.kim@navercorp.com + +# Abstract + +The core of deep metric learning (DML) involves learning visual similarities in high-dimensional embedding space. One of the main challenges is to generalize from seen classes of training data to unseen classes of test data. Recent works have focused on exploiting past embeddings to increase the number of instances for the seen classes. Such methods achieve performance improvement via augmentation, while the strong focus on seen classes still remains. This can be undesirable for DML, where training and test data exhibit entirely different classes. In this work, we present a novel training strategy for DML called MemVir. Unlike previous works, MemVir memorizes both embedding features and class weights to utilize them as additional virtual classes. The exploitation of virtual classes not only utilizes augmented information for training but also alleviates a strong focus on seen classes for better generalization. Moreover, we embed the idea of curriculum learning by slowly adding virtual classes for a gradual increase in learning difficulty, which improves the learning stability as well as the final performance. MemVir can be easily applied to many existing loss functions without any modification. Extensive experimental results on famous benchmarks demonstrate the superiority of MemVir over state-of-the-art competitors. Code of MemVir is publicly available1. + +# 1. Introduction + +Deep metric learning (DML) is of great importance for learning visual similarities in a wide range of vision tasks, such as image clustering [17], unsupervised learning [4, 15, 5], and image retrieval [43, 10, 24, 12]. Learning visual similarity aims to build a well-generalized embedding space that reflects visual similarities of images using a defined distance metric. Typically, training and test data exhibit entirely different classes in DML. Thus, the main challenge is to maximize generalization performance from a training distribution to a shifted test distribution, which differs from classic classification tasks that deal with i.i.d. + +Figure 1. In conventional training, the loss function is computed with actual classes. On the other hand, in MemVir, classes from previous steps (virtual classes) are used to compute the loss function along with the actual classes. Moreover, the number of classes and embeddings are gradually increased by adding virtual classes, where $C$ and $B$ denote number of classes and batch size, $N$ and $M$ are hyperparameters for MemVir. +![](images/ede00177aaf59de64db306a6a0df59b51afc30ffc120b3a09866ec1dcc1fa999.jpg) +$\bullet \triangle$ : embeddings of $\bullet, \triangle$ classes +: actual class from current step $t$ +virtual classes from past steps $t - (M + 1)$ $t - 2(M + 1)$ + +training and test distributions [31, 37]. + +Current DML approaches focus on learning visual similarities with objective functions, which considers pairwise similarity (pair-based losses) [6, 38, 46] or similarity between samples and class representatives (proxy-based losses) [41, 40, 28, 7, 42]. Recent studies propose exploiting additional embeddings from past training steps, which are saved and controlled in the memory queue, to increase the number of samples in a mini-batch and that of hard negative pairs [15, 5, 45, 22]. And yet, these methods of utilizing past embeddings is still constrained to the seen classes of the training data. Thus, the trained model might result to over-fit to the seen classes while under-perform on the unseen classes in test data. Therefore, to learn an embedding space that generalizes, we need to alleviate the strong focus on seen classes during the training phase [37, 31, 30]. + +In this paper, we propose a novel training strategy, which trains a model with Memory-based Virtual classes (MemVir), for DML. In MemVir, we maintain memory queues for both class weights and embedding features. Instead of using them to increase the number of instances of seen classes, they are treated as virtual classes to compute the loss function along with the actual classes, as illustrated in Figure 1. Moreover, we incorporate the idea of curriculum learning (CL) to gradually increase the learning difficulty by slowly adding virtual classes. The proposed MemVir has the following advantages: 1) MemVir trains a model with augmented information, which includes increased number of classes $(C\rightarrow (N + 1)C)$ and instances $(B\to (N + 1)B)$ without additional feature extraction. 2) CL-like gradually increasing the learning difficulty improves the optimization stability and final performance. 3) Exploiting virtual classes help achieve more generalized embedding space by alleviating excessively strong focus on seen classes of training data. 4) MemVir can be easily applied to many existing loss functions to obtain a significant performance boost without any modification of the loss function. + +Contributions. 1) We propose a novel training strategy for DML that exploits past embeddings and class weights as virtual classes to improve generalization. We further improve the training process and performance by incorporating the idea of CL. 2) We exhaustively analyze our proposed method and demonstrate that employing virtual classes improves generalization by alleviating a strong focus on seen classes theoretically and empirically. 3) MemVir achieves state-of-the-art performance on three popular benchmarks of DML in both conventional and Metric Learning Reality Check (MLRC) [33] evaluation protocol. + +# 2. Related Work + +Sample Generation and Memory-based Learning. In DML, the generation of hard samples has been investigated to perform training with more informative samples [8, 49, 12, 24]. DAML [8] and HDML [49] utilize generative networks to generate synthetic samples, while Symm [12] and EE [24] generate synthetic samples by geometric relations. Meanwhile, utilizing information from previous steps has been explored in many computer vision tasks [15, 5, 45, 22]. In supervised DML, XBM [45] is proposed to use memorized embeddings for extending negative samples in pair-based losses. In XBM, the state difference between past and current embeddings is disregarded based on "slow drift" phenomena. On the other hand, [22] argues that a large accumulated error caused by the state difference may degrade the training process. They present BroadFace method for softmax variant losses to control the error by compensating the state difference and gradient control. The above-mentioned methods focus on utilizing gen + +erated or memorized information with respect to increasing the number of instances for the seen classes. However, this may result in a model overly optimized to the seen classes while under-performing on the unseen classes in test data. Rather than disregarding or controlling the state difference, the proposed MemVir exploits the state difference by employing the memorized embeddings and class weights as virtual classes, which are treated as different classes from the actual (seen) classes. The exploitation of virtual classes helps achieve more generalized embedding space by alleviating a strong focus on seen classes. Additional comparison with XBM w.r.t "slow drift" phenomena is included in supplementary Section B.2. + +Virtual Class. In image recognition task, Virtual softmax [3] has been presented to enhance the discriminative property of embeddings by injecting a virtual class into the softmax loss. However, it is not only limited by a single virtual class but also cannot be used with softmax variants using $l_{2}$ -normalization. In comparison, MemVir exploits multiple virtual classes and can be used with any softmax variants and proxy-based losses. + +**Curriculum Learning.** CL in machine learning is motivated by the idea of curriculum in human learning, where the models learn from easier samples first and more difficult samples later. Imposing CL for model training has been shown to accelerate and improve the training process in many machine learning tasks [1, 47, 13, 18]. When exploiting CL, two key factors have to be considered: (1) Scoring the difficulty of each sample; (2) scheduling the pace by which the sample is presented to the network. To define the difficulty, bootstrapping and transfer learning have been used to score the difficulty of each sample [47, 13]. For scheduling, the samples to be presented to the network can be determined in fixed or adaptive steps [47, 18]. The main difference between conventional CL and MemVir is the former schedules within the training data, whereas the latter (MemVir) increases the learning difficulty with virtual classes, which are augmented information. + +# 3. Proposed Method + +# 3.1. Preliminary + +We define a deep neural network as $f: \mathcal{I} \to \mathcal{X}$ , which is a mapping from an input data space $\mathcal{I}$ to an embedding space $\mathcal{X}$ . Let $X = [x_{1}, x_{2}, \ldots, x_{H}]$ denote the $D$ -dimensional embedding features, and each feature $x_{i}$ has a corresponding label $y_{i} \in \{1, \ldots, C\}$ . The generalized form of the objective function can be written as follows: + +$$ +\mathcal {L} (X, W) = - \frac {1}{| X |} \sum_ {i = 1} ^ {| X |} l \left(x _ {i}, y _ {i}\right), \tag {1} +$$ + +where $W$ denotes the class weights, and $l(\cdot)$ can be any of the loss functions defined below. + +![](images/da6084c44ed07719f030ed4bcc345af9b99931e378668a7d3246e03f7d4320ae.jpg) +Figure 2. Overview of MemVir. Past embeddings and class weights queues are maintained. We select $N$ steps of past embeddings and weights with margin $M$ in between the selected steps, and use them as additional virtual classes along with actual classes for loss computation. + +The most widely used classification loss function, softmax loss, has been revalued as a competitive objective function in metric learning [48, 2]. The softmax loss is used to optimize the network $f$ and class weight $W$ : + +$$ +l _ {\text {s o f t m a x}} \left(x _ {i}, y _ {i}\right) = \log \frac {e ^ {W _ {y _ {i}} ^ {T} x _ {i}}}{\sum_ {j = 1} ^ {C} e ^ {W _ {j} ^ {T} x _ {i}}}, \tag {2} +$$ + +where $W_{j} \in \mathbb{R}^{D}$ denotes the $j$ -th column of weight $W \in \mathbb{R}^{D \times C}$ . The bias $b$ is set to 0 because it does not affect the performance [28, 7]. The weight $W_{j}$ is the center of each class [7, 42] and serves as a representative. + +For improved performance and better interpretation, [41, 40, 28] proposes to normalize weights and embedding features to lay them on a hypersphere with a fixed radius. We perform $l_{2}$ -normalization to fix the size of the weights and embedding features to the following: $\| W_j\| = 1$ and feature $\| x_i\| = 1$ . Subsequently, we can simplify the logits [35] by transforming $W_j^T x_i = \| W_j\| \| x_i\| \cos \theta_j = \cos \theta_j$ , and define the Norm-softmax loss as follows: + +$$ +l _ {n o r m} \left(x _ {i}, y _ {i}\right) = \log \frac {e ^ {\gamma \cos \theta_ {y _ {i}}}}{e ^ {\gamma \cos \theta_ {y _ {i}}} + \sum_ {j = 1 , j \neq y _ {i}} ^ {C} e ^ {\gamma \cos \theta_ {j}}}, \tag {3} +$$ + +where $\gamma$ is a scale factor. The proposed method MemVir can be used with softmax variants as well as proxy-based losses because a proxy is a class representative feature much like class weights of softmax variants. Hence, we include the details of other loss functions (CosFace [42], ArcFace [7], CurricularFace [18], Proxy-NCA [32], and ProxyAnchor [21]) in supplementary Section A. + +# 3.2. Learning with Memory-based Virtual Classes + +We propose a novel training strategy called MemVir, which trains a model with virtual classes from past steps + +to exploit augmented information and obtain better generalization. When conventional metric learning trains a model with given $C$ classes and $B$ embeddings from training data, MemVir gradually increases the number of classes $(C \rightarrow (N + 1)C)$ and embeddings $(B \rightarrow (N + 1)B)$ with the virtual classes. We use the naming convention of MemVir( $N, M$ ), which indicates the hyper-parameters of the proposed method, to be defined below. + +Queuing Past Embeddings and Weights. To form a class in loss computation, a pair of the class representative feature (weight) and embedding features are required. Hence, in MemVir, we maintain two types of memory queues: embedding queue $\mathbb{E}$ and weight queue $\mathbb{W}$ , where each entity of the queues is a collection of embeddings or class weights of each step as illustrated in Figure 2. For each step, the collection of embeddings $X$ and weights $W$ are enqueued to $\mathbb{E}$ and $\mathbb{W}$ , respectively. The size of each queue is determined as $N(M + 1)$ , where $N$ is the number of selected steps to use for the loss computation, and $M$ is the margin between the selected steps. The shape and position of class clusters vary by each step because the network parameters change during training process. Such variance between steps is utilized in MemVir by exploiting weights and embeddings from previous steps as virtual classes. Here, the difference between the selected steps can be controlled by the margin $M$ . + +Scheduling Usage of Virtual Classes. In MemVir, virtual classes will be utilized to gradually increase learning difficulty as CL. The scheduling of virtual class usage includes two periods: warm-up and step-pacing. We turn on MemVir and begin managing queues after the warm-up step $U$ (epoch $U_{e}$ ), because the embeddings of the initial phase are typically scattered without forming clusters, + +Algorithm 1: Pseudo-code of MemVir +// $f$ encoder network // weight/embed_queue: weight and embedding memory queue // $U_{e}$ ,N,M: warm-up epoch,number of steps, margin +1 for input, label in loader do +2 embed $=$ f.forward(input) +3 weight $=$ f.get_class_weight() //Turn on MemVir when it is in use and past warm-up epoch +4 if MemVir is True and epoch $\geq U_{e}$ then +5 cur_weight $=$ weight.copy() +6 cur_embedding $=$ embed.copy() +7 cur_label $=$ label.copy() // Prepare embeddings and weights by step-pacing // The order of each queue is from new to old +8 if len(weight_queue) $>$ M then +9 for idx in range(M, len(weight_queue),M+1) do +10 pre_weight $=$ weight_queue[idx] +11 pre_embedding,pre_label $=$ embed_queue[idx] // Create new label indices for virtual classes +12 new_label $=$ create_new_label(pre_label) +13 weight_concatenate(weight,pre_weight) +14 embed_concatenate(embed,pre_embedding) +15 label_concatenate.label, new_label) +16 end +// Update memory queues +17 enqueue(weight_queue,cur_weight) +18 enqueue(embed_queue,(cur_embedding,cur_label)) +19 if len(weight_queue)>N(M+1)then +20 deque(weight_queue) +21 deque(embed_queue) +// Compute loss and back-propagation +22 loss $=$ compute_loss(weight,embed, label) +23 loss.Backward() +24 optimizerstep() +end + +which can be a distraction for training. It is noteworthy that we use MemVir without learning rate decay because decaying the learning rate changes the difference between steps; thus, the learning rate decay can be used with a modification of hyper-parameter $M$ of MemVir. After the warm-up, the step-pacing algorithm takes place by storing embeddings and weights of each step in their respective queues and reusing them for loss computations, as described in Algorithm 1. As the queue size grows, previously stored embeddings and weights from every $M + 1$ steps are selected as virtual classes when computing the loss at each step. The number of selected steps for virtual classes would increase gradually from 0 to $N$ determined by current queue size. This results in increasing the number of classes by a staircase function, and the function $s$ of the number of classes can be written as: + +$$ +s (i) = \left\{ \begin{array}{l l} C, & i < U, \\ C \times \left\{\min \left(\left\lfloor \frac {i - U}{M + 1} \right\rfloor , N\right) + 1 \right\}, & i \geq U, \end{array} \right. \tag {4} +$$ + +where $i$ denotes the current step. The scheduling function of MemVir is illustrated by the red line in Figure 3a. + +![](images/7909e7764cc0c56d601d414594f0223578bc3934e3258bc5d1bab98f3be9e7f4.jpg) +(a) Different ways of scheduling. + +![](images/4eb7889044cefe089ac24e3ccbcc8a42590acbb8bc765d340e8a5c5de784ed94.jpg) +(b) Performance by scheduling. +Figure 3. Impact of scheduling. (a) Different ways of scheduling for adding virtual classes. (b) Performance of each scheduling case with MemVir(5,100) and Norm-softmax as baseline on CARS196. + +Learning with Multiple Virtual Classes. When we select $N$ steps of past embeddings and weights from the queues, it indicates that we have $NC$ virtual classes. We denote the set of selected past embeddings and weights as $\widetilde{X}$ and $\widetilde{W}$ , respectively. Subsequently, we compute the objective function with virtual classes as follows: + +$$ +\mathcal {L} (X \cup \widetilde {X}, W \cup \widetilde {W}) = - \frac {1}{| X \cup \widetilde {X} |} \sum_ {i = 1} ^ {| X \cup \widetilde {X} |} l \left(x _ {i}, y _ {i}\right), \tag {5} +$$ + +where $l(\cdot)$ can be any type of loss function. The implementation of MemVir is simple without any modification of the loss function, and it gives a significant performance improvement in DML without any additional computational cost in the inference phase. + +# 3.3. Discussion and Analysis + +# 3.3.1 Analysis of Scheduling + +Figure 3 shows the different ways of scheduling and the performance of each case. In Figure 3a, when the MemVir is turned on at warm-up step $U$ , it begins adding virtual classes after each $M + 1$ step, gradually. Compared with MemVir, 'w/o warm-up' starts adding virtual classes from the initial steps, whereas 'w/o step-pacing' adds all virtual classes at once after warm-up step $U$ . For the case of 'w/o warm-up', training starts with degraded performance, but finally, the performance is higher than the baseline. In fact, embeddings from virtual classes at the initial steps would be scattered without forming clusters; thus, it can be a distraction at the initial steps. Meanwhile, 'w/o step-pacing' exhibits a slight performance degradation immediately after warm-up step $U$ . This is because placing $NC$ number of virtual classes simultaneously can be too difficult for training the model. By considering both cases, MemVir is able to increase the training difficulty gradually for a more stable optimization. + +![](images/4409edc5c018245070a21a9654ca0c2b8cf7686dac767a7fb458ef125e3eb2ba.jpg) +(a) Difficulty by margin. + +![](images/3f03960ed38cbac9d4e19da2e97d9dce78333e166e47eaf7699075b1ebaaa8b3.jpg) +(b) Difficulty by number of steps. +Figure 4. Impact of difficulty with Norm-softmax as baseline on CARS196. Difficulty is measured by loss value of each step. (a) Difficulty by varying margin parameter $M$ with a fixed number of steps $N = 1$ . (b) Difficulty by varying the number of steps $N$ with a fixed margin of $M = 100$ . + +# 3.3.2 Analysis of Difficulty + +MemVir controls learning difficulty via following hyperparameters: number of steps $N$ and margin $M$ . To see the impact of learning difficulty by each hyper-parameter, we measure the difficulty with the loss value by following [27, 47]. As shown in Figure 4a, a smaller margin of $M$ results in greater difficulty, which is obvious because the embeddings from the recent steps would be similar to the embeddings from the current steps. Furthermore, Figure 4b shows that adding more virtual classes increases the learning difficulty. It is noteworthy that the loss value increases slowly after warm-up step $U$ by adding virtual classes gradually (step-pacing); subsequently, it starts decreasing after reaching a peak. The detailed performance by different hyper-parameters is presented in Section 4.4. + +# 3.3.3 Gradient Analysis for Generalization + +Considering the distribution shift in training and test data, strong focus on seen classes has to be alleviated in the generalization of transfer learning problems such as DML [37, 31, 30]. To demonstrate how MemVir works in generalizing models during training, we have analyzed the gradient of the softmax loss. For convenient analysis, the softmax loss in Equation 2 is re-written as follows: + +$$ +l _ {\text {s o f t m a x}} \left(x _ {i}, y _ {i}\right) = \log \frac {e ^ {\alpha \left(x _ {i} , y _ {i}\right)}}{\sum_ {j = 1} ^ {C} e ^ {\alpha \left(x _ {i} , j\right)}}, \tag {6} +$$ + +where $\alpha (x_i,j) = W_j^T x_i$ . The gradient of the softmax loss over the embedding feature $x_{i}$ can be inducted as follows: + +$$ +\begin{array}{l} \frac {\partial l _ {s o f t m a x} \left(x _ {i} , y _ {i}\right)}{\partial x _ {i}} = W _ {y _ {i}} - \frac {\sum_ {j = 1} ^ {C} e ^ {\alpha \left(x _ {i} , j\right)} W _ {j}}{\sum_ {j = 1} ^ {C} e ^ {\alpha \left(x _ {i} , j\right)}} \\ \approx W _ {y _ {i}} - \frac {e ^ {\alpha (x _ {i} , y _ {i})} W _ {y _ {i}}}{\sum_ {j = 1} ^ {C} e ^ {\alpha (x _ {i} , j)}} \\ = \tau W _ {y _ {i}}, \tag {7} \\ \end{array} +$$ + +![](images/6519bfd0a264adc23b498eeae29da9b0abf591374d3191254cde72ba9e19e5a1.jpg) +(a) Cosine similarity $(x_{i},W_{y_{i}})$ + +![](images/6e5f2e5fcfec4165f135cdef761bab07301f5c539b3422d66e42625c1f8df068.jpg) +(b) Generalization performance. + +![](images/51b1c03439ca1a4d9b956fb1f3b46d896c3773cfcd557accd3d351325178fb0c.jpg) +Figure 5. Generalization analysis with Norm-softmax as baseline on CARS196. (a) Similarity between embeddings and corresponding class weights of seen classes in training data. (b) Performance on unseen classes in test data. +(a) Softmax loss. +Figure 6. Illustration of an embedding $(x_{i})$ and corresponding class weight $(W_{y_i})$ learning, where $W_{y_i^{(n)}}$ are virtual class weights originated from the class $y_{i}$ . + +![](images/a041a97e84dbdc67e88622387b2824fb4b65e0e995a74d4f2b0b89d87ee2a239.jpg) +(b) MemVir + softmax loss. + +$$ +\tau = 1 - \frac {e ^ {\alpha \left(x _ {i} , y _ {i}\right)}}{\sum_ {j = 1} ^ {C} e ^ {\alpha \left(x _ {i} , j\right)}}. \tag {8} +$$ + +It is obvious that $\tau > 0$ and $\tau \to 0$ when $x_{i} \to W_{y_{i}}$ , implying that $x_{i}$ tries to get as close to $W_{y_{i}}$ as possible, which is illustrated in Figure 6a. This can result in a strong focus on the target weight $W_{y_{i}}$ and an over-fit to the seen classes of the training data. + +In comparison, the gradient of MemVir + softmax loss over the embedding feature $x_{i}$ can be inducted as follows: + +$$ +\begin{array}{l} \frac {\partial l _ {M e m V i r} \left(x _ {i} , y _ {i}\right)}{\partial x _ {i}} = W _ {y _ {i}} - \frac {\sum_ {j = 1} ^ {(N + 1) C} e ^ {\alpha \left(x _ {i} , j\right)} W _ {j}}{\sum_ {j = 1} ^ {(N + 1) C} e ^ {\alpha \left(x _ {i} , j\right)}} \\ \approx \quad W _ {y _ {i}} - \frac {\sum_ {n = 0} ^ {N} e ^ {\alpha (x _ {i} , y _ {i} ^ {(n)})} W _ {y _ {i} ^ {(n)}}}{\sum_ {j = 1} ^ {(N + 1) C} e ^ {\alpha (x _ {i} , j)}} \\ = \tau_ {0} W _ {y _ {i}} + \sum_ {n = 1} ^ {N} \tau_ {n} W _ {y _ {i} ^ {(n)}}, \tag {9} \\ \end{array} +$$ + +$$ +\tau_ {0} = 1 - \frac {e ^ {\alpha \left(x _ {i} , y _ {i}\right)}}{\sum_ {j = 1} ^ {(N + 1) C} e ^ {\alpha \left(x _ {i} , j\right)}}, \tau_ {n} = - \frac {e ^ {\alpha \left(x _ {i} , y _ {i} ^ {(n)}\right)}}{\sum_ {j = 1} ^ {(N + 1) C} e ^ {\alpha \left(x _ {i} , j\right)}} \tag {10} +$$ + +where, $y_{i}^{(n)}(n > 0)$ are virtual classes and $y_{i}^{(0)} = y_{i}$ . It is obvious that $\tau_0 > 0$ . However, $\tau_0$ would not be close to zero whether $x_{i}$ is nearby $W_{y_i}$ or not, because the denominator + +(a) 50th epoch, # of classes $= C$ +![](images/6728e634c432938c487ddeeb539eb99de0f4acab23e863895941a41bd97380a4.jpg) +$\diamondsuit$ : Class weight, Embedding color (step): $\bullet$ (current) $\rightarrow$ $\bullet$ (-1(M+1)) $\rightarrow$ $\bullet$ (-2(M+1)) $\rightarrow$ $\bullet$ (-3(M+1)) $\rightarrow$ $\bullet$ (-4(M+1)) $\rightarrow$ $\bullet$ (-5(M+1)) + +![](images/49bb83ed17181c1531538b23d7e7019c586c488e81c5062d5c4850f19a10b594.jpg) +(b) 60th epoch, # of classes = 6C +Figure 7. t-SNE visualization of 512-dimensional embedding space. Embedding features are extracted by model trained with MemVir(5,100) on CARS196 training data. Each color indicates step for embedding features. + +![](images/3c2045af2685fe74c7fdffbe2bcbe8032c8db6e96d37dd35fdaf07aadb94f707.jpg) +(c) 200th epoch, # of classes = 6C + +of $\tau_0$ would be large as the virtual classes are close to $W_{y_i}$ . As illustrated in Figure 6b, this makes it difficult for $x_i$ to get highly close to $W_{y_i}$ and thus, alleviates the phenomenon of the embedding feature becoming extremely close to the target $W_{y_i}$ . In addition, because $\tau_n < 0$ , $x_i$ tries to get farther away from the virtual classes $W_{y_i^{(n)}}$ . Thus, the alleviation would be more extensive and can effectively ease the intense focus of the softmax loss, leading to a more substantial generalization. This is empirically shown in Figure 5. The baseline gradually increases the similarity between the embeddings and corresponding class weights. By contrast, when MemVir is turned on at step $U$ , the similarity is slightly degraded by alleviating the strong focus on the seen classes, and better generalization is achieved as shown in Figure 5b. The detailed induction is provided in the supplementary Section B.1. + +# 4. Experiments + +In this section, we conduct a series of experiments to analyze and validate the effectiveness of MemVir. Please refer to the supplementary material for additional experiments: analysis of memory and computational cost (Section D.1), impact of learning rate (Section D.2), impact of warm-up (Section D.3), robustness to input deformation (Section D.4), impact of embeddings and class weights in virtual class (Section D.6), and more. + +# 4.1. Experimental Setting + +We use three popular datasets for evaluation in DML: CUB-200-2011 (CUB200) [39], CARS196 [25], and Stanford Online Products (SOP) [34]. We perform two types of evaluation procedures: conventional evaluation and MLRC evaluation. Conventional evaluation is based on the common training and evaluation procedure described in [34, 21]. All experiments are conducted on an Inception network with batch normalization [20] and a 512-dimensional + +embedding feature. A batch size of 128, the Adam optimizer [23] with a learning rate of $10^{-4}$ , and warm-up epoch $U_{e} = 50$ are adopted unless otherwise noted in the experiment. Considering recent works [33, 9] that have proposed improved evaluation procedures for fairness, we include the MLRC evaluation protocol [33]. In MLRC evaluation, the procedure includes hyper-parameter search with 4-fold cross-validation, ensemble evaluation, and the usage of fair metrics (P@1, RP, and MAP@R). Please refer to supplementary Section C for details regarding the datasets and implementation. + +# 4.2. Embedding Space Visualization + +In Figure 7, we visualize the embedding space of the training data via t-SNE [29] to present how MemVir learns the embedding space. At the 50th epoch in Figure 7a, the model has been trained with only actual classes and obtains sparse embedding space with concentration on the actual classes. When all virtual classes are added at the 60th epoch in Figure 7b, virtual classes tend to be close to the actual classes and the embedding space is still sparse as in Figure 7a. This demonstrates that the model is not fully utilizing the embedding space and is highly focused on the seen classes. After enough epochs of training, at the 200th epoch in Figure 7c, the model obtains dense embedding space with sufficient discriminative power over all actual and virtual classes. To sum up, MemVir offers better utilization of embedding space by alleviating strong focus on seen classes for generalization. We include extended visualization in supplementary Section D.8. + +# 4.3. Impact of Batch Size and Number of Classes + +One advantage of MemVir is that it can utilize augmented information, including an increased number of embedding features and classes without additional feature extraction. To see the impact of the number of embedding + +![](images/adb125795715b7f90bd1631852ec2691985de1061576fc30df49dc31f3afa046.jpg) +(a) Impact of number of step $N$ +(b) Impact of number of classes. + +![](images/e4b72d6132c974242b9e6b60d8f2fa3b52d1105b74e69dcb3591781ec7db4cd6.jpg) +(b) Impact of margin $M$ + +![](images/c70e8922de3405a40a8be8c0dbc34efa0e8563b9409046c8da8f70b8e870e105.jpg) +(c) Impact of pair-wise interaction +Figure 8. We use fANOVA [19] to estimate the impact of hyper-parameters. Reported performances are predicted values from random forest of fANOVA, which is trained with experimental results of MemVir on CARS196. + +
Batch size81632641282565121024
Norm-softmax79.182.883.183.583.382.881.078.5
+ MemVir80.483.685.085.585.085.084.884.6
Diff+1.3+0.8+1.9+2.0+1.7+2.2+3.8+6.1
+ +(a) Impact of batch size. + +
Class ratio (%)102030405060708090100
Norm-softmax56.467.369.674.877.778.879.481.782.083.3
+ MemVir58.570.172.877.280.081.382.683.884.185.0
Diff+2.1+2.8+3.2+2.4+2.3+2.5+3.2+2.1+2.1+1.7
+ +Table 1. Impact of batch size and number of classes on CARS196 dataset. We report Recall@1(%) performance and underline when MemVir(1,100) exceeds the best performance of the baseline Norm-softmax. + +features and classes, we conduct experiments by varying the batch size and number of classes, where the training classes are randomly sampled by class ratio. As shown in Table 1a, the performance of the Norm-softmax baseline increases from the batch size of 8 to 64 and then decreases after, indicating that the increase in the batch size does not guarantee performance improvement [26, 11]. Applying MemVir to the baselines allows the models to learn with twice the number of embedding features by the virtual classes. MemVir yields performance improvement by $2.5\%$ on average and exceeds the best performance of the baseline of batch size 64 with the batch size of only 16. Moreover, we observe that using MemVir is more robust to performance degradation due to the large batch size. As shown in Table 1b, decreasing the class ratio degrades the performance of the Norm-softmax baseline from $83.3\%$ to $56.4\%$ . With MemVir, which doubles the number of classes with virtual classes, we observe that the performance increases by an average of $2.4\%$ and exceeds the best performance of the baseline with only $80\%$ of the classes. + +# 4.4. Impact of Hyper-parameters + +For hyper-parameter analysis, we use the fANOVA framework [19], which can estimate the pattern and importance of each hyper-parameter and pair-wise interaction. We report the hyper-parameter analysis of CUB200 and SOP as well as the details of the fANOVA in the supplementary Section C.3 and D.5. As illustrated in Figure 8, the performance on CARS196 improves as the number of steps $N$ increases. The performance improves until the margin $M = 20$ , and then stabilizes after a slight degradation. However, the patterns of the impact of the hyper-parameters differ for each dataset because the characteristics of each dataset and the number of classes are diverse. We observe two common patterns among all datasets. First, a margin $M$ larger than zero is typically better than $M = 0$ ; this is because classes from adjacent steps would be too similar to act as different classes and hence become distractions. Second, $N$ exceeding one is typically better than $N = 1$ . This is because by using more steps $N$ , the effect of CL can be exploited more effectively by scheduling addition of virtual classes with a longer time. + +# 4.5. Comparison with Related Methods + +We compare MemVir with related methods from image recognition task, including the virtual class (Virtual softmax [3]), the memory-based (BroadFace [22]), and the CL (CurricularFace [18]) methods. Also, we include XBM [45] from DML to compare with BroadFace. For a fair comparison, we follow the experimental setting of [22, 18], which consists of a stochastic gradient descent (SGD) optimizer, a learning rate of $5 \times 10^{-3}$ , a batch size of 512, and the ResNet50 backbone [16]. As presented in Table 3, Virtual softmax degrades the performance, whereas MemVir + softmax improves the performances of both datasets. When we combine XBM with ArcFace, we observe performance degradation when the memory size is large, as reported in BroadFace [22]. The performance can be further improved + +
MethodCUB200CARS196SOP
P@1RPMAP@RP@1RPMAP@RP@1RPMAP@R
Norm-softmax [41]65.65 ± 0.3035.99 ± 0.1525.25 ± 0.1383.16 ± 0.2536.20 ± 0.2626.00 ± 0.3075.67 ± 0.1750.01 ± 0.2247.13 ± 0.22
MemVir + Norm-softmax69.22 ± 0.1537.92 ± 0.1627.10 ± 0.1385.81 ± 0.1838.78 ± 0.1928.92 ± 0.1775.77 ± 0.2050.24 ± 0.2247.45 ± 0.25
CosFace [42]67.32 ± 0.3237.49 ± 0.2126.70 ± 0.2385.52 ± 0.2437.32 ± 0.2827.57 ± 0.3075.79 ± 0.1449.77 ± 0.1946.92 ± 0.19
MemVir + CosFace69.79 ± 0.2637.85 ± 0.2327.08 ± 0.2887.57 ± 0.1339.10 ± 0.2129.56 ± 0.2675.88 ± 0.2749.95 ± 0.3747.18 ± 0.38
ArcFace [7]67.50 ± 0.2537.31 ± 0.2126.45 ± 0.2085.44 ± 0.2837.02 ± 0.2927.22 ± 0.3076.20 ± 0.2750.27 ± 0.3847.41 ± 0.40
MemVir + ArcFace69.33 ± 0.4137.82 ± 0.2826.96 ± 0.2588.02 ± 0.1839.12 ± 0.1529.63 ± 0.1576.05 ± 0.3050.56 ± 0.3347.75 ± 0.32
Proxy-NCA [32]65.69 ± 0.4335.14 ± 0.2624.21 ± 0.2783.56 ± 0.2735.62 ± 0.2825.38 ± 0.3175.89 ± 0.1750.10 ± 0.2247.22 ± 0.21
MemVir + Proxy-NCA69.25 ± 0.3237.31 ± 0.1226.43 ± 0.1787.02 ± 0.1538.51 ± 0.1528.76 ± 0.1676.97 ± 0.3150.81 ± 0.2648.02 ± 0.27
Proxy-anchor [21]69.73 ± 0.3138.23 ± 0.3727.44 ± 0.3586.20 ± 0.2139.08 ± 0.3129.37 ± 0.2975.37 ± 0.1550.19 ± 0.1447.25 ± 0.15
MemVir + Proxy-anchor69.81 ± 0.2838.57 ± 0.1427.83 ± 0.1686.40 ± 0.1840.27 ± 0.2030.58 ± 0.2077.80 ± 0.1753.21 ± 0.1250.35 ± 0.13
+ +Table 2. [MLRC evaluation] Performance (%) on three famous datasets in image retrieval task. We report the performance of concatenated 512-dim over 10 training runs. Bold numbers indicate the best score within the same loss and dataset. + +
MethodCARS196SOP
R@1R@2R@4R@1R@10R@100
SoftMax78.386.491.976.689.495.8
Virtual SoftMax75.184.190.174.587.994.8
MemVir + SoftMax79.287.092.178.990.696.2
ArcFace78.886.491.776.989.195.0
XBM + ArcFace78.986.291.978.189.795.8
BroadFace + ArcFace79.587.392.080.291.095.9
MemVir + ArcFace80.788.192.780.891.396.5
CurricularFace79.987.392.079.890.795.6
MemVir + CurricularFace81.087.992.981.391.798.8
+ +by adding compensation technique and gradient control presented in BroadFace. However, exploiting the memorized features as virtual classes in MemVir shows a higher performance boost than just utilizing them for the increased number of instances in XBM and BroadFace. Considering that CurricularFace has already included the idea of CL, MemVir can improve the performance even further by providing virtual classes as harder cases. Moreover, it is noteworthy that the experimental results show the flexibility of MemVir for different types of backbones and optimizers. Extended experiments with different experimental settings are presented in the supplementary Section D.7. + +# 4.6. Comparison with State-of-the-art + +Finally, we compare the proposed method with state-of-the-art methods in DML. In the conventional evaluation shown in Table 4, every softmax variant and proxy-based loss combined with MemVir show significantly improved performance in every dataset. The average performance improvements are $2.3\%$ , $3.4\%$ , and $1.1\%$ for CUB200, CARS196 and SOP, respectively. In comparison with the memory-based (XBM), sample generation (Symm, EE), and other recent methods (MS, SoftTriple and ProxyGML), MemVir shows competitive performance in all datasets. Even in the MLRC evaluation shown in Table 2, which is specifically designed in terms of fairness, MemVir improves performance in every dataset and metric substan + +Table 3. Performance (%) comparison with related methods on CARS196 and SOP dataset. + +
MethodCUB200CARS196SOP
Multi-similarity (MS)† [44]64.582.176.3
SoftTriple [36]65.484.578.3
ProxyGML [50]66.685.578.0
Symm [12] + MS [38]64.982.476.9
EE [24] + MS [44]65.182.977.0
XBM [45] + Contrastive [14]65.882.079.5
Softmax64.281.576.3
MemVir + Softmax66.8 (+2.6)86.5 (+5.0)77.8 (+1.5)
Norm-softmax [41]64.983.378.6
MemVir + Norm-softmax67.3 (+2.4)86.8 (+3.5)79.6 (+1.0)
CosFace [42]65.783.678.6
MemVir + CosFace67.7 (+2.0)86.6 (+3.0)79.7 (+1.1)
ArcFace [7]66.183.778.8
MemVir + ArcFace67.4 (+1.3)86.5 (+2.8)80.0 (+1.2)
Proxy-NCA [32]64.382.078.1
MemVir + Proxy-NCA68.3 (+4.0)86.5 (+4.5)79.2 (+1.1)
Proxy-anchor† [21]67.784.978.9
MemVir + Proxy-anchor69.0 (+1.3)86.7 (+1.8)79.7 (+0.8)
+ +Table 4. [Conventional evaluation] Recall@1 (%) on three famous datasets in image retrieval task. † denotes evaluation in a fair setting described in supplementary Section C.2.1. + +tially. These results demonstrate the flexibility and effectiveness of MemVir in DML. Please refer to the supplementary Section D.9 for extended results of the metrics and comparisons with existing methods in conventional evaluation, as well as additional performance report of separated 128-dim in MLRC evaluation. + +# 5. Conclusion + +In this paper, we have presented a novel training strategy that exploits memory-based virtual classes and incorporates the idea of CL. Theoretical and empirical analysis demonstrates that employing virtual classes as augmented information help achieve better generalization by alleviating a strong focus on seen classes. Furthermore, we show that gradually increasing the learning difficulty by slowly adding virtual classes improves the training process and final performance. Considering that MemVir is easily applicable to existing loss functions for better generalization, it is hence a competitive training strategy in DML. + +# References + +[1] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41-48, 2009. +[2] Malik Boudiaf, Jérôme Rony, Imtiaz Masud Ziko, Eric Granger, Marco Pedersoli, Pablo Piantanida, and Ismail Ben Ayed. A unifying mutual information view of metric learning: cross-entropy vs. pairwise losses. arXiv preprint arXiv:2003.08983, 2020. +[3] Binghui Chen, Weihong Deng, and Haifeng Shen. Virtual class enhanced discriminative embedding learning. In Advances in Neural Information Processing Systems, pages 1942-1952, 2018. +[4] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. +[5] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. +[6] Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05), volume 1, pages 539-546. IEEE, 2005. +[7] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4690-4699, 2019. +[8] Yueqi Duan, Wenzhao Zheng, Xudong Lin, Jiwen Lu, and Jie Zhou. Deep adversarial metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2780-2789, 2018. +[9] Istvan Fehervari, Avinash Ravichandran, and Srikar Appalaraju. Unbiased evaluation of deep metric learning algorithms. arXiv preprint arXiv:1911.12528, 2019. +[10] Albert Gordo, Jon Almazán, Jerome Revaud, and Diane Larus. Deep image retrieval: Learning global representations for image search. In European conference on computer vision, pages 241-257. Springer, 2016. +[11] Priya Goyal, Piotr Dolkar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. +[12] Geonmo Gu and Byungsoo Ko. Symmetrical synthesis for deep metric learning. arXiv preprint arXiv:2001.11658, 2020. +[13] Guy Hacohen and Daphna Weinshall. On the power of curriculum learning in training deep networks. arXiv preprint arXiv:1904.03626, 2019. +[14] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pat + +tern Recognition (CVPR'06), volume 2, pages 1735-1742. IEEE, 2006. +[15] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[17] John R Hershey, Zhuo Chen, Jonathan Le Roux, and Shinji Watanabe. Deep clustering: Discriminative embeddings for segmentation and separation. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 31-35. IEEE, 2016. +[18] Yuge Huang, Yuhan Wang, Ying Tai, Xiaoming Liu, Pengcheng Shen, Shaoxin Li, Jilin Li, and Feiyue Huang. Curricularface: adaptive curriculum learning loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5901-5910, 2020. +[19] Frank Hutter, Holger Hoos, and Kevin Leyton-Brown. An efficient approach for assessing hyperparameter importance. In International conference on machine learning, pages 754-762. PMLR, 2014. +[20] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. +[21] Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Proxy anchor loss for deep metric learning. arXiv preprint arXiv:2003.13911, 2020. +[22] Yonghyun Kim, Wonpyo Park, and Jongju Shin. Broadface: Looking at tens of thousands of people at once for face recognition. arXiv preprint arXiv:2008.06674, 2020. +[23] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[24] Byungsoo Ko and Geonmo Gu. Embedding expansion: Augmentation in embedding space for deep metric learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7255-7264, 2020. +[25] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In Proceedings of the IEEE international conference on computer vision workshops, pages 554–561, 2013. +[26] Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014. +[27] M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In Advances in neural information processing systems, pages 1189-1197, 2010. +[28] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherical face: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 212-220, 2017. + +[29] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579-2605, 2008. +[30] Timo Milbich, Karsten Roth, Homanga Bharadhwaj, Samarth Sinha, Yoshua Bengio, Björn Ommer, and Joseph Paul Cohen. Diva: Diverse visual feature aggregation fordeep metric learning. arXiv preprint arXiv:2004.13458, 2020. +[31] Timo Milbich, Karsten Roth, Biagio Brattoli, and Björn Ommer. Sharing matters for generalization in deep metric learning. arXiv preprint arXiv:2004.05582, 2020. +[32] Yair Movshovitz-Attias, Alexander Toshev, Thomas K Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. In Proceedings of the IEEE International Conference on Computer Vision, pages 360–368, 2017. +[33] Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. arXiv preprint arXiv:2003.08505, 2020. +[34] Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4004-4012, 2016. +[35] Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017. +[36] Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, and Rong Jin. Softtriple loss: Deep metric learning without triplet sampling. In Proceedings of the IEEE International Conference on Computer Vision, pages 6450-6458, 2019. +[37] Karsten Roth, Timo Milbich, Samarth Sinha, Prateek Gupta, Bjoern Ommer, and Joseph Paul Cohen. Revisiting training strategies and generalization performance in deep metric learning. arXiv preprint arXiv:2002.08473, 2020. +[38] Kihyuk Sohn. Improved deep metric learning with multiclass n-pair loss objective. In Advances in neural information processing systems, pages 1857-1865, 2016. +[39] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. +[40] Feng Wang, Jian Cheng, Weiyang Liu, and Hajun Liu. Additive margin softmax for face verification. IEEE Signal Processing Letters, 25(7):926-930, 2018. +[41] Feng Wang, Xiang Xiang, Jian Cheng, and Alan Loddon Yuille. Normface: L2 hypersphere embedding for face verification. In Proceedings of the 25th ACM international conference on Multimedia, pages 1041-1049, 2017. +[42] Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5265-5274, 2018. +[43] Jiang Wang, Yang Song, Thomas Leung, Chuck Rosenberg, Jingbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning fine-grained image similarity with deep ranking. In Pro + +ceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1386-1393, 2014. +[44] Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R Scott. Multi-similarity loss with general pair weighting for deep metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5022-5030, 2019. +[45] Xun Wang, Haozhi Zhang, Weilin Huang, and Matthew R Scott. Cross-batch memory for embedding learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6388-6397, 2020. +[46] Kilian Q Weinberger and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 10(Feb):207-244, 2009. +[47] Daphna Weinshall, Gad Cohen, and Dan Amir. Curriculum learning by transfer learning: Theory and experiments with deep networks. arXiv preprint arXiv:1802.03796, 2018. +[48] Andrew Zhai and Hao-Yu Wu. Classification is a strong baseline for deep metric learning. arXiv preprint arXiv:1811.12649, 2018. +[49] Wenzhao Zheng, Zhaodong Chen, Jiwen Lu, and Jie Zhou. Hardness-aware deep metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 72-81, 2019. +[50] Yuehua Zhu, Muli Yang, Cheng Deng, and Wei Liu. Fewer is more: A deep graph metric learning perspective using fewer proxies. arXiv preprint arXiv:2010.13636, 2020. \ No newline at end of file diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/images.zip b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..89f74d81a2967ffa7317bcc6990e12bd285e7555 --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70ea11052262a0b78c51202017d29764a7f814c01e0b088365b75da67d6d2fd7 +size 690471 diff --git a/learningwithmemorybasedvirtualclassesfordeepmetriclearning/layout.json b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..db10a956b6c584c31ec7f9cf9ce483b5491b2024 --- /dev/null +++ b/learningwithmemorybasedvirtualclassesfordeepmetriclearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bc298658234c85125bb99844132aa89152db7d0d7fe01f933daf0ef285d2fc9 +size 452058 diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_content_list.json b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..157c86c04d625e9e77e535f4dbd63d99044df94c --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d36c246236e9253d331ace87335f792bfc159bd48a6a093834b6587fbc75583 +size 72062 diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_model.json b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3b5a26fca4fe8ee8931d86ff14d8f0d3f070a1e4 --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b941b9daa364b17c02b96b737c7b29a7d8ed5a0a35f75b0d33b794c8d65af6d5 +size 86772 diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_origin.pdf b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3e8eb30f83cf7e38a95839f95aa959e886484bdf --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/fc706032-6ab2-47e0-8ba7-5c9915c85218_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78fb75f6a3369d7212afd583f3621421aff784966725baa7968772bac1dcd114 +size 8406995 diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/full.md b/learningwithnoisylabelsforrobustpointcloudsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..078aeab1ee060c33cd913117c307ba9a623f98da --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/full.md @@ -0,0 +1,291 @@ +# Learning with Noisy Labels for Robust Point Cloud Segmentation + +Shuquan Ye $^{1}$ Dongdong Chen $^{2}$ Songfang Han $^{3}$ Jing Liao $^{1*}$ + +1 City University of Hong Kong 2 Microsoft Cloud AI 3 University of California San Diego + +shuquanye2-c@my.cityu.edu.hk, cddlyf@gmail.com, s5han@eng.ucsd.edu, jingliao@cityu.edu.hk + +# Abstract + +Point cloud segmentation is a fundamental task in 3D. Despite recent progress on point cloud segmentation with the power of deep networks, current deep learning methods based on the clean label assumptions may fail with noisy labels. Yet, object class labels are often mislabeled in real-world point cloud datasets. In this work, we take the lead in solving this issue by proposing a novel Point Noise-Adaptive Learning (PNAL) framework. Compared to existing noise-robust methods on image tasks, our PNAL is noise-rate blind, to cope with the spatially variant noise rate problem specific to point clouds. Specifically, we propose a novel point-wise confidence selection to obtain reliable labels based on the historical predictions of each point. A novel cluster-wise label correction is proposed with a voting strategy to generate the best possible label taking the neighbor point correlations into consideration. We conduct extensive experiments to demonstrate the effectiveness of PNAL on both synthetic and real-world noisy datasets. In particular, even with $60\%$ symmetric noisy labels, our proposed method produces much better results than its baseline counterpart without PNAL and is comparable to the ideal upper bound trained on a completely clean dataset. Moreover, we fully re-labeled the validation set of a popular but noisy real-world scene dataset ScanNetV2 to make it clean, for rigorous experiment and future research. Our code and data will be released. + +# 1. Introduction + +In recent years, the development of deep neural networks (DNNs) has led to great success in 3D point cloud segmentation [11, 36, 32]. Thanks to the powerful learning capacity, once high-quality annotations are given, DNNs-based point segmentation methods can achieve remarkable performance. However, such high learning capacity is a double-edged sword, i.e., it can also over-fit label noise and incur performance degradation if there are incorrect annotations. + +In fact, compared to annotating 2D images, clean 3D data labels are more difficult to obtain. It is mainly because: 1) the point number to annotate is often very massive, e.g., million scale in annotating a typical indoor scene in ScanNetV2 [6]; 2) the annotating process is inherently more complex and requires more expertise for the annotators, e.g., constantly changing the view, position and scale to understand the underlying 3D structure. As a result, even the commonly used 3D scene dataset ScanNetV2 [6], which is already a version after refining the label from the ScanNet, has a large portion of label noise, as shown in Figure 1. + +Based on the above considerations, there is an urgent need to study how to learn with noisy labels for robust point cloud segmentation. However, to the best of our knowledge, most research works about learning with noisy labels focus on image classification, and no previous study exists for point cloud segmentation. More importantly, such works designed for image recognition cannot be directly applied to point cloud segmentation. For example, among the most popular methods, sample selection methods [12, 33, 24, 26, 17] often assume that the noise rate of all samples is a known constant value. However, the noise rates are often unknown and variable. Robust loss function methods [35, 30] cannot achieve consistent noise robustness to large noise rates. Whereas label correction methods [23, 26, 1] are designed to correct for image-level label noise, the point cloud segmentation task requires to correct point-level noises. Considering that the point labels within each instance are strongly correlated, directly applying these methods to each point independently without considering the local correlation is suboptimal. + +In this paper, we present a novel point noise-adaptive learning (PNAL) framework, which is the first attempt to empower the point cloud segmentation model with resistance to annotation noise. Specifically, to cope with unknown, possibly heavy, and varying noise rates, we designed a point-level confidence selection mechanism, which obtains reliable labels based on the historical predictions of each point without requiring a known noise rate. Next, in order to fully utilize the local correlation among labels, we propose a label correction process performed at + +![](images/9725bd3c37c48b128464ada9181199f5cab93e5cbea85382bcdcb3cfa797ace2.jpg) + +![](images/d818f5a97b7b6a72b08378a5a193a462e5ab67011d73c20cacc79fd3966fbb23.jpg) + +![](images/8a91b9c41545c58d05db7c456c2e6a819df9379a7c59974f20ee79c45edc73e6.jpg) + +![](images/b8531444dc97c28e9da142cb3b57ff6da050a74c342240e79854b0fc22b7ffeb.jpg) +Figure 1. Illustration of the instance-level label noise concept in point cloud segmentation. From left to right are the input (noisy instances highlighted red boxes), the manual annotation given by the real-world dataset ScanNetV2, and the prediction of PNAL (more in line with the real category). It is noticeable that this popular dataset suffers from label noise, such as mislabeling the floor as a chair, even that it is already a re-labeled version of ScanNet. Our PNAL framework is trained on this noisy dataset but still achieves correct predictions. + +![](images/bafe4427a6d1519d59cb7991f547bebf69b2b6c7597ccdb2dac8a8c5dd685dde.jpg) +Input Scenes + +![](images/6773a404d2e1067b10a597daff6d2c0fd7b507ee760e634390e7bcca47862727.jpg) +Real-World Noisy GT Labels + +![](images/1db17508f00748bec076c9a706d8608557e4f41b41fabb2183be5d3df5219df6.jpg) +Predictions of PNAL + +cluster level. This is done by the proposed voting strategy that tries to merge reliable labels from relevant points to provide the best possible label for each point cluster, with a computationally efficient implementation. + +To demonstrate the effectiveness of our PNAL, we compare the proposed framework with various possible baselines based on different network backbones on the synthetic noisy label dataset from stanford large-scale 3d indoor spaces (S3DIS) [2], which shows the great advantage of PNAL on both performance and efficiency. On the real-world noisy dataset ScannetV2 [6], we notice that both its training and validation set suffers from the noisy label issue. Therefore, we not only conducted experiments on the original training and validation set. Also, for a more rigorous evaluation, we refine the validation set by manually correcting the noisy labels and evaluate PNAL on this clean set. These results indicate that PNAL is also robust to real-world noise. To further explore PNAL, a complete ablation study, training process analysis, and robustness test were also performed. + +To summarize, our contributions are fourfold. + +- To the best of our knowledge, this is the first work investigating noisy labels on point cloud data, which has a wide and urgent need for 3D applications where the volume of data is growing drastically. +- A novel noise-rate blind PNAL framework is proposed to handle spatially variant noise rates in point cloud. It consists of point-level confidence selection, cluster-level label correction with voting mechanism, and can be easily applied to different network architectures. +- Extensive experiments are conducted to show the clear improvements by PNAL, on both synthetic and real-world noisy label datasets. + +- We re-labeled the validation set of ScanNetV2 by correcting noises and will make it public to facilitate both point cloud segmentation and noise label learning. + +# 2. Related Work + +Point Cloud Segmentation. Given a point cloud, the task of semantic segmentation is to divide it into subsets based on the semantic meaning of the points. Among the related works, point-based networks have recently gained more and more attention. These methods act directly on disordered, irregular, and unstructured point clouds, so that directly applying standard CNNs is not feasible. For this reason, the pioneering work PointNet [21] was proposed to learn perpoint features using cascaded multi-layer perceptrons. It uses cuboidal blocks of fixed arbitrary size to cut the rooms in the scene datasets into blocks when processing datasets. Inspired by PointNet, a series of point-based networks have been recently proposed. In general, following the practice of PointNet, these approaches use octrees [27], kd-trees [15] or clustering [16] to decompose room scences into room blocks. Those processing method for point cloud data is widely used today [13]. + +Learning with Noisy Labels. Different methods have been proposed to train accurate models under noisy labeled data, which can be broadly classified into five categories. + +Methods with noise-robust layers [28, 10, 4] are intended to model a label transition matrix $T$ . Based on the estimated $T$ , they adjust the output of the network to a more confident label. However, such methods assume a strong correlation between certain labels, which limits the method usages. + +Another approach is to design a loss that is robust to noisy labels [9, 19], generalized cross entropy (GCE)[35], symmetric cross entropy (SCE)[30], which are popular and + +easily adaptable to existing architectures. They are originally proposed for classification, but most of them are applicable to segmentation if used pixel-wisely. A recent work [18] proposes to apply the reverse cross entropy [30] for the foreground-instance sub-task and a standard cross entropy (CE) loss for the foreground-background in instance segmentation. A major limitation is that they cannot handle heavy noisy labels. + +Loss adjustment methods [23, 5, 14, 1, 26, 34, 29] reduce the negative impact of noisy labels by adjusting the loss of all training samples. In general, while these methods fully exploring the training data, they take the risks of false correction. Among them, [34, 29] are the latest methods that try to solve the noisy label problem on binary segmentation. + +To avoid false correction, sample selection methods [12, 33, 24, 26, 17] select true-labeled samples from noisy data. However, they take the risk of discarding usable samples, and require either a true noise rate or a fully clean validation set. Our approach is a hybrid of sample selection and loss correction. Unlike other sample selection methods, no noise-rate is required. Different from loss correction, instead of correcting all samples, we correct labels according to confidence considering its locally similar region. + +# 3. Problem Description + +We define the task of multi-class point cloud semantic segmentation with noisy labels. Formally, we denote point cloud data as $\mathbf{X} \in \mathcal{R}^{N \times C}$ of $N$ points with $C$ features of coordinates and RGB values possibly, and its semantic label as $\mathbf{Y}$ , and $M$ as the class number. Our target is to train a model $\mathbf{f}_{\theta}(\mathbf{X})$ robust to the label noise in the training set. + +We observe that while the semantic label of an instance might be wrong, we seldom encounter incorrect instance partitioning. For example, a table may be labeled as a sofa, but we seldom see a table that is partially labeled as a sofa. This implies that our method should correct the noise at the instance level. However, the ground truth instance information may not available, and predicting object instances itself is a challenging task. + +Alternatively, we create a cluster based noise correction method, where each cluster consists of a local patch of points. The main assumption is that points in a cluster are considered to belong to the same instance. This cluster can be generated with off-the-shelf clustering algorithms. In experiments, we mainly use the DBSCAN [7]. DBSCAN is a density-based clustering algorithm that does not require the specification of the cluster number in the data, unlike k-means. DBSCAN can find arbitrarily shaped clusters, and this characteristic makes DBSCAN very suitable for LiDAR point cloud data. In the experiment we also tried another clustering method GMM. During training, we correct the label on a cluster level. Based on the experiments described in Sec. 5.6, we demonstrate that our method is robust to the + +granularity of cluster to a certain range and insensitive to clustering methods. We denote the point cloud and its label in a cluster $\mathbf{C}_i$ as $(X_{\mathbf{C}_i},Y_{\mathbf{C}_i}),1\leq i\leq k,$ and $k$ is the number of clusters. + +# 4. Methodology + +# 4.1. Pipeline Overview + +The overall framework of our proposed method is illustrated in Fig. 2. Our training procedure is divided into two stages, a warm-up stage introduced in Sec. 4.2 and a noise-cleaning stage introduced in Sec. 4.3 and Sec. 4.4. We first train the network on all samples by default manner for $E_{warm-up}$ epochs, where $E_{warm-up}$ denotes the number of epochs for this stage. The warm-up stage motivates the network to learn the easy data, which are largely consistently labeled correct data. + +Then we further train the network with our proposed noise-cleaning stage. The main idea is to identify the potential noisy label based on the behavior of the network prediction and update the selected data label to a more reliable label. From the observation that the ground truth label is often corrupted on an instance-level, we encourage to correct data labels in a group-wise manner. That we propose to first cluster point cloud into small patches and then update point label patch-by-patch. Point cloud in one patch is set to the same semantic label. Besides, we predict the new label of each cluster through a voting strategy. + +# 4.2. Warm-Up + +According to the study of memorization effects [3], deep neural networks are prone to learn clean, easy samples first, and then other noisy samples gradually, even in the presence of noisy labels. Therefore, in the warm-up stage, we adapt no strategies and train the network with a common cross-entropy loss. The detailed formula of $\mathrm{Loss}_{\text{warm-up}}$ is: + +$$ +\operatorname {L o s s} _ {\text {w a r m - u p}} = - \frac {1}{B} \sum_ {i = 1} ^ {B} \sum_ {m = 0} ^ {M} q (m \mid \mathbf {X} _ {i}) \log p (m \mid \mathbf {X} _ {i}), \tag {1} +$$ + +where $B$ is the number of samples inside a mini-batch, $p(m \mid \mathbf{X}_i)$ denotes classification confidence of each class $m \in \{1,\dots,M\}$ , and $q(m \mid \mathbf{X}_i) \in \{0,1\}^{N \times M}$ is one-hot encoded label. + +The warm-up stage power the network with easily learned data samples. However, if trained with a large number of epochs for the warm-up stage, the network will tend to fit noisy labels. Let $E_{clean}$ denotes the number of epochs for the noise-cleaning stage. In noise-cleaning stage of training, remarkably, no hyperparameters such as noise rate are required. We observe that, the precision of both the replaced labels and the correctly fixed labels increases + +![](images/f0d3b97c5fc7d6596a70abe1cb727ee67e49824cd4c0277ac0b66bbc7f2cd33e.jpg) +Figure 2. System pipeline. In the warm-up stage, the network is updated with CE as usual. In the noise cleaning stage, we enqueue the output to the prediction history and point wisely perform confidence selection to get reliable labels. With these results, we do voting at cluster level, then correct the original noisy GT or the previously cleaned GT. Finally the obtained cleaned GT guides the network update. + +gradually as the training step progresses, and label replacement eventually expands to almost the entire training set, as analyzed in 5.7. Moreover, through our analysis in 5.6 on $E_{warm-up}$ , too much warm-up causes the model fitting more noisy data, which affects the performance when the noise rate is large. Meanwhile, the optimal $E_{warm-up}$ setting is not sensitive to the noise rate. At different noise rates, we can derive the following relationship between the optimal $E_{warm-up}$ and $E_{clean}$ , + +$$ +E _ {w a r m - u p} = \frac {1}{5} E _ {c l e a n}. \tag {2} +$$ + +# 4.3. Point-Level Confidence Selection + +In this part, we aim to select reliable samples from each mini-batch and obtain the confidential labels for these samples that can be corrected with high probability. + +Previous studies of sample selection [26, 12] adopt the widely used loss-based separation which tries to construct clean set $\mathcal{C}$ by selecting $(1 - \tau)\times 100\%$ of low-loss instances, where $\tau$ is the noise rate. While significant improvements have been achieved in these works, such an approach faces two key problems. First, it is not appropriate to assume that the noise rate is available and constant on the 3D point cloud. Second, it would exclude $\mathcal{C}_h$ which tends to produce high losses, making it difficult for hard cleans to participate in the network update. To address the above weaknesses of the loss-based sample selection methods, instead of selecting clean samples, we propose to directly select the reliable + +samples without knowing the noise rate. + +Inspired by the bootstrapping [23], we develop a confidence point selection method for dynamically selecting reliable samples and target labels without requiring explicit noise rate. Instead of using predicted class probabilities to generate regression targets, a new criterion, inspired by SELFIE [26], is designed based on history prediction. In detail, a sample with consistently predicted label is regarded as the reliable sample, and its most frequently predicted label is the reliable label, as defined below: + +Definition 1. A point $x_{n}$ is a reliable sample if the predictive confidence $F(x_{n};q)$ satisfies $F(x_{n};q)\geq \sigma (0\leq \sigma \leq 1)$ . The predictive confidence is defined as + +$$ +F (x; q) = (1 / \lambda) \text {e n t r o p y} (P (m \mid x; q)) \tag {3} +$$ + +where $\lambda = -\log \left(\frac{1}{M}\right)$ is a normalization term for normalizing to [0, 1]. We denote the predicted label of the sample point $x$ at time $t$ as $\hat{m}_t = \mathbf{f}_{\theta_t}(x)$ . Then, the label history of the sample $x$ that stores the predicted labels of the previous $q \leq E_{warm-up}$ times is $H_x(q) = \{\hat{m}_{t_1}, \dots, \hat{m}_{t_q}\}$ , where $q$ is history length. Next, as given in Eq. 4, $P(m \mid x; q)$ is the probability of the label $m \in \{1, \dots, M\}$ estimated as the label of the sample point $x$ . + +$$ +P (m \mid x; q) = \frac {\sum_ {\hat {m} \in H _ {x} (q)} [ \hat {m} = m ]}{\left| H _ {x} (q) \right|} \tag {4} +$$ + +, where $[\cdot ]$ is the Iverson bracket notation. Then we denote the set of reliable samples as $\mathbf{X}_{\text{reliable}}$ . Finally, we define + +the reliable label as $m_{n}^{*}$ where + +$$ +m _ {n} ^ {*} = \arg \max _ {m} P (m \mid x _ {n}; q). +$$ + +Specifically, our method differs from SELFFIE in three significant ways. First, our method is noise-rate blind, to handle spatially variant noise-rate problem in point cloud. Second, our confidence selection mechanism is point-level, and our label correction process is done on cluster level with the help of a novel voting strategy, in order to consider local relationship between point labels. Note that the reliable label in selection stage may not be the label won for correction process. Last but not least, our detailed implementation has to be much more computationally efficient, to allow for point-level selection and cluster-level correction. + +# 4.4. Cluster-Level Label Correction + +The label correction process is to selectively replace the label with the best possible label in locally similar regions. Ideally, the local similarity region is defined by the ground-truth instance. However, since instance labels may not be available in practice, we use cluster as an alternative. From each cluster $\mathbf{C}_i(1\leq i\leq k)$ , as given in Eq. 5, the ones containing reliable samples will be selected for the label correction in subsequent steps. + +$$ +\left\{\mathbf {C} _ {i} \mid \exists x _ {n}: x _ {n} \in \mathbf {X} _ {\text {r e l i a b l e}} \wedge x _ {n} \in \mathbf {X} _ {\mathbf {C} _ {i}} \right\} \tag {5} +$$ + +, where $n \in \{1, \dots, N\}$ . Next, for each of these clusters, e.g. $\mathbf{C}_{i^*}$ , we will replace the label $\mathbf{Y}_{\mathbf{C}_{i^*}}$ with a best label locally. The goal label can be found by the proposed voting strategy according to the overall label occurrences within the cluster. We use $occ_{i^*}^m$ to denote the occurrence number of reliable samples with $m_n^* = m$ . + +$$ +\begin{array}{l} o c c _ {i ^ {*}} ^ {m} = \sum_ {n = 1} ^ {N} [ m _ {n} ^ {*} = m \wedge x _ {n} \in \mathbf {X} _ {\mathbf {C} _ {i ^ {*}}} ] \tag {6} \\ = \sum_ {n = 1} ^ {N} [ m _ {n} ^ {*} = m ] [ x _ {n} \in \mathbf {X} _ {\mathbf {C} _ {i ^ {*}}} ] \\ \end{array} +$$ + +, where $[\cdot]$ is the Iverson bracket. Then, occurrences for each class are formed as a vector $occ_{i^*} = (occ_{i^*}^1, \dots, occ_{i^*}^M)$ , and we can find the top occurrence by $occ_{i^*}^{top} = \max_{1 \leq m \leq M} occ_{i^*}^m$ . A winner label is randomly chosen from $\{m \mid occ_{i^*}^m \geq \frac{occ_{i^*}^{top}}{\gamma}\}$ to overwrite the label of this cluster. Note that, in a special case of $\gamma = 1$ , the winner label in this cluster will be from the top reliable labels $\{m \mid occ_{i^*}^m = occ_{i^*}^{top}\}$ . According to our ablation study, $\gamma = 4$ achieves best performance. Note that the original label may not be mislabeled or different from the winner label. And the labels may be repeatedly overwritten during the training process. Finally, we update the network with + +these replaced labels by a cross-entropy loss, and the samples whose label have never been replaced are not involved in the gradient calculation. + +# 5. Experiments + +# 5.1. Datasets and Noise Settings + +To demonstrate the effectiveness of our proposed method, we conduct experiments on two datasets, ScanNetV2 [6] and S3DIS [2]. ScanNetV2 is a popular 3D real-world dataset with label noise. S3DIS is a commonly used scene dataset with much cleaner labels, which can be considered as clean data. There we can artificially build noisy datasets from S3DIS with various noise settings. + +ScanNetV2. The ScanNetV2 3D segmentation dataset contains 1,513 annotated rooms with 21 semantic elements in total. According to the scan annotation pipeline for ScanNetV2 [6, 25], a normal-based graph cut image segmentation method [8] is first utilized to get a basic, pre-segmentation. These provide a reliable reference to an object instance, however, the class label can be carelessly mislabeled in practice. Also, since the rooms are distributed to different annotators, inconsistent labels can be found even for the same object with different placements in the same scene. These observations match our assumption about the noise pattern in point cloud segmentation that mislabeling occurs at the object-instance-level. And we noticed that the noisy label problem also exists even in its validation sets. Since this issue has never been mentioned in other studies, we manually correct such noise labels of all scenes from the validation sets of ScanNetV2 for more accurate evaluation. Note that we did not perform evaluation on the benchmark test split, due to its unknown noise rate and unavailable annotation. + +S3DIS. S3DIS contains point clouds of 272 rooms in 6 large-scale indoor scenes in three buildings with 12 semantic elements. The instance label is borrowed from [20] which are manually annotated. Compared to ScannetV2, the S3DIS dataset has a much smaller amount of scenes, less scene complexity, and fewer classes, and the errors occurring in class labels are clearly less than the former. Therefore, we treat the S3DIS dataset as a completely clean dataset, i.e., the noise rate is 0. + +We generate a noisy dataset from S3DIS by randomly changing the point label at an object-instance level, guided by our noise pattern assumption. Following previous work on image classification with noisy data, we model the noisy dataset with two noise types: symmetric and asymmetric. For symmetric noise, the point label is modified to other labels with equal probability at instance level. Also, we found that some class pairs are easily mislabeled as each other in the real-world noisy ScanNetV2, such as door and wall, while some pairs are not that confusable, such as wall + +and desk. Based on this, we create asymmetric noisy S3DIS dataset, mimicking the way in real-world. In particular, we identify the easily misclassified label pairs, including doorwall, board-window, sofa-chair, and randomly flip the label inside each label pair with a probability of $\tau_{pair}$ . To note that ours setting is different from previous work on image noisy labels. On point cloud data with only 12 semantic classes, it is inappropriate and unrealistic, to define another confusable class for all classes. Therefore, for classes without pairs, we follow the symmetrical noise setting, to achieve a specified value of the overall noise rate $\tau$ . We will show results in the supplemental file following the asymmetric noise setting in previous works on image. + +# 5.2. Implementation Details + +The DBSCAN algorithm is used for point cloud segmentation in this study, if not specifically stated, with $\varepsilon = 0.018$ . For the real-world noisy dataset ScanNetV2 and artificially created noisy dataset S3DIS, room scenes are divided into room blocks of size $1.0 \times m$ and stride $0.5 \times m$ . We random sample 4096 points for each room block during training. We report the results in terms of overall accuracy (OA) and mean intersection over union (mIoU) with DGCNN [31], Pointnet2 [22], and SparseC-convNet [11] as backbones. Without special notation, all experiments are conducted with DGCNN as backbone. For symmetric noise, we conduct experiments on noise rates $\tau \in \{20\%, 40\%, 60\%, 80\}$ . For asymmetric noise, we test on a large noise rate $\tau = 60\%$ , $\tau_{pair} = 40\%$ . All the results on S3DIS are tested on the clean 6th-Area. We train a total of 30 epochs, including the warm-up stage and clean-noise stage. The history length is set to 4. + +# 5.3. Baselines + +Note that we are the first handling noisy label on point cloud segmentation. We try our best to adapt previous works and create the following baselines: CE, GCE[35], SCE[30] and SELFIE[26]. The first three methods can be naturally applied to the point cloud segmentation as point level guidance. To adopt SELFIE, we apply the original implementation of image-level SELFIE point-wisely. We experimentally find that the optimal warm-up threshold is 5. The other settings are the same as in their paper. + +# 5.4. Performance Comparison on S3DIS + +Table. 1 shows the performance of baselines and PNAL under different backbones, noisy rates and noise types. + +The first five rows show the results with DGCNN backbone. In the case of DGCNN+CE, its performance drops quickly by $11.86\%$ at $20\%$ noise rate alone and by $23\%$ at $60\%$ symmetric noise rate compared to the result on clean training data. This shows that label noise hurt the training process severely. We observe that previous noise-robust + +methods SCE and GCE perform no better or worse than CE at $0\%$ and $20\%$ noise rates, and only $1.19\%$ and $5.77\%$ improvement at $60\%$ symmetric noise rate. The noise correction method SELFIE helps improve the performance by $13.35\%$ at $60\%$ symmetric noise rate. These are expected since these methods works with small or constant noise rates, while point cloud training suffers from extreme noise rate variation. And they do not consider the label correlation of local regions, so it is difficult to achieve optimal results. Compared to the DGCNN+SELFIE framework, DGCNN+PNAL shows a further improvement of more than $4.11\%$ for all noise settings. It is worth noting that SELFIE requires a noise rate and takes more than 10 hours per epoch on average, while DGCNN+PNAL takes only 3 hours and 51 minutes. We owe this to the noise-blind pipeline, and the voting design that takes into account the label correlation of local regions. Furthermore, our method significantly improves result by $10.63\%$ , $16.46\%$ , $18.46\%$ , $25.91\%$ , $23.34\%$ at $20\%$ , $40\%$ , $60\%$ , $80\%$ symmetric noise and asymmetric noise, respectively. Consistently, our performance improves by $13.77\%$ , $14.75\%$ , $22.17\%$ , $25.04\%$ , and $25.54\%$ with PointNet2 as backbone, as shown in the last two rows. + +# 5.5. Performance on ScanNetV2 + +Table 2 shows the performances on ScanNetV2 validation set with SparseConvNet [11] as the backbone network. Although the results of our method do not show a great advantage, we believe this is due to the fact that there are still mislabels in the validation set of ScanNetV2. Therefore, we show some examples from the validation set in the Fig. 4, where ours gets more reasonable results than the baseline method and even than GT. + +For a more rigorous comparison, we further tested on the fully relabeled clean validation data mentioned before, and reported the results in Table 2. Our method achieves significant performance gain, which demonstrates the effectiveness of our method on the real-world noisy dataset. In contrast, the performance of the baseline SparseConvNet degrades, indicating its overfitting of the label noise, which affects the performance on fully clean data. + +# 5.6. Ablation Study + +Component Ablation Study. All the results in Table. 3 are on $60\%$ symmetric noise. The first column reports the results of PNAL with GT instance instead of clustering for label correction, which represents the upper limit of our results. Compared with it, the cluster based results in the last column have only a small drop, which can illustrate the feasibility of using cluster as an alternative to GT instance label. In the second column, we omit the cluster-level voting step and perform label correction point-wisely, without considering the label consistency between nearby points. The results show a $2.25\%$ decrease over our full method, demon- + +
Methods0%Symmetric Noise (τ)Asymmetric Noise τpair=40%,τ=60%
20%40%60%80%
DGCNN[31]+CE0.86920.75060.67320.63900.50600.5634
DGCNN[31]+SCE[30]0.77680.75240.72300.65090.57050.7084
DGCNN[31]+GCE[35]0.70670.70030.69970.69670.68800.6614
DGCNN[31]+SELFIE[26]*0.86730.81580.79140.77250.71630.7500
DGCNN[31]+PNAL0.86860.85690.83780.82360.76510.7968
PointNet2[22]+CE0.88980.70080.67960.58500.52040.5648
PointNet2[22]+PNAL0.88520.83850.82710.80670.77080.8202
+ +![](images/02dcb8a5711162774d6ceeb1822c78f4a1ff2a27797b28f0bd8b7b8f96850a11.jpg) +Table 1. OA Comparison of different methods on artificially created noisy S3DIS. The tops with different backbones are shown in bold. +Figure 3. From left to right: Scenes in S3DIS testset, clean GTs, predictions of DGCNN+CE, and DGCNN+PNAL. + +
Methodsreal-world noisy +ScanNetV2our re-labeled +ScanNetV2
mIoUOAmIoUOA
SparseConvNet[11]0.72500.89280.71030.8807
SparseConvNet[11]+PNAL0.72980.89790.74160.9211
+ +Table 2. The mIoU and OA comparison on real-world noisy ScanNetV2 validation set and our re-labeled ScanNetV2 validation set. + +
MetricGT Instancew/o Votingγ=1γ=2q=8DGCNN +PNAL
OA0.82870.80110.81100.82090.77040.8236
+ +strating the effectiveness of our proposed cluster-level label correction. In the third and fourth columns, we try different values of $\gamma$ , where $\gamma = 1$ is the most greedy case, i.e., the winner label is the top reliable label. We observe no significant performance drop with different $\gamma$ values, implying our method is not sensitive to the choice of $\gamma$ . We use $\gamma = 4$ in our setting. In the fifth column we adjust the history length $q$ to 8, and note that $E_{warm-up}$ is also increased to 8, due to the constraint of $q$ . We can observe a significant decrease in performance. More analysis is given in the next paragraph. + +Robustness to $E_{\text{warm-up}}$ . Table 4 reports the results of our + +Table 3. OA Comparison on $60\%$ symmetric noise S3DIS dataset. + +
Noise Rate τ20%40%60%
Ewarm-up = 50.85690.83780.8236
Ewarm-up = 80.84220.82470.7851
Ewarm-up = 110.83430.80090.7812
+ +Table 4. The OA of PNAL at different ${E}_{\text{warm } - \mathrm{{up}}}$ and noise rates. + +method at different $E_{warm-up}$ under symmetric noise of different noise rates (20%, 40%, 60%). Our performances are optimal and robust, with $E_{warm-up} = 5$ as we recommend, for all noise rates, demonstrating that $E_{warm-up}$ is not sensitive to noise rate variations. The larger the noise rate, the larger the performance drop can be observed if $E_{warm-up}$ increases. We can conclude that the larger the $E_{warm-up}$ , the more noisy data the network fits, which can make noise-cleaning difficult on data with large noise rates. Comparing the result in the second row with the fifth column in Tab. 3, we found that although increasing the history length brings a performance decrease, this mainly comes from the effect of the increased $E_{warm-up}$ . + +Robustness to Clustering Methods and Granularity. In Table 5, the first three columns report the results of PNAL under different clustering granularities ( $\varepsilon$ is 0.015, 0.018, 0.021), and the last two columns report the + +![](images/c2d7b409ea3ac916472f08cb12c6471be838c197b37a121dba10ce5d6e2d1811.jpg) +Figure 4. From left to right: Scenes in ScanNetV2 validation set, GT labels given by ScanNetV2, predictions of [11], and predictions of [11] + PNAL. Ours get more reasonable labels than GT labels. + +![](images/dbf530a98baa545516dcb23c0a9ac9f2bd967aeedfda47d98de8e509ce2490d5.jpg) +Figure 5. Comparison of the corrected labels in epochs 5, 15, and 29 on the $60\%$ symmetric noise S3DIS. From left to right are the input point cloud with RGB, the corresponding noisy label, the label correction in epochs 5, 15, and 29, and the ground-truth label. + +
Clustering MethodsDBSCAN ε=0.015DBSCAN ε=0.018DBSCAN ε=0.021GMM spectral
OA0.82060.82360.81590.8178 0.8162
+ +Table 5. The OA of our method at different granularity of clusters and different clustering methods. + +results of ours under other type of clustering (GMM, spectral). They show close results, which demonstrates that our method is robust to a certain range of cluster granularities and is not sensitive to the clustering method used. + +# 5.7. Correction Process Analysis + +Fig. 5 shows the visualization of the label correction process by the PNAL during training. We can find that as the training goes, the overall labeling errors in the training set tends to decrease and gradually approaches the clean ground-truth label. Typically, label errors with large areas (e.g., floors, walls, ceilings) are corrected first. As training proceeds, PNAL gradually explores the entire dataset and tries to correct difficult and small objects. As given in Fig. 6, the percentage of points with replaced label increases from 0.936 to 0.992, while the percentage of correctly corrected points is close to 0.8 from the beginning of the noise-cleaning stage and then gradually increases to 0.865. It also shows that the PNAL correction process spreads to whole training set as the training proceeds. To note that we take the case of correcting to original label into account. + +![](images/c09fe878deadff36c2e011ad6e76e2ae10d5ef353a5504bb96f01652bbe9825d.jpg) +Figure 6. The percentages of points with replaced label (denoted as Correction) and the percentage of correctly corrected points (denoted as True Correction). + +# 6. Conclusion + +In this study, we propose PNAL, a new point cloud segmentation framework, to cope with the novel point cloud labeling noise problem. Unlike existing methods that focus on image classification, PNAL is noise-rate blind, in order to cope with the unique noise-rate variation problem in point cloud. We propose point-wise confidence selection, cluster-wise label correction and voting strategies to generate the best possible labels considering the correlation labels in local similar points. In addition, we re-labeled the validation set of a popular but noisy real-world scene point cloud dataset to make it clean, for rigorous experiment and for future research. Experiments demonstrate the effectiveness and robustness of our method on real-world noisy data and artificially created noisy public data. + +Acknowledgements: We would like to thank Jiaying Lin for his generous help. This work was supported by the National Natural Science Foundation of China under Grant U20B2047 and the Shenzhen Basic Research General Program under Grant JCYJ20190814112007258. + +# References + +[1] Eric Arazo, Diego Ortego, Paul Albert, Noel E O'Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. In International Conference on Machine Learning (ICML), June 2019. +[2] Iro Armeni, Ozan Sener, Amir R. Zamir, Helen Jiang, Ioannis Brilakis, Martin Fischer, and Silvio Savarese. 3d semantic parsing of large-scale indoor spaces. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition, 2016. +[3] Devansh Arpit, Stanisław Jastrzebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning, pages 233-242. PMLR, 2017. +[4] A. J. Bekker and J. Goldberger. Training deep neural networks based on unreliable labels. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 2682-2686, 2016. +[5] Haw-Shiuan Chang, Erik Learned-Miller, and Andrew McCallum. Active bias: Training more accurate neural networks by emphasizing high variance samples. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +[6] Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2017. +[7] Martin Ester, Hans-Peter Kriegel, Jörg Sander, and Xiaowei Xu. Density-based spatial clustering of applications with noise. In Int. Conf. Knowledge Discovery and Data Mining, volume 240, page 6, 1996. +[8] Pedro F Felzenszwalb and Daniel P Huttenlocher. Efficient graph-based image segmentation. International journal of computer vision, 59(2):167-181, 2004. +[9] Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. +[10] J. Goldberger and E. Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017. +[11] Benjamin Graham, Martin Engelcke, and Laurens van der Maaten. 3d semantic segmentation with submanifold sparse convolutional networks. CVPR, 2018. +[12] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor W. Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS'18, page 8536-8546, Red Hook, NY, USA, 2018. Curran Associates Inc. +[13] Tong He, Dong Gong, Zhi Tian, and Chunhua Shen. Learning and memorizing representative prototypes for 3d point + +cloud semantic and instance segmentation. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision - ECCV 2020, pages 564-580, Cham, 2020. Springer International Publishing. +[14] Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. +[15] Roman Klokov and Victor Lempitsky. Escape from cells: Deep kd-networks for the recognition of 3d point cloud models. In Proceedings of the IEEE International Conference on Computer Vision, pages 863-872, 2017. +[16] Loic Landrieu and Martin Simonovsky. Large-scale point cloud semantic segmentation with superpoint graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4558-4567, 2018. +[17] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. Advances in Neural Information Processing Systems, 33, 2020. +[18] Yang Longrong, Meng Fanman, Li Hongliang, Wu Qingbo, and Cheng Qishang. Learning with noisy class labels for instance segmentation. In European Conference on Computer Vision (ECCV), 2020. +[19] Yueming Lyu and Ivor W. Tsang. Curriculum loss: Robust learning and generalization against label corruption. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. +[20] Quang-Hieu Pham, Duc Thanh Nguyen, Binh-Son Hua, Gemma Roig, and Sai-Kit Yeung. JSIS3D: Joint semantic-instance segmentation of 3d point clouds with multi-task pointwise networks and multi-value conditional random fields. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +[21] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652-660, 2017. +[22] Charles R Qi, Li Yi, Hao Su, and Leonidas J Guibas. Point-net++: Deep hierarchical feature learning on point sets in a metric space. arXiv preprint arXiv:1706.02413, 2017. +[23] S. Reed, H. Lee, Dragomir Anguelov, Christian Szegedy, D. Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. *ICLR*, abs/1412.6596, 2015. +[24] Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In International Conference on Machine Learning, pages 5739-5748. PMLR, 2019. +[25] Smartscenes. smartscenes/sstk. +[26] Hwanjun Song, Minseok Kim, and Jae-Gil Lee. Selfie: Refurbishing unclean samples for robust deep learning. In International Conference on Machine Learning, pages 5907-5915. PMLR, 2019. + +[27] Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Octree generating networks: Efficient convolutional architectures for high-resolution 3d outputs. In Proceedings of the IEEE International Conference on Computer Vision, pages 2088-2096, 2017. +[28] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2691-2699, 2015. +[29] Guotai Wang, Xinglong Liu, Chaoping Li, Zhiyong Xu, Jiugen Ruan, Haifeng Zhu, Tao Meng, Kang Li, Ning Huang, and Shaoting Zhang. A noise-robust framework for automatic segmentation of Covid-19 pneumonia lesions from ct images. IEEE Transactions on Medical Imaging, 39(8):2653-2663, 2020. +[30] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. +[31] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein, and Justin M. Solomon. Dynamic graph cnn for learning on point clouds. ACM Transactions on Graphics (TOG), 2019. +[32] S. Ye, Dongdong Chen, Songfang Han, Ziyu Wan, and Jing Liao. Meta-pu: An arbitrary-scale upsampling network for point cloud. IEEE transactions on visualization and computer graphics, PP, 2021. +[33] Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In International Conference on Machine Learning, pages 7164-7173, 2019. +[34] Minqing Zhang, Jiantao Gao, Zhen Lyu, Weibing Zhao, Qin Wang, Weizhen Ding, Sheng Wang, Zhen Li, and Shuguang Cui. Characterizing label errors: Confident learning for noisy-labeled image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 721-730. Springer, 2020. +[35] Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, 2018. +[36] Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip Torr, and Vladlen Koltun. Point transformer. arXiv preprint arXiv:2012.09164, 2020. \ No newline at end of file diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/images.zip b/learningwithnoisylabelsforrobustpointcloudsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..56b6c518d29058d553fd7ee6185d4790d8863116 --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a9fcf62ae3174a2651e61c1fb98eb0c301e87561da43a18a4ce26ee8166b1b8 +size 690757 diff --git a/learningwithnoisylabelsforrobustpointcloudsegmentation/layout.json b/learningwithnoisylabelsforrobustpointcloudsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d95fb01d8582dc07f1ad7fd685a38f840e3eadb9 --- /dev/null +++ b/learningwithnoisylabelsforrobustpointcloudsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed276389517850af7ad1b5384bf71d2371e976f0fa43aeb1f1f8c30941bd19d9 +size 374741 diff --git a/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_content_list.json b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8719b473496c10d526825a428d804bc1ecbdf813 --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b77080022aa6a50397383226402afbc7225ed17c2c5b3da04710745b69d8cca +size 84764 diff --git a/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_model.json b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..62c89082dc29032ec6ba555f81be97a86f8e923a --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c89b7d86707397cfc6406705619193f0987c063bce3bf2551b1d5a5a658c25c +size 102602 diff --git a/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_origin.pdf b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a0eb89f2d3719144a2c86f6cc1a99323ae97f36f --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/f8c57262-7714-4eef-87be-3674ee0e1ec0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c854f1301cd3b9604eb0942d3395420bc3d9b75603ee87fcd18cf402ad9103b +size 8256113 diff --git a/learningwithnoisylabelsviasparseregularization/full.md b/learningwithnoisylabelsviasparseregularization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1dfecf7bc7fc433a7a65c8d6eb67dcd6d8decb98 --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/full.md @@ -0,0 +1,356 @@ +# Learning with Noisy Labels via Sparse Regularization + +Xiong Zhou $^{1,2}$ Xianming Liu $^{1,2*}$ Chenyang Wang $^{1}$ Deming Zhai $^{1}$ Junjun Jiang $^{1,2}$ Xiangyang Ji $^{3}$ $^{1}$ Harbin Institute of Technology $^{2}$ Peng Cheng Laboratory $^{3}$ Tsinghua University + +{cszx,csxmcswcy,zhaideming,junjunjiang}@hit.edu.cn xyji@tsinghua.edu.cn + +# Abstract + +Learning with noisy labels is an important and challenging task for training accurate deep neural networks. Some commonly-used loss functions, such as Cross Entropy (CE), suffer from severe overfitting to noisy labels. Robust loss functions that satisfy the symmetric condition were tailored to remedy this problem, which however encounter the underfitting effect. In this paper, we theoretically prove that any loss can be made robust to noisy labels by restricting the network output to the set of permutations over a fixed vector. When the fixed vector is one-hot, we only need to constrain the output to be one-hot, which however produces zero gradients almost everywhere and thus makes gradient-based optimization difficult. In this work, we introduce the sparse regularization strategy to approximate the one-hot constraint, which is composed of network output sharpening operation that enforces the output distribution of a network to be sharp and the $\ell_p$ -norm ( $p \leq 1$ ) regularization that promotes the network output to be sparse. This simple approach guarantees the robustness of arbitrary loss functions while not hindering the fitting ability. Experimental results demonstrate that our method can significantly improve the performance of commonly-used loss functions in the presence of noisy labels and class imbalance, and outperform the state-of-the-art methods. The code is available at https://github.com/hitcszx/lnl_SR. + +# 1. Introduction + +Deep neural networks (DNNs) have achieved remarkable success on various computer vision tasks, such as image classification, segmentation, and object detection [7]. The most widely used paradigm for DNN training is the end-to-end supervised manner, whose performance largely relies on massive high-quality annotated data. However, collecting large-scale datasets with fully precise annotations (or called clean labels) is usually expensive and time-consuming, and sometimes even impossible. Noisy labels, + +![](images/dc0f49ed6f446018885a5bc1d23990f29a1830f7f25593510b03191b2cab0747.jpg) +(a) FL + +![](images/6c67202345fd958fee0044ac86af13774431f9300c8ce3955a84a99aeeff5e03.jpg) +(b) $\mathrm{{FL}} + \mathrm{{SR}}$ + +![](images/44f6ee753cedf86b9eeb155606f82d7d455a0c85e44ffd520d4b73653f9ad6a7.jpg) +(c) GCE + +![](images/7fd9e4efff2a3dfc13020e7b355315d7a72797eff9e2cd097082013d0bdbb7e6.jpg) +(d) GCE+SR +Figure 1. Visualization of learned representations on MNIST with 0.8 symmetric label noise. The representations learned by the proposed sparse regularization (SR)-enhanced methods are significantly discriminative than that learned by original losses, which are with more separated and clearly bound margin. + +which are systematically corrupted from ground-truth labels, are ubiquitous in many real-world applications, such as online queries [19], crowdsourcing [1], adversarial attacks [30], and medical images analysis [12]. On the other hand, it is well-known that over-parameterized neural networks have enough capacity to memorize large-scale data with even completely random labels, leading to poor performance in generalization [28, 1, 11]. Therefore, robust learning with noisy labels has become an important and challenging task in computer vision [25, 8, 12, 31]. + +To prevent over-fitting to mislabeled data, many strategies have been presented in the literature, among which robust loss function design is one of the most popular approaches since it enjoys simplicity and universality. Ghosh et al. [6] theoretically proved that a loss function would be inherently tolerant to symmetric label noise as long as + +it satisfies the symmetric condition. However, the derived loss functions according to this design principle, such as MAE [6] and Reverse Cross Entropy (RCE) [27], suffer from the underfitting effect on complicated datasets [3, 20]. As demonstrated in [29], the robustness of MAE can concurrently cause increased difficulty in training, leading to performance drops. On the other hand, the commonly-used CE and focal loss (FL) [18] enjoy the advantage of sufficient learning where the optimizer puts more emphasis on ambiguous samples, but they tend to overfit on noisy labels. + +How to achieve robustness and learning sufficiency simultaneously? This question has motivated a large amount of work to design new loss functions that are robust to noisy labels as well as easy to fit clean ones. For instance, Zhang et al. proposed a generalization of cross entropy (GCE) [29], which behaves like a generalized mixture of MAE and CE. Wang et al. proposed the Symmetric Cross Entropy (SCE) loss [27], which combines RCE with CE. However, both GCE and SCE just perform the trade-off between symmetric loss and CE, which are only partially robust to noisy labels. Ma et al. [20] theoretically proved that by applying a simple normalization, any loss can be made robust to noisy labels. However, the normalization operation actually changes the form of loss functions, which no longer preserve the original fitting ability. The authors further proposed the Active Passive Loss (APL) to remedy this problem, which is the combination of two symmetric losses. + +As reviewed above, all existing methods attempt to design new loss functions that satisfy the symmetric condition [6] to achieve robustness and achieve learning sufficiency meanwhile by combining multiple forms of loss function, such as symmetric loss and CE in [29, 27] and two symmetric losses in [20]. In this work, we propose a novel perspective to understand the symmetric condition, and prove in theory that any loss can be made robust through restricting the hypothesis class. Specifically, we demonstrate that label noise under risk minimization can be mitigated by restricting the network output to a permutation set of a fixed one-hot vector instead of modifying the loss function. This discrete process, however would result in many zero gradients, making the gradient-based optimization difficult. We then propose a sparse regularization strategy to approximate the one-hot constraint, which includes network output sharpening operation and $\ell_p$ -norm ( $p \leq 1$ ) regularization in risk minimization. Experimental results on synthesis and real-world datasets demonstrate that our method can significantly improve the performance of commonly-used loss functions in the presence of noisy labels, as illustrated in Fig. 1, and outperform the state-of-the-art robust loss functions. Moreover, we evaluate the sparse regularization strategy on the long-tailed and step-imbalanced image classification tasks, which demonstrates that SR can also mitigate class imbalance well. + +The main contributions of our work are highlighted as follows: + +- To the best of our knowledge, we are the first work in the literature to meet the symmetric condition by restricting the hypothesis class. It offers a novel perspective of understanding the symmetric condition and an alternative approach for robust learning. +- We theoretically prove that any loss function can be made robust to noisy labels by restricting the network output to the set of permutations over a fixed vector. +- We propose a simple but effective approach for robust training through sparse regularization. +- We provide a principled approach to simultaneously achieve robust training and preserve the fitting ability of commonly-used losses such as CE. + +# 2. The Proposed Method + +In this section, we first introduce some preliminaries about robust learning. Subsequently, we present our finding in theory that any loss function can achieve noise tolerance via network output permutation. Furthermore, we offer a simple but effective approach for robust learning by introducing sparse regularization in network training. Finally, we provide analysis about the merit of our scheme—achieve better tradeoff between robustness and sufficient learning. + +# 2.1. Preliminaries + +Risk Minimization. Assume $\mathcal{X} \subset \mathbb{R}^d$ is the feature space from which the examples are drawn, and $\mathcal{Y} = [k] = \{1,\dots,k\}$ is the class label space, i.e., we consider a $k$ -classification problem. In a typical classifier learning problem, we are given a training set, $\mathcal{S} = \{(\mathbf{x}_1,y_1),\ldots ,(\mathbf{x}_N,y_N)\}$ , where $(\mathbf{x}_i,y_i)$ is drawn i.i.d. according to an unknown distribution, $\mathcal{D}$ , over $\mathcal{X} \times \mathcal{Y}$ . The classifier is a mapping function from feature space to label space $h(\mathbf{x}) = \arg \max_{i}f(\mathbf{x})_{i}$ , where $f:\mathcal{X}\to \mathcal{C}$ denotes an approximation of $p(\cdot |\mathbf{x})$ , and $\mathcal{C} \subset [0,1]^k$ , $\forall \mathbf{c} \in \mathcal{C},\mathbf{1}^T\mathbf{c} = 1$ . In deep learning, $f(\mathbf{x})$ is usually modeled by a neural network ending with a softmax layer. + +The loss function is defined as a mapping $L: \mathcal{C} \times \mathcal{V} \to \mathbb{R}^+$ , where $\arg \min_{\mathbf{u} \in \mathcal{C}} L(\mathbf{u}, y) = \mathbf{e}_y$ , and $\mathbf{e}_y$ denotes the one-hot vector. In this work, we consider the loss functional $\mathcal{L}$ , where $\forall L \in \mathcal{L}$ , $L(\mathbf{u}, i) = \ell_1(u_i) + \sum_{j \neq i} \ell_2(u_j)$ , and $\ell_1$ as well as $\ell_2$ are two basic functions. For example, CE can be expressed by $\ell_1(u_i) = -\log u_i$ and $\ell_2(u_j) = 0$ . Given any loss function $L$ , and a classifier $f$ , the $L$ -risk of $f$ is + +$$ +R _ {L} (f) = \mathbb {E} _ {\mathcal {D}} [ L (f (\mathbf {x}), y) ] = \mathbb {E} _ {\mathbf {x}, y} [ L (f (\mathbf {x}), y) ], \quad (1) +$$ + +where $\mathbb{E}$ denotes expectation. Under the risk minimization framework, the objective is to learn an optimal classifier, $f^{*}$ , which is a global minimum of $R_{L}(f)$ . + +Noise Tolerance. We define the noise corruption process as that a clean label $y$ is flipped into a noisy version $\tilde{y}$ with probability $\eta_{\mathbf{x},\tilde{y}} = p(\tilde{y} | y, \mathbf{x})$ (more label noise settings can be found in [6]). The corresponding noisy $L$ -risk is + +$$ +R _ {L} ^ {\eta} (f) = \mathbb {E} _ {\mathcal {D}} [ (1 - \eta_ {\mathbf {x}}) L (f (\mathbf {x}), y) + \sum_ {i \neq y} \eta_ {\mathbf {x}, i} L (f (\mathbf {x}), i) ], +$$ + +where $\eta_{\mathbf{x}} = \sum_{i\neq y}\eta_{\mathbf{x},i}$ denotes the noise rate. Risk minimization under a given loss function is noise-tolerant if $R_L^\eta (f)$ shares the same global minimum as $R_{L}(f)$ . + +Symmetric Loss Functions. A symmetric loss function [22, 6] is proved to be noise-tolerant for a $k$ -class classification under symmetric noise if the noise rate $\eta < \frac{k - 1}{k}$ and the loss function satisfies + +$$ +\sum_ {i = 1} ^ {k} L (f (\mathbf {x}), i) = C, \forall \mathbf {x} \in \mathcal {X}, \forall f \in \mathcal {H}, \tag {2} +$$ + +where $C$ is a constant, and $\mathcal{H}$ is the hypothesis class. + +The symmetric condition (2) stated above guarantees the noise tolerance by risk minimization on a symmetric loss function, i.e., the classifier trained in noisy case has the same misclassification probability as that trained in noise-free case under the specified assumption. Moreover, if $R_{L}(f^{*}) = 0$ , $L$ is also noise-tolerant under an asymmetric noise, where $f^{*}$ is a global risk minimum of $R_{L}$ . + +# 2.2. Noise Tolerance via Output Permutation + +The symmetric condition (2) theoretically guarantees that a symmetric loss can lead to robust training. However, the derived loss functions according to this design principle usually suffer from underfitting [27, 3, 20]. On the other hand, the existing methods all pay attention to designing new loss functions, but never attempt to restrict the hypothesis class $\mathcal{H}$ to satisfy the symmetric condition. In this work, we propose to restrict the hypothesis class $\mathcal{H}$ such that any losses satisfy the symmetric condition (2) and thus become robust to label noise. Furthermore, we provide a theoretical analysis to demonstrate the noise tolerance of our scheme. The proofs can be seen in the supplementary materials. + +First of all, we provide the definition of permutation operation, which plays an important role in our derivation. + +Definition 1. For a vector $\mathbf{v} \in \mathbb{R}^k$ , the permutation operation on it is defined as [24]: + +$$ +\mathbf {v} _ {\pi} = P _ {\pi} \mathbf {v}, \tag {3} +$$ + +where $P_{\pi} = [\mathbf{e}_{\pi_1}, \mathbf{e}_{\pi_2}, \dots, \mathbf{e}_{\pi_k}]^T$ is the permutation matrix, and $\{\pi_1, \pi_2, \dots, \pi_k\} = [k]$ . + +According to this definition, it is easy to find that $\mathbf{v}$ and $\mathbf{v}_{\pi}$ share the same space, i.e., $\{v_{\pi_1}, v_{\pi_2}, \ldots, v_{\pi_k}\} = \{v_1, v_2, \ldots, v_k\}$ . For instance, when $k = 3$ , $\mathbf{v} = \{v_1, v_2, v_3\}$ + +and $\pi = [3,1,2]$ , then $P_{\pi} = [\mathbf{e}_3,\mathbf{e}_1,\mathbf{e}_2]^T$ , and the vector after permutation operation is $\mathbf{v}_{\pi} = (v_3,v_1,v_2)^T$ + +More generally, let $\mathcal{P}_{\mathbf{v}}$ denote the permutation set over $\mathbf{v}$ , we have + +$$ +\sum_ {i = 1} ^ {k} \ell \left(u _ {i}\right) = \sum_ {i = 1} ^ {k} \ell \left(v _ {i}\right), \forall \mathbf {u} \in \mathcal {P} _ {\mathbf {v}}. \tag {4} +$$ + +According to the above definition and derivation, we arrive at Lemma 1: + +Lemma 1. Given a vector $\mathbf{v}$ , $\forall L\in \mathcal{L}$ , we have + +$$ +\sum_ {i = 1} ^ {k} L (\mathbf {u}, i) = C, \quad \forall \mathbf {u} \in \mathcal {P} _ {\mathbf {v}}, \tag {5} +$$ + +where $C = \sum_{i=1}^{k} L(\mathbf{v}, i)$ is a constant when $\mathbf{v}$ is fixed. + +Lemma 1 indicates that, when the network output $\mathbf{u}$ is restricted to belong to a permutation set $\mathcal{P}_{\mathbf{v}}$ of a fixed vector $\mathbf{v}$ , any loss functions in $\mathcal{L}$ satisfy the symmetric condition. We further have the following theorems for symmetric and asymmetric noise that can be proved similarly as [6]: + +Theorem 1 (Noise tolerance under symmetric noise). In a multi-class classification problem, $\forall L\in \mathcal{L}$ $L$ is noisetolerant under symmetric label noise if $\eta < 1 - \frac{1}{k}$ and $f:\mathcal{X}\to \mathcal{P}_{\mathbf{v}}$ , i.e., + +$$ +\underset {f: \mathcal {X} \rightarrow \mathcal {P} _ {\mathbf {v}}} {\arg \min } R _ {L} (f) = \underset {f: \mathcal {X} \rightarrow \mathcal {P} _ {\mathbf {v}}} {\arg \min } R _ {L} ^ {\eta} (f), \tag {6} +$$ + +where $\mathbf{v}$ is a fixed vector. + +Theorem 2 (Noise tolerance under asymmetric noise). In a multi-class classification problem, let $f: \mathcal{X} \to \mathcal{P}_{\mathbf{v}}$ where $\mathbf{v}$ is a fixed vector, and suppose $L \in \mathcal{L}$ satisfy $0 \leq L(f(\mathbf{x}), i) \leq \frac{C}{k-1}, \forall i \in [k]$ . If $R_{L}(f^{*}) = 0$ , then $L$ is noise-tolerant under asymmetric or class-conditional noise when $\eta_{y,i} < 1 - \eta_{y}$ with $\sum_{k \neq y} \eta_{y,i} = \eta_{y}, \forall \mathbf{x}$ . + +Theorem 1 and 2 inspire us that label noise under risk minimization can be mitigated by restricting the network output to a permutation set instead of changing the loss function. This offers an alternative principle approach to achieve robust learning. However, the optimization is nontrivial when using gradient-based strategy because the constraint that $\mathcal{P}_{\mathbf{v}}$ is a discrete mapping produces many zero gradients. Instead, we turn to approximate the constraint by relaxing the output restriction of the hypothesis class with an error bound $\varepsilon$ , i.e., $\mathcal{H}_{\mathbf{v},\varepsilon} = \{f:\min_{\mathbf{u}\in \mathcal{P}_{\mathbf{v}}}\| f(\mathbf{x}) - \mathbf{u}\| _2\leq \varepsilon ,\forall \mathbf{x}\}$ . We can derive the risk bound as follows: + +Theorem 3. In a multi-class classification problem, if the loss function $L \in \mathcal{L}$ satisfies $\left| \sum_{i=1}^{k} (L(\mathbf{u}_1, i) - L(\mathbf{u}_2, i)) \right| \leq \delta$ when $\| \mathbf{u}_1 - \mathbf{u}_2 \|_2 \leq \varepsilon$ , and $\delta \to 0$ as $\varepsilon \to 0$ , + +then for symmetric label noise satisfying $\eta < 1 - \frac{1}{k}$ , the risk bound for $f \in \mathcal{H}_{\mathbf{v},\varepsilon}$ can be expressed as + +$$ +R _ {L} (f _ {\eta} ^ {*}) - R _ {L} (f ^ {*}) \leq 2 c \delta , +$$ + +where $c = \frac{\eta}{(1 - \eta)k - 1}$ , $f_{\eta}^{*}$ and $f^{*}$ denote the global minimum of $R_L^\eta (f)$ and $R_L(f)$ , respectively. + +Theorem 3 indicates that when restricting the output of the network to belong to $\mathcal{H}_{\mathbf{v},\varepsilon}$ , the noisy minimum $f_{\eta}^{*}$ , compared to the clean minimum $f^{*}$ , has a risk error bound $2c\delta$ . And when $\varepsilon \to 0$ , the bound also tends to 0. This implies that, by shrinking $\mathcal{H}_{\mathbf{v},\varepsilon}$ , $f_{\eta}^{*} = \arg \min_{f\in \mathcal{H}_{\mathbf{v},\varepsilon}}R_{L}^{\eta}(f)$ converges to $f^{*}$ . + +# 2.3. Robust Learning via Sparse Regularization + +Upon the above theoretical analysis, we propose a simple but effective approach for robust learning, which can make any losses robust to noisy labels by introducing sparse regularization on network output. Specifically, we consider the fixed vector $\mathbf{v}$ as a one-hot vector, i.e., we restrict the network output to one-hot vectors $\mathcal{P}_{0-1}$ . This discrete process would result in many zero gradients, making the optimization difficult. To approximate the one-hot constraint, we propose the sparse regularization strategy, which is composed of two modules: network output sharpening and $\ell_p$ -norm ( $p \leq 1$ ) regularization in risk minimization. + +Network Output Sharpening. The output sharpening module is to make the network output closer to a one-hot vector. One popular way to approximate a one-hot vector by the continuous mapping is to use a temperature-dependent softmax function, i.e., + +$$ +\sigma_ {\tau} (\mathbf {z}) _ {i} = \frac {\exp \left(z _ {i} / \tau\right)}{\sum_ {j = 1} ^ {k} \exp \left(z _ {j} / \tau\right)}, \tag {7} +$$ + +where $0 \leq \tau \leq 1$ , and $\sigma_{\tau}(\mathbf{z})_i$ is a point in the probability simplex. Note that, in the limit situation where $\tau \to 0$ , $\sigma_{\tau}(\mathbf{z})$ converges to a one-hot vector. In other words, with low temperatures, the distribution spends essentially all of its probability mass in the most probable state. Meanwhile, we may limit the value of $z_i$ to the range $[-1,1]$ by performing $\ell_2$ normalization before the output sharpening to prevent it from trivial scaling solution. + +$\ell_{p}$ -norm Regularization. We further introduce $\ell_{p}$ -norm regularization into risk minimization to promote the sparsity of network output. Specifically, we perform the following constrained risk minimization in network training: + +$$ +\min _ {f \in \mathcal {H}} R _ {L} (f) \quad \text {s . t .} \quad \| f \| _ {p} \leq \gamma , \tag {8} +$$ + +where $0 \leq p \leq 1$ , and $\gamma$ is an appropriately selected parameter. In practice, we can convert to train a neural network by minimizing the following form: + +![](images/c758291faa84d455dea4de247698d0ee5e728342e99b5d68723a8d755b9f626f.jpg) +(a) $\mathrm{CE + SR}$ + +![](images/641cb2caa7b92559253768fb2282e019d0e73503c15df5a5cc3a23177b0116ee.jpg) +(b) $\mathrm{FL + SR}$ +Figure 2. Test accuracy curve of different $\lambda$ on CIFAR-10 with 0.6 symmetric label noise. Robustness is improved when increasing the weight of $\ell_p$ -norm for both CE and FL. + +$$ +\sum_ {i = 1} ^ {N} L \left(f \left(\mathbf {x} _ {i}\right), \tilde {y} _ {i}\right) + \lambda \| f \left(\mathbf {x} _ {i}\right) \| _ {p} ^ {p}. \tag {9} +$$ + +It is worth noting that, if we define $L(\mathbf{u},i) = -\alpha \log u_i - \lambda u_i$ and $p = 1$ , then Eq. (9) is equivalent to the Symmetric Cross Entropy (SCE) loss [27]. Thus, SCE can be regarded as a special case of a loss function with the $\ell_p$ -norm regularization. + +For effective learning, the regularization parameter $\lambda$ in Eq. (9) cannot be set too large, since the network would tend to minimize $\lambda \| f(\mathbf{x}_i)\| _p^p$ rather than $L(f(\mathbf{x}_i),\tilde{y}_i)$ . As shown in Fig. 2(a), when $\lambda = 25$ and 30, although the curves look robust, they suffer from the underfitting effect. On the other hand, $\lambda$ should not be set too small, otherwise robustness cannot be guaranteed (see $\lambda \leq 7$ in Fig. 2(a)). We need a large enough $\lambda$ to maintain robustness. An effective strategy in practical implementation is to gradually increase the value of $\lambda$ during training, i.e., $\lambda_{t} = \lambda_{0}\cdot \rho^{\lfloor t / r\rfloor}$ $(\rho \geq 1)$ , where $t$ denotes the training epoch, and $r$ denotes the updating rate of $\lambda$ . + +# 2.4. On the Robustness and Learning Sufficiency + +In the following, we provide analysis about the robustness and learning sufficiency of the proposed scheme. + +To obtain enough robustness, we restrict the output of the network to be one-hot, which naturally satisfies the symmetric condition. As for the output sharpening process, the derivative of $\sigma_{\tau}(\mathbf{z})_j$ with respect to $z_{i}$ can be derived as + +$$ +\frac {\partial \sigma_ {\tau} (\mathbf {z}) _ {j}}{\partial z _ {i}} = \frac {1}{\tau} \sigma_ {\tau} (\mathbf {z}) _ {i} \left(\delta_ {i j} - \sigma_ {\tau} (\mathbf {z}) _ {j}\right), \tag {10} +$$ + +where $\delta_{ij} = \mathbb{I}(i = j)$ , and $\mathbb{I}(\cdot)$ is the identity function. We can see that the derivative is a scaled derivative of the original softmax function, so it would not change the optimization direction but change the step size. A larger step size in Eq. (10) would speed up the convergence to one-hot vectors. We can achieve this purpose by choosing an appropriate value for $\tau$ . On the other hand, we have $\lim_{\tau \to 0^{+}}\frac{\partial\sigma_{\tau}(\mathbf{z})_j}{\partial z_i} = 0$ , which shows that the gradient + +would disappear if $\tau$ is small, so $\tau$ cannot be overly small to prevent underfitting. We fix $\tau$ in our implementation for simplicity, but we suggest to gradually decay $\tau$ in training, which can be regarded as an early-stopping strategy [16]. + +Moreover, consider the loss $L(\sigma_{\tau}(\mathbf{z}),y) = -\log \sigma_{\tau}(\mathbf{z})_y$ we have the derivative of $-\log \sigma_{\tau}(\mathbf{z})_y + \lambda \| \sigma_{\tau}(\mathbf{z})\| _p^p$ with respect to $\mathbf{z}$ as follows + +$$ +\begin{array}{l} \frac {\partial - \log \sigma_ {\tau} (\mathbf {z}) _ {y}}{\partial \mathbf {z}} + \lambda \frac {\partial \| \sigma_ {\tau} (\mathbf {z}) \| _ {p} ^ {p}}{\partial \mathbf {z}} \\ = - \frac {1}{\sigma_ {\tau} (\mathbf {z}) _ {y}} \cdot \frac {\partial \sigma_ {\tau} (\mathbf {z}) _ {y}}{\partial \mathbf {z}} + \lambda p \sum_ {i = 1} ^ {k} \frac {1}{[ \sigma_ {\tau} (\mathbf {z}) _ {i} ] ^ {1 - p}} \cdot \frac {\partial \sigma_ {\tau} (\mathbf {z}) _ {i}}{\partial \mathbf {z}} \\ = \underbrace {- \left(\frac {1}{\sigma_ {\tau} (\mathbf {z}) _ {y}} - \frac {\lambda p}{\left[ \sigma_ {\tau} (\mathbf {z}) _ {y} \right] ^ {1 - p}}\right) \cdot \frac {\partial \sigma_ {\tau} (\mathbf {z}) _ {y}}{\partial \mathbf {z}}} _ {\text {f i t t i n g t e r m}} \\ + \underbrace {\lambda p \sum_ {i \neq y} \frac {1}{\left[ \sigma_ {\tau} (\mathbf {z}) _ {i} \right] ^ {1 - p}} \cdot \frac {\partial \sigma_ {\tau} (\mathbf {z}) _ {i}}{\partial \mathbf {z}}} _ {\text {c o m p l e m e n t a r y t e r m}} \\ \end{array} +$$ + +The fitting term denotes the gradient of learning towards the target $y$ , while the complementary term limits the increase of $\sigma_{\tau}(\mathbf{z})_i, \forall i \neq y$ . In the early phase of training, we guarantee enough fitting power by setting $\lambda p < 1$ . As $\lambda$ increases, the fitting term becomes weaker to mitigate label noise, but the complementary term still maintains a certain amount of fitting power through minimizing $\sigma_{\tau}(\mathbf{z})_i, \forall i \neq y$ to passively maximize $\sigma_{\tau}(\mathbf{z})_y$ . + +![](images/bd18dd856bf084d1c996de6a05b56d17089ac49c04c612c690677c1552a43817.jpg) +(a) Sparse Rate +Figure 3. Sparse rate and test accuracy of different methods on MNIST with 0.8 symmetric label noise. One-hot constraint significantly improves the robustness while not hindering fitting ability. + +![](images/a18fc23806e73da457bbf4eecce7649de9a56a1ad2e91a07c7a16562d93b7521.jpg) +(b) Test Accuracy + +On the other hand, we can regard the $\ell_p$ -norm regularized loss function $L(\mathbf{u},i) + \lambda \| \mathbf{u}\| _p^p$ as a new loss function. If there exists $\alpha >0$ , such that $L(\mathbf{u},i) + \alpha u_i^p$ is monotonically decreasing on $u_{i}$ , then the new loss can be divided into the active loss $L(\mathbf{u},i) + \alpha u_i^p$ and the passive loss $(\lambda -\alpha)u_i^p +\lambda \sum_{j\neq i}u_j^p$ . In fact, $\alpha$ always exists for commonly-used loss functions, for example, when $L(\mathbf{u},i) = -\log u_{i}$ , we have $\alpha < \frac{1}{p}$ such that $-\log u_{i} + \alpha u_{i}^{p}$ keeps monotonically decreasing on $u_{i}$ . Therefore, our proposed $\ell_p$ -norm regularization coincides with the Active Passive Loss proposed in [20]. The analysis demonstrates that + +![](images/83d9e227cb6c04757eeaf8a3a9ae5a7b7da12362fc7f1cba0687e05b5fe636a8.jpg) +(a) CE with different $p$ + +![](images/405ecc98463289ae14de1beb73cd2d75df4a30c5e221c812f7ba3c2c8d01eaff.jpg) +(b) CE with different $\tau$ +Figure 4. Test accuracy curve of different parameters on CIFAR-10 with 0.6 symmetric label noise. + +our scheme achieves the best of both worlds of robustness and sufficient learning. + +# 3. Experiments + +In this section, we empirically investigate the effectiveness of sparse regularization on synthetic datasets, including MNIST [15], CIFAR-10/-100 [14], and a real-world noisy dataset WebVision [17]. + +# 3.1. Empirical Analysis + +One-hot Constraint Means Robustness. We first run a set of experiments on MNIST with 0.8 symmetric label noise to analyse the sparse rate and test accuracy during training, where the sparse rate is formulated as $\frac{\sum_{i=1}^{N} \mathbb{I}(\max_j f(\mathbf{x}_i)_j > 1 - 0.01)}{N}$ , and $f(\mathbf{x}_i)$ is performed by the output sharpening with $\tau = 0.1$ . If $\max_j f(\mathbf{x}_i)_j > 1 - 0.01$ , then $\min_{\mathbf{u} \in \mathcal{P}_{0-1}} \|f(\mathbf{x}_i) - \mathbf{u}\|_2 \leq \sqrt{2} \cdot 0.01 = \varepsilon$ . We add the sparse regularization strategy to CE, FL and GCE, the results are shown in Fig. 3. As we can see, with the role of SR, the sparse rate usually maintains a high value after several epochs, and the test accuracy curves of $\mathrm{CE + SR}$ , FL+SR and GCE+SR show enough robustness and learning efficiency for model to mitigate label noise, while the original losses have low sparse rate and poor accuracy. This validates that the noise tolerance can be obtained by restricting the output of a network to one-hot vectors. + +Sparse Regularization can Mitigate Label Noise. As shown in Fig. 2, when we add SR to enhance the performance of CE and FL, the training process is increasingly robust as $\lambda$ increases while not hindering the fitting ability ( $\lambda \leq 20$ ). This demonstrates that learning with sparse regularization can be both robust and effective when mitigating label noise. The projected representations on MNIST are illustrated in Fig. 1. Under both settings, the representations learned by the SR-enhanced method are of significantly better quality than those learned by the original losses with more separated and clearly bounded clusters. + +Parameter Analysis. We choose the different parameters $\tau$ , $\lambda$ and $p$ for sparse regularization to CE. The experiments are conducted on CIFAR-10 with 0.6 symmetric noise. We + +![](images/5be4b03f8f6f4fbc8ee4dd18813e466ed226655251f7e6809728afb89148606e.jpg) +(a) CE with $\eta = 0.0$ + +![](images/f541595bab838f59510f126c4d6a564192df6089ccf7a152245e24c7b1ead39e.jpg) +(b) CE with $\eta = 0.2$ + +![](images/216576f44b2dbedf9c383dca7456777bb51aec8af42fd02029d8cb84fd969ad2.jpg) +(c) CE with $\eta = 0.4$ + +![](images/c8df691012624f2c450c760a30867b3a8931c5baa843f2b9c79275d87fa0340a.jpg) +(d) CE with $\eta = 0.6$ + +![](images/18203a02bc9f319d08a9602fb307fbddf2b72e22d6c4ea867c8f94692a1a1f28.jpg) +(e) CE with $\eta = 0.8$ + +![](images/141521c83d4d7acf8dcdccb7a3855b9e8d57457ab58dc9c45d4e021b89ec8015.jpg) +(f) $\mathrm{CE + SR}$ with $\eta = 0.0$ + +![](images/d9c565a6d613de4c6c73a420335785b011d5c439dcf8643aded1a4423acedffd.jpg) +(g) $\mathrm{CE + SR}$ with $\eta = 0.2$ + +![](images/58e488b54a5205b196a78c3472bc255a92b2b9c4e68430607c912cbe885aa1f2.jpg) +(h) $\mathrm{CE + SR}$ with $\eta = 0.4$ +Figure 5. Visualization of learned representations on MNIST with different symmetric label noise $(\eta \in [0.0, 0.2, 0.4, 0.6, 0.8])$ + +![](images/614f9e1850693c787d2baa8e12f0d4ce6b6de88ffe2fc939ad84f034f28b74da.jpg) +(i) $\mathrm{CE + SR}$ with $\eta = 0.6$ + +![](images/1949ee7ae4942d86ca9f6b5a900a84603c798c5044b08a0e737abd89e646a21c.jpg) +(j) $\mathrm{CE + SR}$ with $\eta = 0.8$ + +first tested $\tau \in \{0.01, 0.03, 0.1, 0.3, 0.5, 0.7, 0.9, 1\}$ while $\lambda = 0$ , and the results can be show in Fig. 4(b). When $\tau$ is small ( $\leq 0.003$ ), the curve is very robust, but it also suffers from significant underfitting problems. As $\tau$ increases, the curve falls into overfitting. Then we tested $\lambda \in \{0.1, 0.3, 1.0, 3.0, 5.0, 7.0, 10, 15, 20, 25, 30\}$ while $p = 0.1$ and $\tau = 1$ . As shown in Fig. 2, curve gets more robustness as $\lambda$ increases, but when $\lambda \geq 7$ , it encounters severe underfitting since the optimization pays more attention on minimizing $\lambda \| f(\mathbf{x}) \|_p^p$ . Moreover, we tuned $p \in \{0.01, 0.05, 0.1, 0.3, 0.5, 0.7, 0.9, 1\}$ while $\tau = 1$ and $\lambda = 5$ . The results in Fig. 4(a) show that both small $p$ and large $p$ tend to cause more overfitting to label noise, so we need choose an appropriate value. + +Remark. As for parameter tunings, a simple principled approach for parameter setting is that parameters with strong regularization are selected for simple datasets, and parameters with weak regularization are selected otherwise. Specifically, this can be achieved by setting proper $\lambda$ : the larger $\lambda$ , the stronger regularization effect. However, as shown in Fig. 2, the large initial $\lambda$ leads to underfitting since much attention is paid on minimizing $\lambda \| f(\mathbf{x})\|_p^p$ , especially when $\lambda \cdot p > 1$ . Instead, we turn to gradually increase $\lambda$ , i.e., $\lambda_t = \lambda_0 \cdot \rho^{\lfloor t / r \rfloor}$ , where $t$ is the iteration number and $r = 1$ ; $p = 0.1$ and $0.01$ , $\rho = 50^{1/120} \approx 1.03$ and $50^{1/200} \approx 1.02$ for CIFAR-10 and CIFAR-100 (where 120 and 200 represent the training epochs). The only parameter that requires careful tuning is $\lambda_0$ , which is set as $\lambda_0 < \frac{1}{p}$ . We use the similar parameter setting strategy for CIFAR-10, CIFAR-100, WebVision, and all achieve satisfactory results. + +# 3.2. Evaluation on Benchmark Datasets + +Experimental Details. The benchmark datasets, noise generation, networks, training details, parameter settings, more comparisons, and more experimental results can be found + +in the supplementary materials. + +Baselines. We experiment with the state-of-the-art methods GCE [29], SCE [27], NLNL [13], APL [20], and two effective loss functions CE and Focal Loss (FL) [18] for classification. Moreover, we add the proposed sparse regularization mechanism to CE, FL and GCE, i.e., $\mathrm{CE + SR}$ , $\mathrm{FL + SR}$ and $\mathrm{GCE + SR}$ . All the implementations and experiments are based on PyTorch. + +Results. The test accuracies (mean $\pm$ std) under symmetric label noise are reported in Table 1. As we can see, our proposed SR mechanism significantly improves the robustness of CE, FL, and GCE, which achieve the top 3 best results in most test cases across all datasets. In the scenarios of serious noise, our $\mathrm{CE + SR}$ , $\mathrm{FL + SR}$ have a very obvious improvement over the original losses. For example, on MNIST with 0.8 symmetric noise, $\mathrm{CE + SR}$ outperforms CE by more than $52\%$ . On CIFAR-10 with 0.8 symmetric noise, $\mathrm{CE + SR}$ outperforms CE by more than $31\%$ . As for CIFAR-100, GCE and APL outperform our method by a small gap for $\eta = 0.6$ and 0.8, but they failed in the cases with small noise rates. The reason is that the fitting ability is not enough, which can be derived according to the experiments in the clean case. When APL and GCE meet a complicated dataset CIFAR-100 in a clean setting, their test accuracies are worse than the commonly used losses CE and FL, while the SR-enhanced methods outperform the original losses and achieve an improvement of $\geq 0.86$ . Therefore, our methods not only have good robustness, but also guarantee and even improve the fitting ability. + +Results for asymmetric noise are reported in Table 2. Again, our methods significantly improve the robustness of the original version across all datasets and achieve top 3 best results in most cases. On MNIST, $\mathrm{CE + SR}$ and $\mathrm{FL + SR}$ outperform all the state-of-the-art methods over all asymmetric noise by a clear margin. More Surprisingly, the test + +Table 1. Test accuracies (%) of different methods on benchmark datasets with clean or symmetric label noise ( $\eta \in [0.2, 0.4, 0.6, 0.8]$ ). The results (mean±std) are reported over 3 random runs and the top 3 best results are **boldfaced**. + +
DatasetsMethodsClean (η=0.0)Symmetric Noise Rate (η)
0.20.40.60.8
MNISTCE99.15 ± 0.0591.62 ± 0.3973.98 ± 0.2749.36 ± 0.4322.66 ± 0.61
FL99.13 ± 0.0991.68 ± 0.1474.54 ± 0.0650.39 ± 0.2822.65 ± 0.26
GCE99.27 ± 0.0598.86 ± 0.0797.16 ± 0.0381.53 ± 0.5833.95 ± 0.82
SCE99.23 ± 0.1098.92 ± 0.1297.38 ± 0.1588.83 ± 0.5548.75 ± 1.54
NLNL98.85 ± 0.0598.33 ± 0.0397.80 ± 0.0796.18 ± 0.1186.34 ± 1.43
APL99.34 ± 0.0299.14 ± 0.0598.42 ± 0.0995.65 ± 0.1372.97 ± 0.34
CE+SR99.33 ± 0.0299.22 ± 0.0699.16 ± 0.0498.85 ± 0.0298.06 ± 0.86
FL+SR99.35 ± 0.0599.25 ± 0.0199.10 ± 0.1098.81 ± 0.0697.00 ± 1.28
GCE+SR99.27 ± 0.0699.13 ± 0.0799.06 ± 0.0298.84 ± 0.0998.37 ± 0.26
CIFAR-10CE90.48 ± 0.1174.68 ± 0.2558.26 ± 0.2138.70 ± 0.5319.55 ± 0.49
FL89.82 ± 0.2073.72 ± 0.0857.90 ± 0.4538.86 ± 0.0719.13 ± 0.28
GCE89.59 ± 0.2687.03 ± 0.3582.66 ± 0.1767.70 ± 0.4526.67 ± 0.59
SCE91.61 ± 0.1987.10 ± 0.2579.67 ± 0.3761.35 ± 0.5628.66 ± 0.27
NLNL90.73 ± 0.2073.70 ± 0.0563.90 ± 0.4450.68 ± 0.4729.53 ± 1.55
APL89.17 ± 0.0986.98 ± 0.0783.74 ± 0.1076.02 ± 0.1646.69 ± 0.31
CE+SR90.06 ± 0.0287.93 ± 0.0784.86 ± 0.1878.18 ± 0.3651.13 ± 0.51
FL+SR89.86 ± 0.1187.94 ± 0.1984.65 ± 0.0577.85 ± 0.7452.42 ± 0.76
GCE+SR90.02 ± 0.4087.93 ± 0.2784.82 ± 0.0677.65 ± 0.0551.97 ± 1.13
CIFAR-100CE71.33 ± 0.4356.51 ± 0.3939.92 ± 0.1021.39 ± 1.177.59 ± 0.20
FL70.06 ± 0.7055.78 ± 1.5539.83 ± 0.4321.91 ± 0.897.51 ± 0.09
GCE63.09 ± 1.3961.57 ± 1.0656.11 ± 1.3545.28 ± 0.6117.42 ± 0.06
SCE70.64 ± 0.0556.07 ± 0.2639.88 ± 0.6721.16 ± 0.657.63 ± 0.15
NLNL68.72 ± 0.6046.99 ± 0.9130.29 ± 1.6416.60 ± 0.9011.01 ± 2.48
APL67.95 ± 0.2164.21 ± 0.2457.70 ± 0.6445.20 ± 0.7524.91 ± 0.42
CE+SR72.19 ± 0.0667.51 ± 0.2960.70 ± 0.2544.95 ± 0.6517.35 ± 0.13
FL+SR72.08 ± 0.3167.64 ± 0.1060.67 ± 0.4844.76 ± 0.0817.16 ± 0.24
GCE+SR72.11 ± 0.2667.03 ± 0.4660.68 ± 0.9044.66 ± 0.8417.35 ± 0.42
+ +accuracy $(99.36 \pm 0.05)$ of $\mathrm{FL} + \mathrm{SR}$ under 0.4 asymmetric noise is higher than the clean case. On CIFAR-10 with 0.1 asymmetric noise, SCE has the best accuracy, but it loses the superiority in the other three cases where our method works much better than all other baselines with at least $1\%$ increase. On CIFAR-100, the enhanced loss functions show particularly superior performance in all cases. + +Representations. We further investigate the representations learned by CE+SR compared to those learned by CE. We extract the high-dimensional features at the second last full-connected layer, then project all test samples' features into 2D embeddings by t-SNE [26]. The projected representations on MNIST with different symmetric noise are illustrated in Fig. 5. As can be observed, CE encounters severe overfitting on label noise, and the embeddings look completely mixed when $\eta = 0.8$ . On the contrary, CE+SR learns good representations with more separated and clearly bounded clusters in all noisy cases. + +# 3.3. Evaluation on Real-world Noisy Dataset + +Here, we evaluate our sparse regularization method on large-scale real-world noisy dataset WebVision 1.0 [17]. It contains 2.4 million images with real-world noisy labels, + +which crawled from the web using 1,000 concepts in ImageNet ILSVRC12 [5]. Since the dataset is very big, for quick experiments, we follow the training setting in [11] that only takes the first 50 classes of the Google resized image subset. We evaluate the trained network on the same 50 classes of WebVision 1.0 validation set, which can be considered as a clean validation set. We add sparse regularization to CE and GCE. The training details follow [20], where for each loss, we train a ResNet-50 [10] by using SGD for 250 epochs with initial learning rate 0.4, nesterov momentum 0.9, weight decay $3 \times 10^{-5}$ , and batch size 512. The learning rate is multiplied by 0.97 after every epoch of training. All the images are resized to $224 \times 224$ . Typical data augmentations including random width/height shift, color jittering, and random horizontal flip are applied. As shown in Table 3, our proposed SR mechanism obviously enhances the performance of CE and FL, which outperforms the existing loss functions SCE and APL with a clear margin ( $\geq 2.2\%$ ). This verifies the effectiveness of SR against real-world label noise. + +More Comparison. We also compare with Co-teaching[9], which is the representative work of sample selection, and PHuber-CE [23], which is a simple variant of gradient clip + +Table 2. Test accuracies $(\%)$ of different methods on benchmark datasets with clean or asymmetric label noise $(\eta \in [0.1, 0.2, 0.3, 0.4])$ . The results (mean±std) are reported over 3 random runs and the top 3 best results are boldfaced. + +
DatasetsMethodsAsymmetric Noise Rate (η)
0.20.30.4
MNISTCE94.56 ± 0.2288.81 ± 0.1082.27 ± 0.40
FL94.25 ± 0.1589.09 ± 0.2582.13 ± 0.49
GCE96.69 ± 0.1289.12 ± 0.2481.51 ± 0.19
SCE98.03 ± 0.0593.68 ± 0.4385.36 ± 0.17
NLNL98.35 ± 0.0197.51 ± 0.1595.84 ± 0.26
APL98.89 ± 0.0496.93 ± 0.1791.45 ± 0.40
CE+SR99.27 ± 0.0699.24 ± 0.0899.23 ± 0.07
FL+SR99.31 ± 0.0299.23 ± 0.0299.36 ± 0.05
GCE+SR99.22 ± 0.0299.13 ± 0.0599.09 ± 0.02
CIFAR-10CE83.32 ± 0.1279.32 ± 0.5974.67 ± 0.38
FL83.37 ± 0.0779.33 ± 0.0874.28 ± 0.44
GCE85.93 ± 0.2380.88 ± 0.3874.29 ± 0.43
SCE86.20 ± 0.3781.38 ± 0.3575.16 ± 0.39
NLNL84.74 ± 0.0881.26± 0.4376.97 ± 0.52
APL86.50 ± 0.3183.34 ± 0.3977.14 ± 0.33
CE+SR87.70 ± 0.1985.63 ± 0.0779.29 ± 0.20
FL+SR87.56 ± 0.2985.10 ± 0.2379.07 ± 0.50
GCE+SR87.55 ± 0.0884.69 ± 0.4679.01 ± 0.18
CIFAR-100CE58.11 ± 0.3250.68 ± 0.5540.17 ± 1.31
FL58.05 ± 0.4251.15 ± 0.8441.18 ± 0.68
GCE59.35 ± 1.1053.83 ± 0.6440.91 ± 0.57
NLNL50.19 ± 0.5642.81 ± 1.1335.10 ± 0.20
SCE58.16 ± 0.7350.98 ± 0.3341.54 ± 0.52
APL62.80 ± 0.0556.74 ± 0.5342.61 ± 0.24
CE+SR64.79 ± 0.0159.09 ± 2.1049.51 ± 0.59
FL+SR64.61 ± 0.6758.94 ± 0.3346.94 ± 1.68
GCE+SR64.35 ± 0.7857.22 ± 0.8049.51 ± 1.31
+ +Table 3. Top-1 validation accuracies (\%) on WebVision validation set of ResNet-50 models trained on WebVision using different loss functions, under the Mini setting in [11]. + +
LossCEFLSCEAPLCE+SRFL+SR
Acc66.9663.8066.9266.3269.1270.28
+ +ping. As shown in Table 4, our method works better than Co-teaching and PHuber-CE. + +Table 4. A comparison with other methods + +
DatasetMethodLabel Noise Type
sy 0.6sy 0.8asy 0.3asy 0.4
CIFAR-10CE38.7019.5579.3274.67
Co-teaching65.7438.0164.0151.26
PHuber-CE75.4441.1876.0655.78
CE+SR78.1851.1385.6379.29
CIFAR-100CE21.397.5950.6840.17
Co-teaching34.287.9442.8233.67
PHuber-CE21.549.3326.9123.43
CE+SR44.9517.3559.0949.51
+ +# 3.4. Additional Experiments + +Imbalanced Classification. As shown in Table 3, our method achieves the best result on WebVision that has a certain class imbalance. To better show the performance on class imbalance, we additionally test the ability of SR on the pure imbalanced classification task. We first follow the controllable data imbalance in [21] to create the imbalanced CIFAR-10/-100 by reducing the number of training examples and keeping the validation set unchanged. We also consider two imbalance types: long-tailed imbalance[4] and step imbalance [2]. The results shown in Table 5 are encouraging, where CE with sparse regularization achieves a very significant improvements compared with CE in all cases. Albeit simple, these additional experiments demonstrate that SR can also mitigate class imbalance well. + +Table 5. Validation accuracy on imbalanced CIFAR-10/-100. + +
DatasetMethodImbalanced Type
lt-0.01lt-0.1step-0.01step-0.1
CIFAR-10CE64.1681.8157.4479.35
CE+SR69.7884.4961.0382.11
CIFAR-100CE35.1751.4337.9253.43
CE+SR41.2459.5140.2158.42
+ +# 4. Conclusion and Future Work + +In this paper, we presented a novel method for learning with noisy labels. We first provided a theoretical conclusion that any loss can be made robust to noisy labels by restricting the output of a network to a permutation set of any fixed vector. According to this principle, subsequently, we proposed a simple but effective strategy for robust learning through sparse regularization, which is the approximation of the constraint of one-hot permutation. The meanings of sparse regularization are two-fold: the network output sharpening operation is designed to enforce the output distribution of a network to be sharp, and the $\ell_p$ -norm $(p \leq 1)$ regularization is tailored to promote the network output to be sparse. Experimental results demonstrated the superior performance of the proposed method over the SOTA methods on both synthetic and real-world datasets. Moreover, we additionally experiment with imbalanced classification, and the results are encouraging, which demonstrates that sparse regularization can also mitigate class imbalance well. + +Overall, this paper has investigated the one-hot constraint, i.e., restricting the output to a permutation set over a one-hot vector. In future research, a promising direction is replacing the one-hot vector with a fixed smoothing vector. + +# Acknowledgments + +This work was supported by National Natural Science Foundation of China under Grants 61922027, 62071155 and 61932022. + +# References + +[1] Devansh Arpit, Stanislaw Jastrzebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning, pages 233-242. PMLR, 2017. +[2] Mateusz Buda, Atsuto Maki, and Maciej A Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249-259, 2018. +[3] Nontawat Charoenphakdee, Jongyeong Lee, and Masashi Sugiyama. On symmetric losses for learning from corrupted labels. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 961-970, Long Beach, California, USA, 09-15 Jun 2019. PMLR. +[4] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9268-9277, 2019. +[5] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248-255. IEEE, 2009. +[6] Aritra Ghosh, H. Kumar, and P. S. Sastry. Robust loss functions under label noise for deep neural networks. In AAAI, 2017. +[7] Ian Goodfellow, *Yoshua Bengio*, Aaron Courville, and *Yoshua Bengio. Deep learning*, volume 1. MIT press Cambridge, 2016. +[8] B. Han, Quanming Yao, T. Liu, Gang Niu, I. Tsang, James T. Kwok, and M. Sugiyama. A survey of label-noise representation learning: Past, present and future. ArXiv, abs/2011.04406, 2020. +[9] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor W Tsang, and Masashi Sugiyama. Coteaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018. +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[11] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pages 2304–2313. PMLR, 2018. +[12] Davood Karimi, Haoran Dou, Simon K Warfield, and Ali Gholipour. Deep learning with noisy labels: Exploring techniques and remedies in medical image analysis. Medical Image Analysis, 65:101759, 2020. +[13] Youngdong Kim, Junho Yim, Juseung Yun, and Junmo Kim. NInl: Negative learning for noisy labels. In Proceedings + +of the IEEE International Conference on Computer Vision, pages 101-110, 2019. +[14] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 1, 01 2009. +[15] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +[16] Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International Conference on Artificial Intelligence and Statistics, pages 4313-4324. PMLR, 2020. +[17] Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data. 08 2017. +[18] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. +[19] Wei Liu, Yu-Gang Jiang, Jiebo Luo, and Shih-Fu Chang. Noise resistant graph ranking for improved web image search. In CVPR 2011, pages 849-856. IEEE, 2011. +[20] Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. Normalized loss functions for deep learning with noisy labels. In ICML, 2020. +[21] Andrew Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th annual meeting of the association for computational linguistics: Human language technologies, pages 142-150, 2011. +[22] N. Manwani and P. S. Sastry. Noise tolerance under risk minimization. IEEE Transactions on Cybernetics, 43(3):1146-1151, 2013. +[23] Aditya Krishna Menon, Ankit Singh Rawat, Sashank J Reddi, and Sanjiv Kumar. Can gradient clipping mitigate label noise? In International Conference on Learning Representations, 2020. +[24] Sebastian Prillo and Julian Eisenschlos. SoftSort: A continuous relaxation for the argsort operator. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 7793-7802. PMLR, 13-18 Jul 2020. +[25] Hwanjun Song, Minseok Kim, Dongmin Park, and Jae Gil Lee. Learning from noisy labels with deep neural networks: A survey. 2020. +[26] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. +[27] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In IEEE International Conference on Computer Vision, 2019. +[28] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representation, 2017. + +[29] Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, 2018. +[30] Mingyi Zhou, Jing Wu, Yipeng Liu, Shuaicheng Liu, and Ce Zhu. Dast: Data-free substitute training for adversarial attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 234-243, 2020. +[31] Xiong Zhou, Xianming Liu, Junjun Jiang, Xin Gao, and Xi-angyang Ji. Asymmetric loss functions for learning with noisy labels. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 12846–12856. PMLR, 18–24 Jul 2021. \ No newline at end of file diff --git a/learningwithnoisylabelsviasparseregularization/images.zip b/learningwithnoisylabelsviasparseregularization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e72203bee94e4f6118fab382d4806bb1608acf1f --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a093139e30131ddd739af230a4fc5393e15183f71bd42bf38afadcc8b3ee9402 +size 813492 diff --git a/learningwithnoisylabelsviasparseregularization/layout.json b/learningwithnoisylabelsviasparseregularization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..31ee5e7270e8dc9df492d94df12bc7590d009fd1 --- /dev/null +++ b/learningwithnoisylabelsviasparseregularization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c1836c9efc020cb95bd1f0d4ff3dd92aa8f8057610a0f2f3ebd237eda5695ec +size 558227 diff --git a/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_content_list.json b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c3cb502b7fe3e4e96e534f98287eddd0bb82f379 --- /dev/null +++ b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc6d719184196b3198764d386e48d6cec60de17dc6ee609a8698c004362edf8c +size 84988 diff --git a/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_model.json b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f3cf8fa41997aadf9f06b14a9567a023fb3e2b3e --- /dev/null +++ b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1131490b84a52617ff7c815108cd11674b88f1ccad02d66a545b59866740b31 +size 106207 diff --git a/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_origin.pdf b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a5973ebfa05955e7f624386bc311c44d03d6cec2 --- /dev/null +++ b/learningwithprivilegedtasks/28e045f1-0ed3-4f3a-ba1e-d5fb01e9e340_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b10cf2024c46ab96d933c7da644d279acf43ed8c591e4b2a20b20e3522e3d18 +size 1645824 diff --git a/learningwithprivilegedtasks/full.md b/learningwithprivilegedtasks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b57d0a7e770065b7e421ae3a3808559a63260844 --- /dev/null +++ b/learningwithprivilegedtasks/full.md @@ -0,0 +1,404 @@ +# Learning with Privileged Tasks + +Yuru Song $^{1}$ Zan Lou $^{2}$ Shan You $^{2,3*}$ Erkun Yang $^{4*}$ + +Fei Wang5 Chen Qian2 Changshui Zhang3 Xiaogang Wang2,6 + +1University of California San Diego 2SenseTime Research + +$^{3}$ Department of Automation, Tsinghua University + +Institute for Artificial Intelligence, Tsinghua University (THUAI) + +Beijing National Research Center for Information Science and Technology (BNRist) + +$^{4}$ Xidian University $^{5}$ University of Science and Technology of China + +$^{6}$ Chinese University of Hong Kong + +yus027@ucsd.edu, {louzan,youshan,qianchen}@sensetime.com, erkunyang@gmail.com + +wangfei91@mail.ustc.edu.cn, zcs@mail.tsinghua.edu.cn, xgwang@ee.cuhk.edu.hk + +# Abstract + +Multi-objective multi-task learning aims to boost the performance of all tasks by leveraging their correlation and conflict appropriately. Nevertheless, in real practice, users may have preference for certain tasks, and other tasks simply serve as privileged or auxiliary tasks to assist the training of target tasks. The privileged tasks thus possess less or even no priority in the final task assessment by users. Motivated by this, we propose a privileged multiple descent algorithm to arbitrate the learning of target tasks and privileged tasks. Concretely, we introduce a privileged parameter so that the optimization direction does not necessarily follow the gradient from the privileged tasks, but concentrates more on the target tasks. Besides, we also encourage a priority parameter for the target tasks to control the potential distraction of optimization direction from the privileged tasks. In this way, the optimization direction can be more aggressively determined by weighting the gradients among target and privileged tasks, and thus highlight more the performance of target tasks under the unified multi-task learning context. Extensive experiments on synthetic and real-world datasets indicate that our method can achieve versatile Pareto solutions under varying preference for the target tasks. + +# 1. Introduction + +Besides designing strong model structures [32, 46, 35, 13, 34] and informative task losses [19, 48, 5, 44, 52], multitask learning (MTL) [50, 38] is apt to enhance performance + +and efficiency by seeking more appropriate ways to combine multiple tasks, and increasingly gains much research interest. The paradigm of MTL has been shown to outperform single-task learning (STL) on numerous computer vision problems, such as attribute recognition [51], scene understanding [24] and autonomous driving [9]. To exploit the task correlations, current MTL approaches mainly follow a soft-parameter or hard-parameter sharing principle. In soft-parameter sharing, tasks are aggregated separately and cross-talks [28] among these tasks are usually used to encourage shared knowledge. Nevertheless, the intricacy of designing the cross-talks is specific to particular problem sets, and does not scale well to many tasks. In contrast, hard-parameter sharing leverages a unique backbone to pursue direct shared representation of tasks [1, 2], along with task-specific sub-networks. Therefore, hard-parameter sharing is able to reduce parameter size in proportion to the task number, and to promote inference speed during testing. + +Though parameters among tasks are shared in a hard manner, how to balance all tasks still matters for MTL. Task balancing to circumvent this difficulty goes beyond naive uniform weighting of tasks [51]. Existing heuristics to find appropriate weighting of multiple tasks include grid searching, exploring task uncertainties [10], and gradient normalization [6]. Recent avant-garde method is to treat the MTL as multi-objective optimization (MOO-MTL) [33]. It proposes to find the Pareto front that only allows the common improvement of tasks rather than sacrificing any individual. Task weights are evaluated dynamically during learning. + +Current MTL methods treat all tasks equally, and focus on the average performance of all tasks during inference. In practice, however, users may only need to scrutinize the performance of some target tasks rather than that of + +![](images/f52deaffd83b038bfd2282c385f52b2e351cba4f83c0feaccb1ecc1c16f147b5.jpg) +Figure 1: Learning with Privileged Tasks (PTL) endows some tasks with adjustable privilege to assist the target tasks. When the privileged parameter is low or zero, the trade-off is less or not biased towards the target tasks. When the privileged parameter is high, the target task performance is prioritized during training. + +all tasks. One natural solution for such scenario is to learn only the target tasks solely. However, this practice neglects the potential benefits from other tasks. In contrast, our aim is to include all tasks under MTL context, but non-target tasks only serve as privileged tasks1 to assist the training of target tasks, and are irrelevant for the performance evaluation by users. Some literature also refers auxiliary tasks as the privileged tasks. However, they either focus on design auxiliary tasks for target tasks [29], or does not consider the intrinsic conflicts and competitions among tasks [45]. Conflicts may exist naturally between target and privileged tasks, or even within the target tasks themselves. Existing variants of MOOMTL also model this problem with preference [22, 27, 26]. Nevertheless, the preference vectors are usually defined in the loss space. Designing these vectors requires a priori information of the individual loss magnitudes on the Pareto front. In practice, users often fail to provide an approximation of the Pareto front. + +In this paper, we cast the learning of target and privileged tasks (PTL) in a unified multi-objective optimization problem [33] to manage the correlation and conflict between target and privileged tasks simultaneously. Instead of considering the loss space, we examine the task priority in the gradient space, and proposes a privileged multiple gradient descent algorithm (P-MGDA) to amplify the performance of target tasks. Concretely, for each mini-batch we introduce a privileged parameter so that the descent direction does not necessarily follow the gradients of privileged tasks, but concentrates more on the target tasks. In this way, we can flexibly moderate the conflict or competition between target and privileged tasks. Moreover, we also encourage a priority term to regulate direction correction towards the target tasks. In this way, when the target task and privileged tasks only cooperate, we can still ensure the consistent ex + +ploitation of the privileged tasks. + +Our approach, privileged task learning (PTL), introduces parameters working on the gradient space, so that we can control them to achieve versatile Pareto critical points to cater user preference as shown in Figure 1. We optimize our proposed P-MGDA by an efficient hybrid-block coordinate descent (CD) algorithm. Extensive experiments on both synthetic and real datasets validate the effectiveness of our PTL. Results show that PTL is able to find the solution that not only has overall satisfactory performance across all tasks but especially good for the target task. + +# 2. Related work + +Auxiliary learning in multi-task learning. Recent review such as [37] offers an extensive and detailed survey of the auxiliary tasks in the MTL setting. There are diverse ways to form the auxiliary tasks. In PAD-Net [43], intermediate auxiliary outputs from the network are trained to help the main tasks. The feature space of the main task is directly built upon that of the auxiliary tasks. Du et al. proposed that there should be a similarity between the main tasks and the constructed auxiliary tasks for the MTL to be effective [15]. Their proposed method measures the similarities between the main and auxiliary tasks using cosine similarity, based on task gradients. Weight balancing for auxiliary tasks proposed by [45] drives positive transfer and suppresses negative transfer by leveraging class-wise weights in the learning process, and exploits the helpful information from the auxiliary tasks. Whereas in our setting, privileged tasks and auxiliary tasks have identical placements. + +Multi-objective optimization with preference. Following the pivotal framework brought by [33], extensions of the MOOMTL mostly try to expand the Pareto front. In Pareto-MTL [22], reference vectors are used to guide the MOO searching, which leads to a set of solutions with different trade-off among all tasks. [27] improves Pareto-MTL and strictly solves the preference-specific Pareto solutions, which sit exactly along the reference vectors. In [26], continuous solutions are found in the vicinity of a Pareto solution. Our framework can also cater user preference by tuning the priority and privileged parameters. + +Learning using privileged information (LUPI). LUPI [40, 25, 39] assumes each example corresponds to a regular feature and an additional privileged feature, so the privileged features can be used to boost the performance of trained models [47, 36, 49, 41]. However, privileged features are not involved or even available during inference. We name our method privileged tasks inspired by this analogy, but there are significant differences in the problem setting. In LUPI, both regular and privileged features are subject to the same single task; in our PTL, examples correspond to multiple and maybe different tasks, and privileged tasks are to boost the target tasks. + +# 3. Revisiting MGDA in Multi-objective MTL + +We formalize the multi-objective optimization problem of MTL as follows [33]. Assume there are $M$ tasks with the index set as $\mathcal{I}$ . Denote the shared parameters of the network as $\theta$ , and the updated $\theta$ at training step $\tau$ as $\pmb{\theta}^{(\tau)}$ . But we will dismiss $\tau$ for short in the following. Each task, $t$ , has its own task-specific network, with parameters $\pmb{\theta}^t, t \in \mathcal{I}$ . And the whole parameter set for the MTL network is $\{\pmb{\theta}, \pmb{\theta}^t, t \in \mathcal{I}\}$ . The input space is $\mathcal{X}$ , and the output space of the task $t$ is $\mathcal{Y}^t, t \in \mathcal{I}$ . The dataset is therefore $\{x_i, y_i^1, y_i^2, \ldots, y_i^T\}_{i \in [N]}$ , where $N$ is the size of the dataset. Each task has its loss function as $l^t(\pmb{\theta}^t, \pmb{\theta})$ . When working with the shared parameter $\pmb{\theta}$ , the task-specific parameter $\pmb{\theta}^t$ will be dismissed in notation for short. + +Our goal is to find appropriate weighting vector, $c^t$ , to formulate the scalar loss, $\sum_{t\in \mathcal{I}}c^{t}\ell^{t}$ , such that all of its components, task-specific losses, are jointly optimized to the most during learning. Towards a moderation of the task conflicts, we take a worthy detour by considering the vectorized loss, $(\ell^1,\ell^2,\dots ,\ell^T)$ , leveraging the existing framework of multi-objective optimization. The essential conviction is to find the Pareto optimal solution of all the objectives [12], defined below. + +Definition 1 (Pareto optimality for MTL). (a). A solution $\pmb{\theta}$ dominates a solution $\bar{\pmb{\theta}}$ if $\ell^t (\pmb {\theta},\pmb {\theta}^t)\leq \ell^t (\bar{\pmb{\theta}},\pmb {\theta}^t)$ for all tasks $t$ and $(\ell^{1}(\pmb {\theta},\pmb{\theta}^{t}),\ell^{2}(\pmb {\theta},\pmb{\theta}^{t}),\dots ,\ell^{T}(\pmb {\theta},\pmb{\theta}^{t}))\neq$ $(\ell^{1}(\bar{\boldsymbol{\theta}},\boldsymbol{\theta}^{t}),\ell^{2}(\bar{\boldsymbol{\theta}},\boldsymbol{\theta}^{t}),\dots ,\ell^{T}(\bar{\boldsymbol{\theta}},\boldsymbol{\theta}^{t}))$ . (b). A solution $\pmb{\theta}^{\star}$ is called Pareto optimal if there exists no solution $\pmb{\theta}$ that dominates $\pmb{\theta}^{\star}$ + +Instead of solving the Pareto optimal point, the multiple gradient descent algorithm (MGDA) [12, 17] turns to a necessary Pareto critical point by leveraging the Karush-Kuhn-Tucker (KKT) condition. As in [17, 33, 22], the minimization problem + +$$ +\min _ {v, \boldsymbol {d}} \left(v + \frac {1}{2} \| \boldsymbol {d} \| ^ {2}\right), s. t. \langle \nabla \ell_ {\boldsymbol {\theta}} ^ {m}, \boldsymbol {d} \rangle \leq v, m \in \mathcal {I}. \tag {1} +$$ + +satisfy the following Lemma 1. + +Lemma 1. [17, 33, 22] Let $(\pmb{d}, v)$ be the solution of problem (1), + +1. If $\pmb{\theta}$ is Pareto critical, then $d = 0$ and $v = 0$ . +2. If $\pmb{\theta}$ is not Pareto critical, then + +$$ +v \leq - (1 / 2) \| \boldsymbol {d} \| ^ {2} < 0 \tag {2} +$$ + +$$ +\nabla \ell_ {\boldsymbol {\theta}} ^ {m} \leq v, \forall m \in \mathcal {I} +$$ + +In other words, either the solution of problem (1) is 0 thus there is no direction to improve all tasks at the same time, or the solution leads to a descent direction that improves all tasks. Then recent multi-objective MTL methods + +(e.g., MOO-MTL [33] and Pareto-MTL [22]) adopt MGDA to solve the MTL problem by considering its dual problem + +$$ +\min _ {\boldsymbol {\alpha}} \frac {1}{2} \| \sum_ {m \in \mathcal {I}} \alpha_ {m} \nabla_ {\boldsymbol {\theta}} \ell^ {m} \| ^ {2}, \text {s . t .} \sum_ {m \in \mathcal {I}} \alpha_ {m} = 1, \alpha_ {m} \geq 0. \tag {3} +$$ + +with the optimal solution $d^{*}$ of Eq.(1) and optimal solution $\alpha^{*}$ of Eq.(3) satisfying + +$$ +\boldsymbol {d} ^ {*} = \sum_ {m \in \mathcal {I}} \alpha_ {m} ^ {*} \nabla_ {\boldsymbol {\theta}} \ell^ {m}, \text {s . t .} \sum_ {m \in \mathcal {I}} \alpha_ {m} ^ {*} = 1, \alpha_ {m} ^ {*} \geq 0. \tag {4} +$$ + +To elude the time-consuming operation of calculating the gradient over parameter $\nabla_{\theta}\ell$ , [33, 22, 14] found an upper bound (MGDA-UB) of $\| \sum_{m\in \mathcal{I}}\alpha_m\nabla_\theta \ell^m\|$ , by computing $\| \sum_{m\in \mathcal{I}}\alpha_m\nabla_Z\ell^m\|$ . $\nabla_{Z}\ell^{m}$ is the gradient over the shared intermediate representations. + +# 4. Privileged MGDA with Task Priority + +We expand the MGDA based on the following consideration. Despite the effectiveness of finding Pareto solutions, the MTL problem can have numerous optimal tradeoffs among the tasks, but the single solution obtained by MOOMTL might not serve or even contravene the specific preference from the user. To alleviate this scenario, we further consider the existence of privileged tasks, which serves to assist the training of the target task and are of less concern at inference stage. Therefore the privileged tasks are allowed to recess moderately during learning. These potentially deteriorated privileged tasks are denoted by index set $\mathcal{I}_p$ . And the target task is denoted by index set $\mathcal{I}_t$ . Assume there are $M_t$ target tasks and $M_p$ privileged tasks. The total number of both target and privileged tasks is $M_t + M_p$ , which will be interchangeably written as $M$ . Consider the inequality constraint in Problem (1), + +$$ +\langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} \rangle \leq v. \tag {5} +$$ + +It guarantees that the amount of descent is no less than $|v|$ . This applies to both target tasks and privileged tasks. But when task conflict or competition arises, this constraint can be relaxed for the privileged tasks, which will give priority to the target tasks. We solidify and justify this idea as follows. + +# 4.1. Slack descent for privileged tasks + +We introduce slack variables $\xi_{i}\geq 0$ in the Eq. (5) for the privileged tasks, which can be learned during training and flexibly moderate the task conflicts. The resulted descent direction might increase the loss function for the privileged tasks, as $\xi_{j}$ could be large enough and $v + \xi_{j}$ is positive. To avoid unnecessary sacrifice of the privileged task, we set an upper bound of $\pmb{\xi}$ with the regularization parameter $C_1\geq 0$ + +And the slack descent model is concreted in Eq. (6) + +$$ +\left\langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} \right\rangle \leq v + \xi_ {j}, \forall j \in \mathcal {I} _ {p}. \tag {6} +$$ + +In the corresponding dual problem, we have new constraint for the coefficient of the privileged tasks as + +$$ +0 \leq \alpha_ {j} \leq C _ {1}, \forall j \in \mathcal {I} _ {p}. \tag {7} +$$ + +$C_1$ controls the scope of privilege and is decided by the user. Under the simple case with two task learning, there is only one target task $l_t$ and one privileged task $l_p$ . $\sum_{m=1}^{M} \alpha_m \nabla_\theta \ell_m(\pmb{\theta})$ is reduced to the summation of only two scaled gradients, $\alpha_1 \nabla l_t + \alpha_2 \nabla l_p$ . $C_1$ sets the upper bound of $\alpha_2$ , i.e., the largest possible consideration for the privileged task during training. Therefore $C_1$ determines how close the descent direction locates to the gradient of the target task, shown by the upper panel of Figure 2. Large $C_1$ gives space for $\alpha_2$ , therefore promotes the proportion of privileged task during training while small $C_1$ limits the participation of privileged tasks and prioritizes more the target tasks accordingly. + +# 4.2. Direction correction with priority + +Degeneracy of Eq. (6) happens when there is no conflict between target and privileged tasks, as loss ascent for privileged task will only be redundant. To consistently exploit the privileged tasks, we further demand larger improvement only for the target tasks, disregarding the privileged tasks. Such request is established by additional inequality constraints. In other words, $\langle \nabla_{\theta}\ell_{i}(\pmb {\theta}),\pmb {d}\rangle \leq$ $\langle \nabla_{\pmb{\theta}}\ell_{j}(\pmb {\theta}),\pmb {d}\rangle ,\forall i\in \mathcal{I}_{t},j\in \mathcal{I}_{p}$ . This will introduce additional term, $\sum_{i\in \mathcal{I}_t}\sum_{j\in \mathcal{I}_p}\beta_{ij}(\nabla_\pmb {\theta}\ell_i(\pmb {\theta}) - \nabla_\pmb {\theta}\ell_j(\pmb {\theta}))$ in the dual problem, where $\beta_{ij}\ge 0$ stands for the multiplier for each pair of the inequality constraint in Eq. (8). We can interpret this term as further correction for the descent direction, which bends the optimization even towards the target tasks + +$$ +\langle \nabla_ {\boldsymbol {\theta}} \ell_ {i} (\boldsymbol {\theta}), \boldsymbol {d} \rangle \leq \langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} \rangle + \eta_ {i j}, \forall i \in \mathcal {I} _ {t}, j \in \mathcal {I} _ {p}. \tag {8} +$$ + +However, prioritizing each target task over the privileged task may shrink the feasible set excessively. To relax this constraint appropriately, we also introduce learnable slack variable $\eta_{ij} \geq 0$ , which can be regularized by parameter $C_2 \geq 0$ . Similarly, additional constraints on $\beta_{ij}$ will be introduced in the dual problem as + +$$ +\beta_ {i j} \leq C _ {2}, \forall i \in \mathcal {I} _ {t}, j \in \mathcal {I} _ {p}. \tag {9} +$$ + +There could be the case that for $i\in \mathcal{I}_p,\alpha_i < \sum_{j\in \mathcal{I}_p}\beta_{ij}$ And the coefficient of $\nabla_{\theta}\ell_{i}$ in $\pmb{d}$ is negative. In this case, $\pmb{d}$ will not be a convex combination of the task gradients. To avoid the collapse of the MGDA approach, we further exert + +![](images/73b90163074e71947159923adb80815e1a59dd6477e0fd2d05c0947c686e8036.jpg) +(a) Slack descent for privileged tasks. + +![](images/7248ce6a91e2529fef4c60b2acb5535d547571fcbc7f1d567d716ce4addbb6f9.jpg) +(b) Direction correction prioritizes the target tasks. +Figure 2: Geometric interpretation. (a). Privileged parameter biases the descend direction towards target task to a controllable extent. (b). Direction correction further push the descent direction towards the target task. In whole, this illustrates the theoretical effectiveness of PTL. + +the following constraint so that $\alpha_{i}, i \in \mathcal{I}_{p}$ is large enough, as + +$$ +\sum_ {i \in \mathcal {I} _ {t}} \beta_ {i j} \leq \alpha_ {j}, \forall j \in \mathcal {I} _ {p}. \tag {10} +$$ + +Again we refer two task learning for illustrative analysis of the model, shown in Figure 2. In this case $\sum_{i\in \mathcal{I}_t}\sum_{j\in \mathcal{I}_p}\beta_{ij}(\nabla_\theta \ell_i(\pmb {\theta}) - \nabla_\pmb {\theta}\ell_j(\pmb {\theta}))$ is as simple as $\beta_{12}(\nabla l_t - \nabla l_p)$ . Larger $\beta_{12}$ corresponds to greater correction for the direction towards the target task. Such correction is bounded by $C_2$ , and thus adjustable according to user preference. + +# 4.3. Theoretical analysis + +With the slack descent of the privileged tasks and direction correction towards the target tasks, the PTL model is summarized as follows + +$$ +\begin{array}{l} \min _ {\boldsymbol {d}, v, \boldsymbol {\xi}, \boldsymbol {\eta}} v + C _ {1} \cdot \sum_ {j \in \mathcal {I} _ {a}} \xi_ {j} + C _ {2} \cdot \sum_ {i \in \mathcal {I} _ {p}} \sum_ {j \in \mathcal {I} _ {a}} \eta_ {i j} + \frac {1}{2} \| \boldsymbol {d} \| ^ {2}, \\ \begin{array}{l} \text {s . t .} \langle \nabla_ {\boldsymbol {\theta}} \ell_ {i} (\boldsymbol {\theta}), \boldsymbol {d} \rangle \leq v, \forall i \in \mathcal {I} _ {t}, \end{array} \\ \langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} \rangle \leq v + \xi_ {j}, \xi_ {j} \geq 0, \forall j \in \mathcal {I} _ {p}, \\ \langle \nabla_ {\boldsymbol {\theta}} \ell_ {i} (\boldsymbol {\theta}), \boldsymbol {d} \rangle \leq \langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} \rangle + \eta_ {i j}, \\ \eta_ {i j} \geq 0, \forall i \in \mathcal {I} _ {t}, \forall j \in \mathcal {I} _ {p}. \tag {11} \\ \end{array} +$$ + +By means of the Lagrangian multiplier, the dual problem of the PTL problem is formalized as follows + +$$ +\begin{array}{l} \min _ {\boldsymbol {\alpha}, \boldsymbol {\beta}} \frac {1}{2} \| \sum_ {m = 1} ^ {M} \alpha_ {m} \nabla_ {\boldsymbol {\theta}} \ell_ {m} (\boldsymbol {\theta}) + \\ \sum_ {i \in \mathcal {I} _ {t}} \sum_ {j \in \mathcal {I} _ {p}} \beta_ {i j} (\nabla_ {\boldsymbol {\theta}} \ell_ {i} (\boldsymbol {\theta}) - \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta})) \| ^ {2}, \\ \text {s . t .} \sum_ {m \in \mathcal {I}} \alpha_ {m} = 1, 0 \leq \alpha_ {j} \leq C _ {1}, \forall j \in \mathcal {I} _ {p}, \tag {12} \\ 0 \leq \beta_ {i j} \leq C _ {2}, \forall i \in \mathcal {I} _ {t}, \forall j \in \mathcal {I} _ {p}, \\ \sum_ {i \in \mathcal {I} _ {t}} \beta_ {i j} \leq \alpha_ {j}, \forall j \in \mathcal {I} _ {p}. \\ \end{array} +$$ + +where $\alpha \in \mathbb{R}^{M},\beta \in \mathbb{R}^{M_{t}\times M_{p}}$ . Following Lemma 1, we can also prove that the direction $d$ can indeed improve the target tasks while keeping the privileged tasks controllably improved or declined, as Theorem 1. + +Theorem 1. Following Lemma 1, let $(\pmb{d}^{*}, v^{*}, \pmb{\xi}^{*}, \pmb{\eta}^{*})$ be the solution of Problem (11). + +1. If $d^{*} = 0$ , then the solution is Pareto critical; +2. If $\mathbf{d}^* \neq \mathbf{0}$ , then target tasks and the privileged tasks that satisfy $-\| \mathbf{d} \|^2 - C_1 \sum_{j \in \mathcal{I}_p} \xi_j^* - C_2 \sum_{i \in \mathcal{I}_t} \sum_{j \in \mathcal{I}_p} \eta_{ij}^* + \xi_j^* < 0$ will descend: + +$$ +\begin{array}{l} \forall i \in \mathcal {I} _ {t}, \langle \nabla_ {\boldsymbol {\theta}} \ell_ {i} (\boldsymbol {\theta}), \boldsymbol {d} ^ {*} \rangle \leq v ^ {*} \\ = - \| \boldsymbol {d} \| ^ {2} - C _ {1} \sum_ {j \in \mathcal {I} _ {t}} \xi_ {j} ^ {*} - C _ {2} \sum_ {i \in \mathcal {I} _ {t}} \sum_ {j \in \mathcal {I} _ {p}} \eta_ {i j} ^ {*}, \tag {13} \\ \end{array} +$$ + +$$ +\begin{array}{l} \forall j \in \mathcal {I} _ {p}, \langle \nabla_ {\boldsymbol {\theta}} \ell_ {j} (\boldsymbol {\theta}), \boldsymbol {d} ^ {*} \rangle \leq v ^ {*} + \xi_ {j} ^ {*} \\ = - \| \boldsymbol {d} \| ^ {2} - C _ {1} \sum_ {j \in \mathcal {I} _ {p}} \xi_ {j} ^ {*} - C _ {2} \sum_ {i \in \mathcal {I} _ {t}} \sum_ {j \in \mathcal {I} _ {p}} \eta_ {i j} ^ {*} + \xi_ {j} ^ {*}. \\ \end{array} +$$ + +Theorem 1 can be proved similarly as Lemma 1. Detailed proofs refer to the supplementary materials. Note that instead of using the gradient over parameters, we also use gradient over shared intermediate representations in PTL for efficiency. In the sequel, we proceed to solve the dual Problem (12) with a novel hybrid coordinate descent method, or, the "HybridSolver". Our learning algorithm is summarized in Algorithm 1. + +# 4.4. Optimization + +In this section, we describe our approach for solving the dual problem (12). For succinct formulation, let $\nabla_t = [,\nabla_\theta \ell_m(\pmb {\theta}),] \in \mathbb{R}^{d\times M_t}$ , $m\in \mathcal{I}_t$ , and $\nabla_{p} = [,\nabla_{\pmb{\theta}}\ell_{m}(\pmb {\theta}),]\in \mathbb{R}^{d\times M_{p}}$ , $m\in \mathcal{I}_p$ . Then Eq.(11) can be rewritten as + +$$ +\begin{array}{l} \min _ {\pmb {\alpha}, \pmb {\beta}} \frac {1}{2} \left\| [ \nabla_ {t}, \nabla_ {p} ] \pmb {\alpha} + \nabla_ {t} \pmb {\beta} \mathbf {1} _ {p} - \nabla_ {p} \pmb {\beta} ^ {T} \mathbf {1} _ {t} \right\| ^ {2}, \\ \text {s . t .} \quad \boldsymbol {\alpha} ^ {T} \mathbf {1} = 1, \quad \boldsymbol {\beta} ^ {T} \mathbf {1} _ {t} \leq \boldsymbol {\alpha} _ {p}, \tag {14} \\ 0 \leq \alpha_ {p} \leq C _ {1}, \quad 0 \leq \beta \leq C _ {2}. \\ \end{array} +$$ + +Algorithm 1: Learning under privileged tasks + +Initialization; + +for $m\gets 1$ to $M$ do + +Compute task specific gradients: + +$$ +\nabla_ {\boldsymbol {\theta} ^ {m}} l _ {m} (\boldsymbol {\theta} ^ {m}, \boldsymbol {\theta}) +$$ + +Update task specific parameters: + +$$ +\boldsymbol {\theta} ^ {m} = \boldsymbol {\theta} ^ {m} - \nabla_ {\boldsymbol {\theta} ^ {m}} l _ {m} (\boldsymbol {\theta} ^ {m}, \boldsymbol {\theta}) +$$ + +end + +Compute shared gradients: $[\nabla_t, \nabla_p]$ + +Solve Eq. (14): $\alpha, \beta = \mathrm{HYBRIDSORVER}(\theta)$ + +Update shared parameters: + +$$ +\boldsymbol {\theta} = \boldsymbol {\theta} - r \cdot ([ \nabla_ {t}, \nabla_ {p} ] \boldsymbol {\alpha} + \nabla_ {t} \boldsymbol {\beta} \mathbf {1} _ {p} - \nabla_ {p} \boldsymbol {\beta} ^ {T} \mathbf {1} _ {t}) +$$ + +where $\alpha \in \mathbb{R}^{M},\beta \in \mathbb{R}^{M_{t}\times M_{p}}$ .We use $\pmb {x} = [\pmb {\alpha},\hat{\pmb{\beta}} ]$ $\hat{\beta}$ is the vectorization of $\beta$ that satisfies $\beta \mathbf{1}_p = A\hat{\beta}$ $\mathbf{1}_t^T\boldsymbol {\beta} =$ $\hat{\beta} P$ $Q$ is the positive semi-definite matrix calculated from the inner products of the task gradients and their subtractions. Refer to the supplementary materials for the explicit expression of $Q$ + +This problem can relate with one class support vector machine's (OC-SVM) dual problem in their formats. One efficient method for this kind of optimization is the coordinate descent (CD) method (or decomposition method [7]). It iteratively optimizes along a few coordinates in a working set $B$ each time. Each iteration solves one sub-problem of optimization. Due to the constraint $\alpha^T\mathbf{1} = 1$ on $\alpha$ , we apply the selection method of $B$ in [8]. For $\beta$ , random selection of the coordinates has been shown to be effective [3]. In our case, the sub-problems can be formulated in (15) and (16) below. + +$$ +\begin{array}{l} \min _ {\alpha_ {i}, \alpha_ {j}} Q _ {i i} \alpha_ {i} ^ {2} + Q _ {j j} \alpha_ {j} ^ {2} + 2 Q _ {i j} \alpha_ {i} \alpha_ {j} \\ + 2 \sum_ {x _ {k} \notin \left\{\alpha_ {i}, \alpha_ {j} \right\}} \left(Q _ {i k} \alpha_ {i} + Q _ {j k} \alpha_ {j}\right) x _ {k} \\ \end{array} +$$ + +$$ +\begin{array}{l} \begin{array}{l l} \text {s . t .} & \alpha_ {i} + \alpha_ {j} = 1 - \sum_ {x _ {k} \not \in \{\alpha_ {i}, \alpha_ {j} \}} \alpha_ {k}, \end{array} \\ 0 \leq \alpha_ {j} \leq C _ {1}, \forall i \in \mathcal {I} _ {t}, \tag {15} \\ \sum_ {j} \beta_ {i j} \leq \alpha_ {j} \leq C _ {1}, \forall i \in \mathcal {I} _ {p}. \\ \end{array} +$$ + +$$ +\begin{array}{l} \min \quad Q _ {i i} \hat {\beta} _ {i} ^ {2} + 2 \sum_ {k} Q _ {i k} \hat {\beta} _ {i} x _ {k} \\ \beta_ {i} \quad x _ {k} \notin \{\beta_ {i} \} \tag {16} \\ \begin{array}{l} \text {s . t .} \quad 0 \leq \hat {\beta} _ {i} \leq \min (C _ {2}, \alpha_ {k} - \sum_ {j} \beta_ {j k}), \hat {\beta} _ {i} \in \{\beta_ {j k} \}. \end{array} \\ \end{array} +$$ + +Selecting working set $B$ influences the speed of convergence. Some heuristics have been proposed for linear SVM. As has been discussed in [8], the inherent linear constraint + +in the OC-SVM's dual problem will slow down the convergence in the CD procedure. Since a linear constraint may cause a sub-problem to be already optimal and thus the variables cannot be updated [3]. To alleviate this, the authors proposed two-level CD methods for OC-SVM. But in our case, the linear constraint only applies partially to $\alpha$ . We introduce the following hybrid CD algorithm to tackle the problem. The gist is that when optimizing along $\alpha$ , we apply the two-level CD in [8] to accelerate the optimization, and when optimizing along $\beta$ , we use the dual CD in [3] to exploit its success. The details of selecting method is in supplementary material. Solving the dual problem Eq. (14) is summarized in Algorithm 2 in supplementary materials. + +# 5. Experimental Results + +In this section, we evaluate our algorithm's performance on synthetic as well as real-world tasks, including MultiMNIST and its variants [31, 42], CelebA [23] and CIFAR100 [21]. We compare with the following algorithms: + +- STL: single task learning where tasks are trained once at a time; +- t-MOOMTL: only learning the target tasks with MOOMTL; +- MOOMTL: finding one Pareto optimal solution for multi-objective optimization problem [33]; +- GradNorm: using the normalization proposed by [6]; +- Uncertainty: using the uncertainty weighting [10]; +- Uniform Scaling: linear scalarization of tasks with equal weights; +- Pareto-MTL: decomposing the multi-objective optimization problem into a set of constrained subproblems with different trade-off preferences [22]. + +# 5.1. Synthetic Data + +We analyze our model with synthetic data from [22]. There are two non-convex objectives to be minimized, shown in Eq. (17), where $x \in \mathbb{R}^n$ . Our algorithm can generate the subset of Pareto fronts with different preference towards the target task $l_1$ , as shown in Figure 3. Pareto-MTL [22] can also generate distributed solutions on the Pareto front. MOOMTL [33] fails to extend the solution set towards any desired region, whereas linear scalarization (Lin-Scalar) only finds the extreme solutions. + +$$ +\begin{array}{l} l _ {1} (x) = 1 - e ^ {- \| x - \frac {1}{\sqrt {n}} \| _ {2} ^ {2}}, \tag {17} \\ l _ {2} (x) = 1 - e ^ {- \| x + \frac {1}{\sqrt {n}} \| _ {2} ^ {2}}. \\ \end{array} +$$ + +![](images/38e7e287f88ac54c76e5f91cea3967201aa8ea5b8fbc023aea1aee45893f9cd2.jpg) + +![](images/65dbe63e0589956c152c73eb8e5c07da0f74c9f862cb1a863747885f4c57f9aa.jpg) +Figure 3: Synthetic dataset performance. (a). The obtained solutions of linear scalarization of the target and privileged tasks. (b). The obtained solutions of MOOMTL. (c). The obtained solutions of a Pareto-MTL. (d). The obtained solution from PTL in present work. The x-axis is the loss for the target task and the y-axis is the loss for the privileged task. The proposed PTL successfully generates a set of widely distributed Pareto solutions that can sacrifice the privileged task based on user preference. Details of the synthetic example can be found in section 5. + +![](images/bca4d43d4b97c14a2dc255cb46576d590cb9aeaf11d09ba5d8487bab2b0d4fce.jpg) + +![](images/e95696716b6f1e7288b0a8e54ad4a21b07ff957f683583d076c0365b4925db16.jpg) + +# 5.2. Multi-MNIST and Multi-Fashion + +Dataset and Task Description In the Multi-MNIST dataset, each image has two digits. In the Multi-Fashion dataset, each image has two fashion icons. In the Multi-MNISTFashion dataset, each image has one digit on the left and one fashion icon on the right. We followed [31] to generate the three datasets. There are two tasks: 1) classifying the top-left image, and 2) classifying the bottom-right image. We use the first task as target task and the other as the privileged one. Each dataset has 60,000 training images and 10,000 test images. The objectives are the cross entropy loss. + +Network Architecture The backbone network is a modified LeNet [42]. Our network starts from two convolutional layers with a $5 \times 5$ kernel and a stride of 1 pixel. The two layers have 10 and 20 channels respectively. A fully connected layer of 50 channels appends the convolutional layers, which is then followed by two 10-channel fully connected layers, one for each task. We add a $2 \times 2$ max pooling layer right after each convolutional layer and use ReLU as the nonlinear function. The performance of the target task + +![](images/54dcbe7c40502e5309b22a753147ff3c5e47bd01c8db845107e817c20285844a.jpg) +Figure 4: Results on Multi-MNIST, Multi-Fashion and Multi-FashionMNIST. The x-axis is the accuracy of the target task, and the y-axis is the accuracy of the privileged task. + +![](images/329bb6c03b54fdee5ee4cf2f399170227dc9f67e398f04dd595b767de4da3fcd.jpg) + +![](images/df479d18188da45f453d56ec57c8b8f329520968f60d486d9c4e3c9e24e5c51e.jpg) + +are summarized in Table 1. + +Table 1: Performance on the Multi-MNIST and its variants. + +
MethodMultiMNISTFashionFashionMNIST
STL97.23%80.93%93.80%
GradNorm [6]96.27%78.86%90.43%
Uncertainty [10]96.47%79.26%89.80%
MOOMTL [33]97.26%80.14%92.26%
Pareto-MTL [22]91.92%82.75%95.07%
PTL (ours)97.80%86.71%96.09%
+ +PTL improves the accuracy of the state-of-the-art results by $0.57\%$ , $4\%$ and $1\%$ on Multi-MNIST, Multi-Fashion and Multi-MNISTFashion. As PTL can prioritize the target task, such improvements are as prediction by our theoretical analysis. Figure 4 shows the trade-offs between target and privileged tasks under current methods. PTL can generate multiple solutions under different $C_1$ and $C_2$ values specified by the user. Although Pareto-MTL [22] can also achieve multiple solutions, its overall performance fails to compete with ours. Our method also maintains the best performance for the privileged task on Multi-MNIST and Multi-Fashion, which might result from the mutually beneficial task setting. + +# 5.3. Results of More Tasks + +Now we investigate the comprehensive effectiveness of our proposed method PTL on more datasets with various task types and number of tasks. We randomly select half of tasks as target tasks and the rest as privileged tasks by default if not illustrated explicitly. + +Cityscapes. Cityscapes [11] is a large dataset for road scene understanding, labelled with instance and semantic segmentation from 20 classes. The dataset consists of 2,975 training and 500 validation images. 1,525 images are withheld for testing on an online evaluation server. Our en + +coder is based on DeepLabV3 [4]. We use ResNet101 [18] as the base feature encoder, followed by an Atrous Spatial Pyramid Pooling (ASPP) module [4] to increase contextual awareness. And we take semantic segmentation as the target task. + +CelebA. CelebA dataset [23] includes 200K face images annotated with 40 attributes. Each attribute is a binary classification task and therefore this can be modified into a 40-way MTL problem. We divide the target-privileged task sets by taking the hardest 23 tasks as the target ones, and the remaining tasks are privileged tasks. Following [33], we use ResNet-18 [18] without the final layer as a shared representation function. Since there are 40 attributes, we add 40 separate $2048 \times 2$ dimensional fully-connected layers as task-specific functions. The final two-dimensional output is passed through a 2-class softmax function to get binary attribute classification probabilities. We use cross-entropy as a task-specific loss. + +CIFAR-100. Following [21], we split the CIFAR-100 dataset [21] into 20 tasks, where each task is a 5-way classification problem. The shared architecture has four convolution layers that have $3 \times 3$ convolution and 32 filters, with batch normalization and one ReLU following them. There are 20 task-specific FC layers. We report the test accuracy for all 20 tasks. + +PASCAL. PASCAL dataset [16] includes 20 classification labels for 11540 images. We modify the dataset into a 20-way MTL problem. The 10 target tasks are randomly selected from all the tasks, and the remaining 10 tasks are the privileged tasks. We use SENet-101 as the shared architecture [20] with a head for binary classification per task. + +ImageNet-100. We randomly select 100 classes from the ImageNet [30] dataset to form a 100-way MTL classification problem. We randomly select $50\%$ tasks as target tasks and the rest $50\%$ tasks as privileged tasks. We use ResNet-50 [18] as the backbone with a head for binary clas + +Table 2: Average performance of target tasks for different task types (↑ for prediction accuracy and ↓ for error). + +
Cityscapes ↑CelebA ↓CIFAR-100 ↓PASCAL ↑ImageNet-100 ↑
#tasks2402020100
task typedense segmentationbinary attributemulti-classbinary attributebinary classification
tMOOMTL64.35%28.55%17.76%81.30%78.31%
Uncertainty [10]-13.46%20.65%--
MOOMTL [33]65.95%13.94%19.86%77.13%75.90%
PTL (ours)66.75%11.94%16.72%83.56%79.46%
+ +sification per task. + +Results. As in Table 2 and Figure 5, our algorithm on average can improve the SOTA results by $1.4\%$ for all datasets, implying the efficacy of including privileged learning in MTL. In our experiments, the number of tasks ranges from 2 to 100, suggesting the applicability of our algorithm at different scales. For CelebA dataset, we observe that tMOOMTL has extremely low performance. We infer that it is due to the fierce competition between the hard tasks within the target task set. But the PTL method can alleviate the competition and significantly improve the performance. In addition, our experiments include the shared-network that ranges from 4-layered convolutional network, ResNet-18, ResNet-50, ResNet-101 and SENet-101. This shows that our algorithm is effective under various neural architectures and sizes. + +![](images/02ca864d818722ff65158b3f853db0b5e3975ba371eb29073199503c624bc041.jpg) +Figure 5: Prediction error of individual target tasks. + +![](images/a5c46a74f36ade0f857ce2aca5af1170697d51ae988e64962c51fdc78ddbe5b1.jpg) + +Ablation Study on the Effect of Parameters $C_1$ and $C_2$ in Eq.(14). To show the effect of parameters $C_1$ and $C_2$ in Eq.(14), we perform ablation study with CIFAR100 dataset. The 10 targeted tasks are randomly selected from the 20 5-way classification problems, and the remaining 10 tasks are used as the privileged tasks. For investigation of $C_1$ , we set $C_2$ as 0, i.e. no direction correction against the privileged tasks. During the investigation of $C_2$ , $C_1$ is set as 0.1, which highlights the impact from direction correction. We report the average error of the targeted tasks and the privileged tasks. The results are shown in Figure 6. When $C_1$ increases from 0 to 1, the performance peaks at around $C_1 = 0.17$ with error as $16.52\%$ . When $C_2$ increases from + +![](images/fe9e20ff37cdb297b78dfea874c203d955e39aa7e07f1c35d1dd40daad4f719c.jpg) +(a) Effect of $C_1$ + +![](images/00ba2f307446174d7d3501db8d420536bdcd2d9787b6424ebc5c23e39fe534b4.jpg) +(b) Effect of $C_2$ +Figure 6: Ablation study on CIFAR100 dataset. + +$1e - 4$ to 1, the performance peaks around $C_2 = 0.82$ with error as $16.18\%$ . Altogether, it shows that appropriate amount of slack descent for the privileged tasks helps the performance of the targeted tasks, and that additional direction correction can further improve learning of the targeted tasks. + +# 6. Conclusion + +We present the learning with privileged task framework that generalizes the MOO-MTL algorithm, which is adaptable to the user's preference for the certain tasks. The model consists of slack descent of the privileged tasks and the direction correction towards the target tasks. We strictly prove the effectiveness of PTL using the KKT condition and provides illustrative analysis of the model. The novel hybrid block coordinate descent method can solve the dual problem efficiently. PTL can achieve state-of-the-art performance on both synthetic and real-world datasets. Further analysis of the effect of task correlation and conflict under this model would be helpful. Theoretical improvement on the relationship between our model and the $\epsilon$ -Pareto optimality could be future direction. + +# Acknowledgment + +This work is funded by the National Key Research and Development Program of China (No. 2018AAA0100701) and the NSFC 61876095. Shan You is supported by Beijing Postdoctoral Research Foundation. + +# References + +[1] Jonathan Baxter. A model of inductive bias learning. J. Artif. Int. Res., 12(1):149-198, Mar. 2000. 1 +[2] Rich Caruana. Multitask Learning. Machine Learning, 28(1):41-75, 1997. 1 +[3] Kai-Wei Chang, Cho-Jui Hsieh, and Chih-Jen Lin. Coordinate descent method for large-scale 12-loss linear support vector machines. Journal of Machine Learning Research, 9(45):1369-1398, 2008. 5, 6 +[4] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. CoRR, abs/1706.05587, 2017. 7 +[5] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR, 2020. 1 +[6] Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. GradNorm: Gradient normalization for adaptive loss balancing in deep multitask networks. volume 80 of Proceedings of Machine Learning Research, pages 794-803, Stockholm, Sweden, 10-15 Jul 2018. PMLR. 1, 6, 7 +[7] Chih-Chung Chang, Chih-Wei Hsu, and Chih-Jen Lin. The analysis of decomposition methods for support vector machines. IEEE Transactions on Neural Networks, 11(4):1003-1008, jul 2000. 5 +[8] Hung-Yi Chou, Pin-Yen Lin, and Chih-Jen Lin. Dual coordinate-descent methods for linear one-class SVM and SVDD. In Proceedings of SIAM International Conference on Data Mining (SDM), 2020. 5, 6 +[9] S. Chowdhuri, T. Pankaj, and K. Zipser. Multinet: Multi-modal multi-task learning for autonomous driving. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1496-1504, 2019. 1 +[10] R. Cipolla, Y. Gal, and A. Kendall. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7482-7491, 2018. 1, 6, 7, 8 +[11] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The Cityscapes Dataset for Semantic Urban Scene Understanding. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), jun 2016. 7 +[12] Jean Antoine Désideri. Multiple-gradient descent algorithm (MGDA) for multiobjective optimization. Comptes Rendus Mathematique, 350(5-6):313-318, mar 2012. 3 +[13] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. 1 +[14] Shangchen Du, Shan You, Xiaojie Li, Jianlong Wu, Fei Wang, Chen Qian, and Changshui Zhang. Agree to disagree: Adaptive ensemble knowledge distillation in gradient + +space. Advances in Neural Information Processing Systems, 33, 2020. 3 +[15] Yunshu Du, Wojciech M. Czarnecki, Siddhant M. Jayakumar, Razvan Pascanu, and Balaji Lakshminarayanan. Adapting auxiliary losses using gradient similarity, 2018. 2 +[16] Mark Everingham, Luc Van Gool, Christopher K I Williams, John Winn, and Andrew Zisserman. The Pascal Visual Object Classes (VOC) Challenge. International Journal of Computer Vision, 88(2):303-338, 2010. 7 +[17] Jörg Fliege and Benar Fux Svaiter. Steepest descent methods for multicriteria optimization. Mathematical Methods of Operations Research, 51(3):479-494, 2000. 3 +[18] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. 7 +[19] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 1 +[20] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. CoRR, abs/1709.01507, 2017. 7 +[21] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. 6, 7 +[22] Xi Lin, Hui-Ling Zhen, Zhenhua Li, Qing-Fu Zhang, and Sam Kwong. Pareto multi-task learning. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32, pages 12060-12070. Curran Associates, Inc., 2019. 2, 3, 6, 7 +[23] Z Liu, P Luo, X Wang, and X Tang. Deep Learning Face Attributes in the Wild. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 3730-3738, 2015. 6, 7 +[24] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3431-3440, 2015. 1 +[25] David Lopez-Paz, Léon Bottou, Bernhard Schölkopf, and Vladimir Vapnik. Unifying distillation and privileged information. In 4th International Conference on Learning Representations, ICLR 2016, 2016. 2 +[26] Pingchuan Ma, Tao Du, and W. Matusik. Efficient continuous pareto exploration in multi-task learning. *ArXiv*, abs/2006.16434, 2020. 2 +[27] Debabrata Mahapatra and Vaibhav Rajan. Multi-Task Learning with User Preferences: Gradient Descent with Controlled Ascent in Pareto Optimization. 2020. 2 +[28] I. Misra, A. Shrivastava, A. Gupta, and M. Hebert. Cross-stitch networks for multi-task learning. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3994-4003, 2016. 1 +[29] Taylor Mordan, Nicolas THOME, Gilles Henaff, and Matthieu Cord. Revisiting multi-task learning with rock: a deep residual auxiliary block for visual detection. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesabianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31, pages 1310-1322. Curran Associates, Inc., 2018. 2 + +[30] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. CoRR, abs/1409.0575, 2014. 7 +[31] Sara Sabour, Nicholas Frosst, and Geoffrey E. Hinton. Dynamic routing between capsules. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, page 3859-3869, Red Hook, NY, USA, 2017. Curran Associates Inc. 6 +[32] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhominov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pages 4510–4520, 2018. 1 +[33] Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, pages 525-536, 2018. 1, 2, 3, 6, 7, 8 +[34] Xiu Su, Shan You, Jiyang Xie, Mingkai Zheng, Fei Wang, Chen Qian, Changshui Zhang, Xiaogang Wang, and Chang Xu. Vision transformer architecture search. arXiv preprint arXiv:2106.13700, 2021. 1 +[35] Xiu Su, Shan You, Mingkai Zheng, Fei Wang, Chen Qian, Changshui Zhang, and Chang Xu. K-shot nas: Learnable weight-sharing for nas with k-shot supernets. arXiv preprint arXiv:2106.06442, 2021. 1 +[36] Fengyi Tang, Cao Xiao, Fei Wang, Jiayu Zhou, and Li-wei H Lehman. Retaining privileged information for multi-task learning. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1369–1377, 2019. 2 +[37] Partoo Vafaeikia, Khashayar Namdar, and Farzad Khalvati. A brief review of deep multi-task learning and auxiliary task learning, 2020. 2 +[38] Simon Vandenhende, Stamatios Georgoulis, Wouter Van Gansbeke, Marc Proesmans, Dengxin Dai, and Luc Van Gool. Multi-task learning for dense prediction tasks: A survey, 2020. 1 +[39] Vladimir Vapnik and Rauf Izmailov. Learning using privileged information: similarity control and knowledge transfer. J. Mach. Learn. Res., 16(1):2023-2049, 2015. 2 +[40] Vladimir Vapnik and Akshay Vashist. A new learning paradigm: Learning using privileged information. Neural networks, 22(5-6):544-557, 2009. 2 +[41] Xiaojie Wang, Rui Zhang, Yu Sun, and Jianzhong Qi. Adversarial distillation for learning with privileged provisions. IEEE transactions on pattern analysis and machine intelligence, 2019. 2 +[42] H. Xiao, K. Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. ArXiv, abs/1708.07747, 2017. 6 +[43] D. Xu, W. Ouyang, X. Wang, and N. Sebe. Pad-net: Multi-tasks guided prediction-and-distillation network for simultaneous depth estimation and scene parsing. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 675-684, 2018. 2 + +[44] Erkun Yang, Cheng Deng, Wei Liu, Xianglong Liu, Dacheng Tao, and Xinbo Gao. Pairwise relationship guided deep hashing for cross-modal retrieval. In proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. 1 +[45] Jonghwa Yim and Sang Hwan Kim. Learning boost by exploiting the auxiliary task in multi-task domain, 2020. 2 +[46] Shan You, Tao Huang, Mingmin Yang, Fei Wang, Chen Qian, and Changshui Zhang. Greedynas: Towards fast one-shot nas with greedy supernet. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1999-2008, 2020. 1 +[47] Shan You, Chang Xu, Yunhe Wang, Chao Xu, and Dacheng Tao. Privileged multi-label learning. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 3336-3342, 2017. 2 +[48] Shan You, Chang Xu, Chao Xu, and Dacheng Tao. Learning from multiple teacher networks. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1285–1294, 2017. 1 +[49] Shan You, Chang Xu, Chao Xu, and Dacheng Tao. Learning with single-teacher multi-student. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. 2 +[50] Yu Zhang and Qiang Yang. A survey on multi-task learning, 2018. 1 +[51] Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaouu Tang. Facial landmark detection by deep multi-task learning. In David Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars, editors, Computer Vision – ECCV 2014, pages 94–108, Cham, 2014. Springer International Publishing. 1 +[52] Mingkai Zheng, Shan You, Fei Wang, Chen Qian, Changshui Zhang, Xiaogang Wang, and Chang Xu. Ressl: Relational self-supervised learning with weak augmentation. arXiv preprint arXiv:2107.09282, 2021. 1 \ No newline at end of file diff --git a/learningwithprivilegedtasks/images.zip b/learningwithprivilegedtasks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9cf962650640d9cc96b4c54b54abe5b568d020ab --- /dev/null +++ b/learningwithprivilegedtasks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8806e20514469f269710a9fd2f44a4534ee999bb03d3f417fefeb6f6998c818 +size 461487 diff --git a/learningwithprivilegedtasks/layout.json b/learningwithprivilegedtasks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e89eeda9f45068f3c7315d4c885254d36a2df337 --- /dev/null +++ b/learningwithprivilegedtasks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e63425335834877d2f865ff049129cf7f222b0121f6da770567b623c98b715fb +size 473854